libMesh
|
An abstract class for defining a 2-dimensional hole. More...
#include <mesh_triangle_holes.h>
Public Member Functions | |
Hole ()=default | |
Constructor. More... | |
virtual | ~Hole ()=default |
Destructor. More... | |
virtual unsigned int | n_points () const =0 |
The number of geometric points which define the hole. More... | |
virtual unsigned int | n_midpoints () const |
The number of geometric midpoints along each of the sides defining the hole. More... | |
virtual Point | point (const unsigned int n) const =0 |
Return the nth point defining the hole. More... | |
virtual Point | midpoint (const unsigned int, const unsigned int) const |
Return the midpoint m along the side n defining the hole. More... | |
virtual Point | inside () const =0 |
Return an (arbitrary) point which lies inside the hole. More... | |
bool | contains (Point p) const |
Return true iff p lies inside the hole. More... | |
Real | area () const |
Return the area of the hole. More... | |
RealGradient | areavec () const |
Return a vector with right-hand-rule orientation and length of twice area() squared. More... | |
virtual std::vector< unsigned int > | segment_indices () const |
Starting indices of points for a hole with multiple disconnected boundaries. More... | |
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 interior. More... | |
virtual bool | refine_boundary_allowed () const |
Get whether or not the triangulation is allowed to refine the mesh boundary when refining the interior. More... | |
Protected Member Functions | |
std::vector< Real > | find_ray_intersections (Point ray_start, Point ray_target) const |
Helper function for contains(), also useful for MeshedHole::inside() More... | |
Point | calculate_inside_point () const |
Calculate an inside point based on our boundary. More... | |
Protected Attributes | |
bool | _refine_bdy_allowed = true |
Whether to allow boundary refinement. More... | |
An abstract class for defining a 2-dimensional hole.
We assume that the connectivity of the hole is implicit in the numbering of the points, controlled by segment_indices vector. The size of segment_indices is equal to the number of segments plus one. Each segment has segment_indices[i+1]-segment_indices[i] connected points, with node segment_indices[i] is connected to node segment_indices[i+1], node segment_indices[i+1] is connected to node segment_indices[i+2], etc, and the last node "wraps around" to connect back to node segment_indices[i].
Definition at line 48 of file mesh_triangle_holes.h.
|
default |
Constructor.
|
virtualdefault |
Destructor.
Real libMesh::TriangulatorInterface::Hole::area | ( | ) | const |
Return the area of the hole.
This method currently does not take any higher-order hole geometry into account, but treats the hole as a polygon.
Definition at line 184 of file mesh_triangle_holes.C.
References areavec(), and libMesh::TypeVector< T >::norm().
Referenced by libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), and MeshTriangulationTest::testTriangleHoleArea().
RealGradient libMesh::TriangulatorInterface::Hole::areavec | ( | ) | const |
Return a vector with right-hand-rule orientation and length of twice area() squared.
This is useful for determining orientation of non-planar or non-counter-clockwise holes.
This method currently does not take any higher-order hole geometry into account, but treats the hole as a polygon.
Definition at line 190 of file mesh_triangle_holes.C.
References libMesh::TypeVector< T >::cross().
Referenced by area().
|
protected |
Calculate an inside point based on our boundary.
Definition at line 248 of file mesh_triangle_holes.C.
References libMesh::make_range(), and libMesh::Real.
Referenced by libMesh::TriangulatorInterface::ArbitraryHole::ArbitraryHole(), and libMesh::TriangulatorInterface::ArbitraryHole::set_points().
bool libMesh::TriangulatorInterface::Hole::contains | ( | Point | p | ) | const |
Return true iff p
lies inside the hole.
This method currently does not take any higher-order hole geometry into account, but treats the hole as a polygon.
Definition at line 305 of file mesh_triangle_holes.C.
Referenced by libMesh::TriangulatorInterface::verify_holes().
|
protected |
Helper function for contains(), also useful for MeshedHole::inside()
Definition at line 224 of file mesh_triangle_holes.C.
References libMesh::make_range(), and libMesh::Real.
|
pure virtual |
Return an (arbitrary) point which lies inside the hole.
Implemented in libMesh::TriangulatorInterface::MeshedHole, libMesh::TriangulatorInterface::ArbitraryHole, libMesh::TriangulatorInterface::AffineHole, and libMesh::TriangulatorInterface::PolygonHole.
|
inlinevirtual |
Return the midpoint m
along the side n
defining the hole.
Reimplemented in libMesh::TriangulatorInterface::MeshedHole.
Definition at line 80 of file mesh_triangle_holes.h.
|
inlinevirtual |
The number of geometric midpoints along each of the sides defining the hole.
Reimplemented in libMesh::TriangulatorInterface::MeshedHole.
Definition at line 70 of file mesh_triangle_holes.h.
|
pure virtual |
The number of geometric points which define the hole.
Implemented in libMesh::TriangulatorInterface::MeshedHole, libMesh::TriangulatorInterface::ArbitraryHole, libMesh::TriangulatorInterface::AffineHole, and libMesh::TriangulatorInterface::PolygonHole.
Referenced by libMesh::TriangulatorInterface::ArbitraryHole::ArbitraryHole(), libMesh::TriangulatorInterface::AffineHole::n_points(), segment_indices(), and libMesh::Poly2TriTriangulator::triangulate_current_points().
|
pure virtual |
Return the nth point defining the hole.
Implemented in libMesh::TriangulatorInterface::MeshedHole, libMesh::TriangulatorInterface::ArbitraryHole, libMesh::TriangulatorInterface::AffineHole, and libMesh::TriangulatorInterface::PolygonHole.
Referenced by libMesh::TriangulatorInterface::ArbitraryHole::ArbitraryHole(), and libMesh::Poly2TriTriangulator::triangulate_current_points().
|
inlinevirtual |
Get whether or not the triangulation is allowed to refine the mesh boundary when refining the interior.
True by default.
Definition at line 140 of file mesh_triangle_holes.h.
References _refine_bdy_allowed.
Referenced by libMesh::Poly2TriTriangulator::is_refine_boundary_allowed(), and MeshTriangulationTest::testPoly2TriHolesInteriorRefinedBase().
|
inlinevirtual |
Starting indices of points for a hole with multiple disconnected boundaries.
Reimplemented in libMesh::TriangulatorInterface::ArbitraryHole.
Definition at line 118 of file mesh_triangle_holes.h.
References n_points().
|
inlinevirtual |
Set whether or not a triangulator is allowed to refine the hole boundary when refining the mesh interior.
This is true by default, but may be set to false to make the hole boundary more predictable (and so easier to stitch to other meshes) later.
Definition at line 133 of file mesh_triangle_holes.h.
References _refine_bdy_allowed.
Referenced by MeshTriangulationTest::testPoly2TriHolesInteriorRefinedBase().
|
protected |
Whether to allow boundary refinement.
True by default; specified here so we can use the default constructor.
Definition at line 160 of file mesh_triangle_holes.h.
Referenced by refine_boundary_allowed(), and set_refine_boundary_allowed().