libMesh
|
Another concrete instantiation of the hole, as general as ArbitraryHole, but based on an existing 1D or 2D mesh. More...
#include <mesh_triangle_holes.h>
Public Member Functions | |
MeshedHole (const MeshBase &mesh, std::set< std::size_t > ids={}) | |
The constructor requires a mesh defining the hole, and optionally boundary+subdomain ids restricting the definition. More... | |
virtual unsigned int | n_points () const override |
The number of geometric points which define the hole. More... | |
virtual unsigned int | n_midpoints () const override |
The number of geometric midpoints along each of the sides defining the hole. More... | |
virtual Point | point (const unsigned int n) const override |
Return the nth point defining the hole. More... | |
virtual Point | midpoint (const unsigned int m, const unsigned int n) const override |
Return the midpoint m along the side n defining the hole. More... | |
virtual Point | inside () const override |
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... | |
Private Attributes | |
Point | _center |
An (x,y) location inside the hole. More... | |
std::vector< Point > | _points |
The sorted vector of points which makes up the hole. More... | |
std::vector< Point > | _midpoints |
The sorted vector of midpoints in between points along the edges of the hole. More... | |
Another concrete instantiation of the hole, as general as ArbitraryHole, but based on an existing 1D or 2D mesh.
If ids are given, 2D edges on a boundary with a listed id or 1D edges in a subdomain with a listed id will define the hole.
If no ids are given, the hole will be defined by all 1D Edge elements and all outward-facing 2D boundary edges.
In either case, the hole definition should give a single connected boundary, topologically a circle. The hole is defined when the MeshedHole is constructed, and ignores any subsequent changes to the input mesh.
Definition at line 343 of file mesh_triangle_holes.h.
libMesh::TriangulatorInterface::MeshedHole::MeshedHole | ( | const MeshBase & | mesh, |
std::set< std::size_t > | ids = {} |
||
) |
The constructor requires a mesh defining the hole, and optionally boundary+subdomain ids restricting the definition.
Definition at line 451 of file mesh_triangle_holes.C.
References _midpoints, _points, libMesh::TriangulatorInterface::Hole::area(), libMesh::as_range(), libMesh::BoundaryInfo::boundary_ids(), TIMPI::Communicator::broadcast(), libMesh::ParallelObject::comm(), libMesh::TypeVector< T >::cross(), distance(), libMesh::EDGE3, libMesh::EDGE4, libMesh::MeshBase::get_boundary_info(), libMesh::libmesh_ignore(), libMesh::make_range(), mesh, n_midpoints(), libMesh::MeshTools::Subdivision::next, libMesh::out, libMesh::ParallelObject::processor_id(), libMesh::Real, and libMesh::MacroFunctions::report_error().
|
inherited |
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 libMesh::TriangulatorInterface::Hole::areavec(), and libMesh::TypeVector< T >::norm().
Referenced by MeshedHole(), and MeshTriangulationTest::testTriangleHoleArea().
|
inherited |
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 libMesh::TriangulatorInterface::Hole::area().
|
protectedinherited |
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().
|
inherited |
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().
|
protectedinherited |
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.
|
overridevirtual |
Return an (arbitrary) point which lies inside the hole.
Implements libMesh::TriangulatorInterface::Hole.
Definition at line 834 of file mesh_triangle_holes.C.
|
overridevirtual |
Return the midpoint m
along the side n
defining the hole.
Reimplemented from libMesh::TriangulatorInterface::Hole.
Definition at line 824 of file mesh_triangle_holes.C.
|
overridevirtual |
The number of geometric midpoints along each of the sides defining the hole.
Reimplemented from libMesh::TriangulatorInterface::Hole.
Definition at line 810 of file mesh_triangle_holes.C.
References libMesh::libmesh_assert().
Referenced by MeshedHole().
|
overridevirtual |
The number of geometric points which define the hole.
Implements libMesh::TriangulatorInterface::Hole.
Definition at line 804 of file mesh_triangle_holes.C.
|
overridevirtual |
Return the nth point defining the hole.
Implements libMesh::TriangulatorInterface::Hole.
Definition at line 817 of file mesh_triangle_holes.C.
|
inlinevirtualinherited |
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 libMesh::TriangulatorInterface::Hole::_refine_bdy_allowed.
Referenced by libMesh::Poly2TriTriangulator::is_refine_boundary_allowed(), and MeshTriangulationTest::testPoly2TriHolesInteriorRefinedBase().
|
inlinevirtualinherited |
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 libMesh::TriangulatorInterface::Hole::n_points().
|
inlinevirtualinherited |
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 libMesh::TriangulatorInterface::Hole::_refine_bdy_allowed.
Referenced by MeshTriangulationTest::testPoly2TriHolesInteriorRefinedBase().
|
mutableprivate |
An (x,y) location inside the hole.
Cached because this is too expensive to compute for an arbitrary input mesh unless we need it for Triangle.
Definition at line 370 of file mesh_triangle_holes.h.
|
private |
The sorted vector of midpoints in between points along the edges of the hole.
For a hole with m midpoints per edge, between _points[n] and _points[n+1] lies _midpoints[n*m] through _midpoints[n*m+m-1]
Definition at line 383 of file mesh_triangle_holes.h.
Referenced by MeshedHole().
|
private |
The sorted vector of points which makes up the hole.
Definition at line 375 of file mesh_triangle_holes.h.
Referenced by MeshedHole().
|
protectedinherited |
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 libMesh::TriangulatorInterface::Hole::refine_boundary_allowed(), and libMesh::TriangulatorInterface::Hole::set_refine_boundary_allowed().