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"
39class UnstructuredMesh;
40template <
unsigned int KDDim>
41class InverseDistanceInterpolation;
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(); }
290 std::vector<std::pair<unsigned int, unsigned int>>
segments;
340 const unsigned int num_nearest_pts,
341 const unsigned int power,
342 const Real background_value,
343 const Real background_eff_dist);
361 std::vector<Real> & function_sizes,
362 const Real & area_factor = 1.5);
void ErrorVector unsigned int
void init_mfi(const std::vector< Point > &input_pts, const std::vector< Real > &input_vals)
AutoAreaFunction & operator=(const AutoAreaFunction &)
std::unique_ptr< InverseDistanceInterpolation< 3 > > _auto_area_mfi
const Parallel::Communicator & _comm
const Real _background_eff_dist
virtual Real operator()(const Point &p, const Real) override
const Real _background_value
const unsigned int _power
AutoAreaFunction(const AutoAreaFunction &)
virtual std::unique_ptr< FunctionBase< Real > > clone() const override
const unsigned int _num_nearest_pts
AutoAreaFunction(AutoAreaFunction &&)=delete
virtual ~AutoAreaFunction()
Defines a dense vector for use in Finite Element-type computations.
void resize(const unsigned int n)
Resize the vector.
Base class for functors that can be evaluated at a point and (optionally) time.
A Point defines a location in LIBMESH_DIM dimensional Real space.
void increase_triangle_order()
Helper function to upconvert Tri3 to any higher order triangle type if requested via _elem_type.
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...
bool _verify_hole_boundaries
Flag which tells if we want to check hole geometry.
virtual void set_desired_area_function(FunctionBase< Real > *)
Set a function giving desired triangle area as a function of position.
ElemType _elem_type
The type of elements to generate.
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...
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,...
std::set< std::size_t > _bdy_ids
A set of ids to allow on the outer boundary loop.
void elems_to_segments()
Helper function to create PSLG segments from our other boundary-defining options (1D mesh edges,...
Real & minimum_angle()
Sets and/or gets the minimum desired angle.
void attach_boundary_marker(const std::vector< int > *markers)
Attaches boundary markers.
bool _smooth_after_generating
Flag which tells whether we should smooth the mesh after it is generated.
TriangulationType & triangulation_type()
Sets and/or gets the desired triangulation type.
virtual void triangulate()=0
This is the main public interface for this function.
Real _desired_area
The desired area for the elements in the resulting mesh.
void fixup_tri7_center_nodes()
Helper called at the end of increase_triangle_order() for TRI7 to reposition the interior node to the...
bool & quiet()
Whether not to silence internal messages to stdout.
int _interpolate_boundary_points
Flag which tells how many additional nodes should be inserted between each pair of original mesh poin...
Real _minimum_angle
Minimum angle in triangles.
bool get_fixup_tri7_center_nodes() const
virtual ~TriangulatorInterface()=default
Empty destructor.
void insert_any_extra_boundary_points()
Helper function to add extra points (midpoints of initial segments) to a PSLG triangulation.
unsigned int total_hole_points()
Helper function to count points in and verify holes.
TriangulationType
The TriangulationType is used with the general triangulate function defined below.
@ PSLG
Triangulate the interior of a Planar Straight Line Graph, which is defined implicitly by the order of...
@ INVALID_TRIANGULATION_TYPE
Does nothing, used as a "null" value.
@ GENERATE_CONVEX_HULL
First generate a convex hull from the set of points passed in, and then triangulate this set of point...
bool & smooth_after_generating()
Sets/gets flag which tells whether to do two steps of Laplace mesh smoothing after generating the gri...
bool get_verify_hole_boundaries() const
virtual bool refine_boundary_allowed() const
Get whether or not the triangulation is allowed to refine the mesh boundary when refining the interio...
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...
const std::vector< Hole * > * _holes
A pointer to a vector of Hole*s.
const std::vector< int > * _markers
Boundary markers.
bool _fixup_tri7_center_nodes
Flag which tells if we want to relocate TRI7 interior nodes to the curved-mapping centroid after snap...
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 ...
bool has_auto_area_function()
Whether or not an auto area function has been set.
const std::vector< Region * > * _regions
A pointer to a vector of Regions*s.
UnstructuredMesh & _mesh
Reference to the mesh which is to be created by triangle.
const std::set< std::size_t > & get_outer_boundary_ids() const
int get_interpolate_boundary_points() const
Complicated getter, for compatibility with insert_extra_points()
bool & insert_extra_points()
Sets and/or gets the flag for inserting add'l points.
void verify_holes(const Hole &outer_bdy)
Helper function to check holes for intersections if requested.
virtual void set_refine_boundary_allowed(bool)
Set whether or not the triangulation is allowed to refine the mesh boundary when refining the interio...
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.
void attach_hole_list(const std::vector< Hole * > *holes)
Attaches a vector of Hole* pointers which will be meshed around.
Real & desired_area()
Sets and/or gets the desired triangle area.
ElemType & elem_type()
Sets and/or gets the desired element type.
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...
std::vector< Point > segment_midpoints
When constructing a second-order triangulation from a second-order boundary, we may do the triangulat...
TriangulationType _triangulation_type
The type of triangulation to perform: choices are: convex hull PSLG.
std::vector< Point > segment_midpoints_keys
When saving the midpoint location data, we need to save the corresponding segment information too.
void verify_quadratic_elements()
Helper called at the end of increase_triangle_order() to verify that no boundary-midpoint snap has ta...
std::unique_ptr< AutoAreaFunction > _auto_area_function
The auto area function based on the spacing of boundary points.
bool _insert_extra_points
Flag which tells whether or not to insert additional nodes before triangulation.
bool _quiet
Flag which tells if we want to suppress stdout outputs.
void set_fixup_tri7_center_nodes(bool v)
For TRI7 elements, after boundary mid-edge nodes have been snapped to a curved boundary in increase_t...
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.
FunctionBase< Real > * get_auto_area_function()
Get the auto area function.
void set_interpolate_boundary_points(int n_points)
Complicated setter, for compatibility with insert_extra_points()
The UnstructuredMesh class is derived from the MeshBase class.
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real