19 #ifdef LIBMESH_HAVE_TETGEN 32 tetgen_output(new tetgenio)
78 if (i >= static_cast<unsigned>(
tetgen_output->numberofpoints))
79 libmesh_error_msg(
"Error, requested point " \
81 <<
", but there are only " \
83 <<
" points available.");
129 libmesh_assert(
tetgen_output->numberoftetrahedronattributes>0);
145 libmesh_error_msg(
"Cannot allocate on top of previously allocated memory!");
161 if (s.size() >=
sizeof(buffer)-1)
162 libmesh_error_msg(
"Fixed size buffer of length " \
164 <<
" not large enough to hold TetGen switches.");
167 buffer[ s.copy( buffer ,
sizeof( buffer ) - 1 ) ] =
'\0' ;
169 if (!
tetgen_be.parse_commandline(buffer))
170 libMesh::out <<
"TetGen replies: Wrong switches!" << std::endl;
218 libmesh_error_msg(
"Cannot allocate on top of previously allocated memory!");
223 for (
int i=0; i<numoffacets; i++)
224 this->
tetgen_data.init(&(this->tetgen_data.facetlist[i]));
233 libmesh_error_msg(
"Cannot allocate on top of previously allocated memory!");
250 libmesh_error_msg(
"Cannot allocate on top of previously allocated memory!");
262 this->
tetgen_data.facetlist[i].numberofpolygons = num;
270 this->
tetgen_data.facetlist[i].numberofholes = num;
282 if (numofpolygons > 0)
285 if (this->
tetgen_data.facetlist[i].polygonlist !=
nullptr)
286 libmesh_error_msg(
"Cannot allocate on top of previously allocated memory!");
289 this->
tetgen_data.facetlist[i].polygonlist =
new tetgenio::polygon[numofpolygons];
291 for (
int j=0; j<this->
tetgen_data.facetlist[i].numberofpolygons; j++)
292 this->
tetgen_data.init(&(this->tetgen_data.facetlist[i].polygonlist[j]));
301 this->
tetgen_data.facetlist[i].polygonlist[j].numberofvertices = num;
311 if (numofvertices > 0)
314 if (this->
tetgen_data.facetlist[i].polygonlist[j].vertexlist !=
nullptr)
315 libmesh_error_msg(
"Cannot allocate on top of previously allocated memory!");
318 this->
tetgen_data.facetlist[i].polygonlist[j].vertexlist =
new int[numofvertices];
328 this->
tetgen_data.facetlist[i].polygonlist[j].vertexlist[k] = nodeindex;
334 REAL attribute,
REAL vol_constraint)
336 unsigned index = i*5;
347 #endif // LIBMESH_HAVE_TETGEN void set_polygon_numberofvertices(unsigned i, unsigned j, int num)
void set_numberofregions(int i)
void set_numberofpoints(int i)
REAL get_element_attribute(unsigned i)
void set_facet_numberofpolygons(unsigned i, int num)
int get_element_node(unsigned i, unsigned j)
void get_output_node(unsigned i, REAL &x, REAL &y, REAL &z)
int get_triface_node(unsigned i, unsigned j)
void set_facet_numberofholes(unsigned i, int num)
void set_numberoffacets(int i)
void set_vertex(unsigned i, unsigned j, unsigned k, int nodeindex)
void allocate_polygon_vertexlist(unsigned i, unsigned j, int numofvertices)
void allocate_pointlist(int numofpoints)
int get_numberoftetrahedra()
void set_node(unsigned i, REAL x, REAL y, REAL z)
void set_switches(const std::string &s)
std::unique_ptr< tetgenio > tetgen_output
void allocate_facet_polygonlist(unsigned i, int numofpolygons)
void set_hole(unsigned i, REAL x, REAL y, REAL z)
void set_numberofholes(int i)
void allocate_regionlist(int numofregions)
int get_numberoftrifaces()
void set_region(unsigned i, REAL x, REAL y, REAL z, REAL attribute, REAL vol_constraint)
void allocate_facetlist(int numoffacets, int numofholes)
OStreamProxy out(std::cout)