18 #ifndef LIBMESH_MESH_TRIANGLE_HOLES_H 19 #define LIBMESH_MESH_TRIANGLE_HOLES_H 21 #include "libmesh/libmesh_config.h" 24 #include "libmesh/boundary_info.h" 25 #include "libmesh/point.h" 26 #include "libmesh/triangulator_interface.h" 27 #include "libmesh/vector_value.h" 59 virtual ~Hole() =
default;
64 virtual unsigned int n_points()
const = 0;
69 virtual Point point(
const unsigned int n)
const = 0;
99 std::vector<unsigned int> seg;
127 Point ray_target)
const;
159 virtual unsigned int n_points()
const override;
161 virtual Point point(
const unsigned int n)
const override;
205 virtual Point point(
const unsigned int n)
const override;
251 std::vector<Point> points);
254 std::vector<Point> points,
270 virtual unsigned int n_points()
const override;
272 virtual Point point(
const unsigned int n)
const override;
329 std::set<std::size_t> ids = {});
331 virtual unsigned int n_points()
const override;
333 virtual Point point(
const unsigned int n)
const override;
399 #endif // LIBMESH_MESH_TRIANGLE_HOLES_H bool _refine_bdy_allowed
Whether to allow boundary refinement.
AffineHole(const Hole &underlying, Real angle, const Point &shift)
Constructor specifying the underlying hole, and the rotation angle (in radians, done first) and trans...
virtual Point point(const unsigned int n) const override
Return the nth point defining the hole.
std::vector< Point > _points
The sorted vector of points which makes up the hole.
virtual unsigned int n_points() const override
The number of geometric points which define the hole.
An abstract class for defining a 2-dimensional hole.
std::vector< Point > _points
Reference to the vector of points which makes up the hole.
ArbitraryHole(const Point ¢er, std::vector< Point > points)
The fastest constructor requires a point which lies in the interior of the hole and a reference to a ...
unsigned int _n_points
number of points used to describe the hole.
std::vector< Real > find_ray_intersections(Point ray_start, Point ray_target) const
Helper function for contains(), also useful for MeshedHole::inside()
Real area() const
Return the area of the hole.
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int n_points() const override
The number of geometric points which define the hole.
virtual Point inside() const override
Return an (arbitrary) point which lies inside the hole.
MeshedHole(const MeshBase &mesh, std::set< std::size_t > ids={})
The constructor requires a mesh defining the hole, and optionally boundary+subdomain ids restricting ...
This is the MeshBase class.
virtual Point inside() const override
Return an (arbitrary) point which lies inside the hole.
Real _radius
circular hole radius
Point transform(const Point &p) const
Rotate-and-shift equations.
A way to translate and/or rotate an existing hole; perhaps to tile it in many places or to put it at ...
virtual unsigned int n_points() const override
The number of geometric points which define the hole.
Region(const Point ¢er, Real attribute=0, Real max_area=-std::numeric_limits< Real >::max())
Constructor.
const Point _center
Arbitrary (x,y) location inside the region.
const std::vector< Point > & get_points() const
void set_points(std::vector< Point > points)
virtual unsigned int n_points() const override
The number of geometric points which define the hole.
Point calculate_inside_point() const
Calculate an inside point based on our boundary.
const Hole & _underlying
Hole to transform.
virtual bool refine_boundary_allowed() const
Get whether or not the triangulation is allowed to refine the mesh boundary when refining the interio...
virtual std::vector< unsigned int > segment_indices() const override
Starting indices of points for a hole with multiple disconnected boundaries.
Real _attribute
Attribute of the region Default value for attribute is zero.
Real _max_area
Maximum area that is allowed for all triangles in this region Default negative maximum area means tha...
bool contains(Point p) const
Return true iff p lies inside the hole.
Point _center
(x,y) location of the center of the hole
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Point point(const unsigned int n) const override
Return the nth point defining the hole.
A class for defining a 2-dimensional region for Triangle.
Another concrete instantiation of the hole, as general as ArbitraryHole, but based on an existing 1D ...
virtual void set_refine_boundary_allowed(bool refine_bdy_allowed)
Set whether or not a triangulator is allowed to refine the hole boundary when refining the mesh inter...
Real _angle
Angle to rotate (counter-clockwise) by.
virtual Point inside() const override
Return an (arbitrary) point which lies inside the hole.
A concrete instantiation of the Hole class that describes polygonal (triangular, square, pentagonal, ...) holes.
virtual Point point(const unsigned int n) const override
Return the nth point defining the hole.
virtual Point inside() const override
Return an (arbitrary) point which lies inside the hole.
virtual Point point(const unsigned int n) const override
Return the nth point defining the hole.
Another concrete instantiation of the hole, this one should be sufficiently general for most non-poly...
Hole()=default
Constructor.
std::vector< unsigned int > _segment_indices
RealGradient areavec() const
Return a vector with right-hand-rule orientation and length of twice area() squared.
virtual ~Hole()=default
Destructor.
Point _center
arbitrary (x,y) location inside the hole
Point _shift
(x,y) location to shift (0,0) to
virtual std::vector< unsigned int > segment_indices() const
Starting indices of points for a hole with multiple disconnected boundaries.
virtual Point point(const unsigned int n) const =0
Return the nth point defining the hole.
PolygonHole(const Point ¢er, Real radius, unsigned int n_points)
Constructor specifying the center, radius, and number of points which comprise the hole...
Point _center
An (x,y) location inside the hole.
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual Point inside() const =0
Return an (arbitrary) point which lies inside the hole.
virtual unsigned int n_points() const =0
The number of geometric points which define the hole.