19 #ifdef LIBMESH_HAVE_TETGEN 79 std::ostringstream oss;
93 unsigned int node_labels[4];
95 for (
unsigned int i=0; i<num_elements; ++i)
100 for (
unsigned int j=0; j<elem->
n_nodes(); ++j)
144 unsigned int node_labels[3];
146 for (
unsigned int i=0; i<num_elements; ++i)
151 for (
unsigned int j=0; j<elem->
n_nodes(); ++j)
166 double volume_constraint)
169 std::vector<Point> noholes;
176 double quality_constraint,
177 double volume_constraint)
197 (facet_num, cast_int<int>(holes.size()));
209 for (
unsigned int j=0; j<elem->n_nodes(); ++j)
213 unsigned libmesh_node_id = elem->node_id(j);
217 std::vector<unsigned>::iterator node_iter =
225 libmesh_error_msg(
"Global node " << libmesh_node_id <<
" not found in sequential node map!");
227 int sequential_index = cast_int<int>
250 if (holes.size() > 0)
252 std::vector<Point>::const_iterator ihole;
253 unsigned hole_index = 0;
254 for (ihole=holes.begin(); ihole!=holes.end(); ++ihole)
255 tetgen_wrapper.
set_hole(hole_index++, (*ihole)(0), (*ihole)(1), (*ihole)(2));
264 std::ostringstream oss;
268 if (quality_constraint != 0)
269 oss <<
"q" << std::fixed << quality_constraint;
271 if (volume_constraint != 0)
272 oss <<
"a" << std::fixed << volume_constraint;
274 std::string params = oss.str();
281 REAL x=0., y=0., z=0.;
296 for (
unsigned int i=old_nodesnum; i<num_nodes; i++)
320 unsigned int node_labels[4];
322 for (
unsigned int i=0; i<num_elements; i++)
328 for (
unsigned int j=0; j<elem->
n_nodes(); j++)
363 wrapper.
set_node(index++, (*node)(0), (*node)(1), (*node)(2));
374 for (
unsigned int j=0; j<elem->
n_nodes(); ++j)
401 if (elem->type() !=
TRI3)
407 for (
auto neigh : elem->neighbor_ptr_range())
409 if (neigh ==
nullptr)
429 libMesh::err <<
"Error! Conforming Delaunay mesh tetrahedralization requires a convex hull." << std::endl;
433 libMesh::err <<
"Non-TRI3 elements were found in the input Mesh. ";
434 libMesh::err <<
"A constrained Delaunay triangulation requires a convex hull of TRI3 elements." << std::endl;
437 libmesh_error_msg(
"Consider calling TetGenMeshInterface::pointset_convexhull() followed by Mesh::find_neighbors() first.");
451 if (elem->type() ==
TRI3)
465 #endif // #ifdef LIBMESH_HAVE_TETGEN
A 2D triangular element with 3 nodes.
void set_switches(const std::string &)
virtual Node *& set_node(const unsigned int i)
A geometric point in (x,y,z) space associated with a DOF.
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 triangulate_conformingDelaunayMesh(double quality_constraint=0., double volume_constraint=0.)
The base class for all geometric element types.
std::vector< unsigned > _sequential_to_libmesh_node_map
void set_vertex(unsigned i, unsigned j, unsigned k, int nodeindex)
TetGenMeshInterface(UnstructuredMesh &mesh)
void allocate_polygon_vertexlist(unsigned i, unsigned j, int numofvertices)
void process_hull_integrity_result(unsigned result)
void allocate_pointlist(int numofpoints)
const BoundaryInfo & get_boundary_info() const
int get_numberoftetrahedra()
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id)=0
void triangulate_pointset()
virtual void delete_elem(Elem *e)=0
virtual SimpleRange< element_iterator > element_ptr_range()=0
void set_node(unsigned i, REAL x, REAL y, REAL z)
virtual unsigned int n_nodes() const =0
Base class for Replicated and Distributed meshes.
void triangulate_conformingDelaunayMesh_carvehole(const std::vector< Point > &holes, double quality_constraint=0., double volume_constraint=0.)
virtual Elem * add_elem(Elem *e)=0
virtual SimpleRange< node_iterator > node_ptr_range()=0
void assign_nodes_to_elem(unsigned *node_labels, Elem *elem)
OStreamProxy err(std::cerr)
void set_switches(const std::string &s)
void regenerate_id_sets()
void allocate_facet_polygonlist(unsigned i, int numofpolygons)
void set_hole(unsigned i, REAL x, REAL y, REAL z)
int get_numberoftrifaces()
ForwardIterator binary_find(ForwardIterator first, ForwardIterator last, const T &value)
A 3D tetrahedral element with 4 nodes.
unsigned check_hull_integrity()
void allocate_facetlist(int numoffacets, int numofholes)
void fill_pointlist(TetGenWrapper &wrapper)
void pointset_convexhull()
virtual dof_id_type n_elem() const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
void delete_2D_hull_elements()
A geometric point in (x,y,z) space.
virtual dof_id_type n_nodes() const =0