19 #ifndef LIBMESH_MESH_TRIANGULATOR_INTERFACE_H 20 #define LIBMESH_MESH_TRIANGULATOR_INTERFACE_H 23 #include "libmesh/libmesh_config.h" 26 #include "libmesh/libmesh.h" 27 #include "libmesh/point.h" 29 #include "libmesh/function_base.h" 39 class UnstructuredMesh;
40 template <
unsigned int KDDim>
49 const unsigned int num_nearest_pts,
50 const unsigned int power,
51 const Real background_value,
52 const Real background_eff_dist);
61 void init_mfi (
const std::vector<Point> & input_pts,
62 const std::vector<Real> & input_vals);
65 const Real )
override;
72 output(0) = (*this)(p,time);
76 virtual std::unique_ptr<FunctionBase<Real>>
clone()
const override 187 { libmesh_not_implemented(); }
231 { libmesh_not_implemented(); }
279 std::vector<std::pair<unsigned int, unsigned int>>
segments;
321 const unsigned int num_nearest_pts,
322 const unsigned int power,
323 const Real background_value,
324 const Real background_eff_dist);
342 std::vector<Real> & function_sizes,
343 const Real & area_factor = 1.5);
481 #endif // ifndef LIBMESH_MESH_TRIANGULATOR_INTERFACE_H TriangulationType
The TriangulationType is used with the general triangulate function defined below.
FunctionBase< Real > * get_auto_area_function()
Get the auto area function.
ElemType
Defines an enum for geometric element types.
bool _verify_hole_boundaries
Flag which tells if we want to check hole geometry.
void init_mfi(const std::vector< Point > &input_pts, const std::vector< Real > &input_vals)
virtual bool refine_boundary_allowed() const
Get whether or not the triangulation is allowed to refine the mesh boundary when refining the interio...
Inverse distance interpolation.
bool _insert_extra_points
Flag which tells whether or not to insert additional nodes before triangulation.
virtual void triangulate()=0
This is the main public interface for this function.
const Parallel::Communicator & _comm
std::set< std::size_t > _bdy_ids
A set of ids to allow on the outer boundary loop.
void insert_any_extra_boundary_points()
Helper function to add extra points (midpoints of initial segments) to a PSLG triangulation.
virtual FunctionBase< Real > * get_desired_area_function()
Get the function giving desired triangle area as a function of position, or nullptr if no such functi...
const Real _background_value
void set_verify_hole_boundaries(bool v)
Verifying that hole boundaries don't cross the outer boundary or each other is something like O(N_bdy...
virtual Real operator()(const Point &p, const Real) override
const std::vector< int > * _markers
Boundary markers.
void resize(const unsigned int n)
Resize the vector.
Real _minimum_angle
Minimum angle in triangles.
const std::vector< Region * > * _regions
A pointer to a vector of Regions*s.
void set_interpolate_boundary_points(int n_points)
Complicated setter, for compatibility with insert_extra_points()
int _interpolate_boundary_points
Flag which tells how many additional nodes should be inserted between each pair of original mesh poin...
UnstructuredMesh & _mesh
Reference to the mesh which is to be created by triangle.
void set_outer_boundary_ids(std::set< std::size_t > bdy_ids)
A set of ids to allow on the outer boundary loop: interpreted as boundary ids of 2D elements and/or s...
The libMesh namespace provides an interface to certain functionality in the library.
void attach_region_list(const std::vector< Region *> *regions)
Attaches regions for using attribute to set subdomain IDs and better controlling the triangle sizes w...
ElemType & elem_type()
Sets and/or gets the desired element type.
Real _desired_area
The desired area for the elements in the resulting mesh.
bool & insert_extra_points()
Sets and/or gets the flag for inserting add'l points.
virtual std::unique_ptr< FunctionBase< Real > > clone() const override
virtual ~TriangulatorInterface()=default
Empty destructor.
TriangulationType & triangulation_type()
Sets and/or gets the desired triangulation type.
Does nothing, used as a "null" value.
void elems_to_segments()
Helper function to create PSLG segments from our other boundary-defining options (1D mesh edges...
const Real _background_eff_dist
ElemType _elem_type
The type of elements to generate.
void calculate_auto_desired_area_samples(std::vector< Point > &function_points, std::vector< Real > &function_sizes, const Real &area_factor=1.5)
The external boundary and all hole boundaries are collected.
bool _quiet
Flag which tells if we want to suppress stdout outputs.
const unsigned int _power
void attach_hole_list(const std::vector< Hole *> *holes)
Attaches a vector of Hole* pointers which will be meshed around.
The UnstructuredMesh class is derived from the MeshBase class.
bool get_verify_hole_boundaries() const
Real & minimum_angle()
Sets and/or gets the minimum desired angle.
virtual void set_desired_area_function(FunctionBase< Real > *)
Set a function giving desired triangle area as a function of position.
const std::vector< Hole * > * _holes
A pointer to a vector of Hole*s.
bool has_auto_area_function()
Whether or not an auto area function has been set.
std::unique_ptr< InverseDistanceInterpolation< 3 > > _auto_area_mfi
virtual void set_refine_boundary_allowed(bool)
Set whether or not the triangulation is allowed to refine the mesh boundary when refining the interio...
virtual ~AutoAreaFunction()
void increase_triangle_order()
Helper function to upconvert Tri3 to any higher order triangle type if requested via _elem_type...
const std::set< std::size_t > & get_outer_boundary_ids() const
First generate a convex hull from the set of points passed in, and then triangulate this set of point...
unsigned int total_hole_points()
Helper function to count points in and verify holes.
std::vector< Point > segment_midpoints
When constructing a second-order triangulation from a second-order boundary, we may do the triangulat...
Real & desired_area()
Sets and/or gets the desired triangle area.
TriangulatorInterface(UnstructuredMesh &mesh)
The constructor.
Triangulate the interior of a Planar Straight Line Graph, which is defined implicitly by the order of...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::pair< unsigned int, unsigned int > > segments
When constructing a PSLG, if the node numbers do not define the desired boundary segments implicitly ...
void nodes_to_segments(dof_id_type max_node_id)
Helper function to create PSLG segments from our node ordering, up to the maximum node id...
const unsigned int _num_nearest_pts
bool _smooth_after_generating
Flag which tells whether we should smooth the mesh after it is generated.
int get_interpolate_boundary_points() const
Complicated getter, for compatibility with insert_extra_points()
std::unique_ptr< AutoAreaFunction > _auto_area_function
The auto area function based on the spacing of boundary points.
void attach_boundary_marker(const std::vector< int > *markers)
Attaches boundary markers.
AutoAreaFunction(const Parallel::Communicator &comm, const unsigned int num_nearest_pts, const unsigned int power, const Real background_value, const Real background_eff_dist)
void verify_holes(const Hole &outer_bdy)
Helper function to check holes for intersections if requested.
Defines a dense vector for use in Finite Element-type computations.
AutoAreaFunction & operator=(const AutoAreaFunction &)
void set_auto_area_function(const Parallel::Communicator &comm, const unsigned int num_nearest_pts, const unsigned int power, const Real background_value, const Real background_eff_dist)
Generate an auto area function based on spacing of boundary points.
Base class for functors that can be evaluated at a point and (optionally) time.
TriangulationType _triangulation_type
The type of triangulation to perform: choices are: convex hull PSLG.
A Point defines a location in LIBMESH_DIM dimensional Real space.
void ErrorVector unsigned int
bool & quiet()
Whether not to silence internal messages to stdout.
bool & smooth_after_generating()
Sets/gets flag which tells whether to do two steps of Laplace mesh smoothing after generating the gri...