Skip to content
Snippets Groups Projects
Commit eb559d04 authored by Stephan Schulz's avatar Stephan Schulz
Browse files

do not modify n of get_vertices and get_prev_vertices

parent 0736ab75
No related branches found
No related tags found
1 merge request!8Refactor
......@@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "../include/ALL.hpp"
#include <cassert>
#include <vector>
extern "C"
......@@ -96,12 +97,12 @@ extern "C"
}
// wrapper to return new vertices
void all_get_vertices_f(ALL<double,double>* all_obj, int* n_vertices, double* vertices)
void all_get_vertices_f(ALL<double,double>* all_obj, int n_vertices, double* vertices)
{
std::vector<ALL_Point<double>> tmp_vertices = all_obj->get_vertices();
int dimension = all_obj->get_dimension();
*n_vertices = tmp_vertices.size();
for (int i = 0; i < *n_vertices; ++i)
assert(n_vertices == tmp_vertices.size());
for (int i = 0; i < n_vertices; ++i)
{
for (int j = 0; j < dimension; ++j)
{
......@@ -111,12 +112,12 @@ extern "C"
}
// wrapper to return new vertices
void all_get_prev_vertices_f(ALL<double,double>* all_obj, int* n_vertices, double* prev_vertices)
void all_get_prev_vertices_f(ALL<double,double>* all_obj, int n_vertices, double* prev_vertices)
{
std::vector<ALL_Point<double>> tmp_vertices = all_obj->get_prev_vertices();
int dimension = all_obj->get_dimension();
*n_vertices = tmp_vertices.size();
for (int i = 0; i < *n_vertices; ++i)
assert(n_vertices == tmp_vertices.size());
for (int i = 0; i < n_vertices; ++i)
{
for (int j = 0; j < dimension; ++j)
{
......
......@@ -99,14 +99,14 @@ MODULE ALL_module
BIND(C,NAME="all_get_vertices_f")
USE ISO_C_BINDING
TYPE(c_ptr), VALUE :: obj
INTEGER(c_int) :: n
INTEGER(c_int), VALUE :: n
REAL(c_double) :: vertices(*)
END SUBROUTINE
SUBROUTINE ALL_get_prev_vertices_int(obj,n,vertices) &
BIND(C,NAME="all_get_prev_vertices_f")
USE ISO_C_BINDING
TYPE(c_ptr), VALUE :: obj
INTEGER(c_int) :: n
INTEGER(c_int), VALUE :: n
REAL(c_double) :: vertices(*)
END SUBROUTINE
SUBROUTINE ALL_print_vtk_outlines_int(obj, step) BIND(C,NAME="all_print_vtk_outlines_f")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment