Base class for a single surface (boundary) element of a closed surface mesh. More...
#include <SurfaceElement.h>
Public Member Functions | |
| SurfaceElement (const Elem *elem, const Point &normal) | |
| Constructor takes a pointer to a surface element and its precomputed unit normal. | |
| virtual | ~SurfaceElement ()=default |
| Virtual destructor to ensure proper cleanup in derived classes. | |
| const Elem & | elem () const |
| Getter for the underlying element. | |
| const Point & | normal () const |
| Getter for the normal vector. | |
| virtual bool | intersect (const LineSegment &line_segment) const =0 |
| Check if the given line segment intersects this surface element. | |
| unsigned int | expectedEmbeddingMeshDim () const |
| Getter of expected embedding solving mesh dimension Because the surface element is a face of the embedding mesh, its dimension is one less than the dimension of the embedding mesh. | |
| virtual Ball | computeBoundingBall () const =0 |
| Compute a bounding ball for this surface element. | |
| Real | getProjectedBoundingBoxDiagonal (const Point &normal_dir) const |
| Compute the length of the element bounding-box diagonal projected onto a plane orthogonal to a given direction. | |
Private Attributes | |
| const Elem * | _elem |
| Pointer to the libMesh element representing this surface face. | |
| const Point | _normal |
| Unit normal vector of the surface element. | |
Base class for a single surface (boundary) element of a closed surface mesh.
Wraps a libMesh boundary element (an EDGE2 in 2D or a TRI3 in 3D) together with its precomputed unit normal and provides the geometric queries needed by point-containment and distance algorithms. intersect() and computeBoundingBall() are pure virtual here so that callers can issue them through a SurfaceElement reference without knowing the concrete geometry; concrete derived classes (SurfaceEdge2, SurfaceTri3) also derive from a GeometryBase primitive (LineSegment, Triangle) and forward to it.
Definition at line 26 of file SurfaceElement.h.
| SurfaceElement::SurfaceElement | ( | const Elem * | elem, |
| const Point & | normal | ||
| ) |
Constructor takes a pointer to a surface element and its precomputed unit normal.
The normal is computed eagerly by derived classes (which know their geometry) so the base can store it const and shared concurrent reads are safe.
Definition at line 14 of file SurfaceElement.C.
|
virtualdefault |
Virtual destructor to ensure proper cleanup in derived classes.
|
pure virtual |
Compute a bounding ball for this surface element.
Implemented by derived classes by forwarding to their geometry primitive.
Implemented in SurfaceEdge2, and SurfaceTri3.
|
inline |
Getter for the underlying element.
Definition at line 40 of file SurfaceElement.h.
Referenced by SurfaceEdge2::SurfaceEdge2(), SurfaceElement(), and SurfaceTri3::SurfaceTri3().
|
inline |
Getter of expected embedding solving mesh dimension Because the surface element is a face of the embedding mesh, its dimension is one less than the dimension of the embedding mesh.
Definition at line 54 of file SurfaceElement.h.
| Real SurfaceElement::getProjectedBoundingBoxDiagonal | ( | const Point & | normal_dir | ) | const |
Compute the length of the element bounding-box diagonal projected onto a plane orthogonal to a given direction.
The projection plane is defined only by its normal direction; the specific location (offset) of the plane is irrelevant for this operation. Equivalently, this function removes the component of the bounding-box diagonal along the given normal direction and returns the norm of the remaining tangential component.
| normal_dir | A direction vector defining the plane normal. |
Definition at line 24 of file SurfaceElement.C.
|
pure virtual |
Check if the given line segment intersects this surface element.
Implemented by derived classes by forwarding to their geometry primitive.
Implemented in SurfaceEdge2, SurfaceEdge2, SurfaceTri3, and SurfaceTri3.
Referenced by AdaptiveRayContainmentCheck::rayIntersectGeometry().
|
inline |
|
private |
Pointer to the libMesh element representing this surface face.
Derived classes access it through elem() rather than this field directly.
Definition at line 80 of file SurfaceElement.h.
Referenced by elem(), expectedEmbeddingMeshDim(), and getProjectedBoundingBoxDiagonal().
|
private |
Unit normal vector of the surface element.
Definition at line 82 of file SurfaceElement.h.
Referenced by normal(), and SurfaceElement().