https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
PointContainmentClassifier Class Reference

Unified wrapper (facade) over the point-containment backends. More...

#include <PointContainmentClassifier.h>

Classes

struct  RayOptions
 Ray-backend tuning + debug output; ignored by FIXED_X_RAY (TriangleManifold). More...
 

Public Types

enum class  Method { PCA_RAY , USER_SELECTED_RAY , FIXED_X_RAY }
 Backend algorithm used for point-containment queries. More...
 

Public Member Functions

 PointContainmentClassifier (libMesh::MeshBase &mesh, const SurfaceElementSet *set, Method method, Real tolerance)
 Builds PCA_RAY with default ray options or FIXED_X_RAY without unused options.
 
 PointContainmentClassifier (libMesh::MeshBase &mesh, const SurfaceElementSet *set, Method method, Real tolerance, const RayOptions &options)
 Builds the selected backend with explicit ray options.
 
 ~PointContainmentClassifier ()
 
SurfaceGeometry::SurfaceSide sideness (const Point &point) const
 Classify a query point relative to the closed surface.
 
bool contains (const Point &point) const
 Convenience API aligned with TriangleManifold: INSIDE and ON both map to true.
 
const libMesh::BoundingBoxboundingBox () const
 Method-independent global axis-aligned bounding box of the surface.
 
std::size_t numElements () const
 Number of surface elements (triangles) backing the classifier.
 
Point rayDirection () const
 The resolved ray direction of the ray-casting backend (user-selected direction for USER_SELECTED_RAY, PCA-selected direction for PCA_RAY).
 

Private Attributes

const Method _method
 
std::unique_ptr< AdaptiveRayContainmentCheck_pca
 One of the two backends is constructed; the other stays null.
 
std::unique_ptr< TriangleManifold_tri
 FIXED_X_RAY.
 
libMesh::BoundingBox _bounding_box
 Cached method-independent AABB and element count for the accessors.
 
std::size_t _num_elements = 0
 

Detailed Description

Unified wrapper (facade) over the point-containment backends.

Selects and constructs exactly one backend and exposes a single result type (SurfaceSide). It adds no geometry logic of its own beyond backend selection and the uniform contains() mapping; the ray/solid-angle math lives entirely in the backends (AdaptiveRayContainmentCheck and TriangleManifold).

Definition at line 36 of file PointContainmentClassifier.h.

Member Enumeration Documentation

◆ Method

Backend algorithm used for point-containment queries.

Enumerator
PCA_RAY 

AdaptiveRayContainmentCheck with a PCA-selected ray (default SBM behavior).

USER_SELECTED_RAY 

AdaptiveRayContainmentCheck with a user-supplied ray_direction, used exactly as given (no PCA, no auto-selection).

Any finite non-zero direction is accepted, including oblique; for a 2D surface it must lie in the mesh plane.

FIXED_X_RAY 

TriangleManifold engine (fixed +x ray parity + solid-angle fallback).

TRI3 surfaces only.

Definition at line 40 of file PointContainmentClassifier.h.

41 {
43 PCA_RAY,
51 };
@ USER_SELECTED_RAY
AdaptiveRayContainmentCheck with a user-supplied ray_direction, used exactly as given (no PCA,...
@ FIXED_X_RAY
TriangleManifold engine (fixed +x ray parity + solid-angle fallback).
@ PCA_RAY
AdaptiveRayContainmentCheck with a PCA-selected ray (default SBM behavior).

Constructor & Destructor Documentation

◆ PointContainmentClassifier() [1/2]

PointContainmentClassifier::PointContainmentClassifier ( libMesh::MeshBase mesh,
const SurfaceElementSet set,
Method  method,
Real  tolerance 
)

Builds PCA_RAY with default ray options or FIXED_X_RAY without unused options.

USER_SELECTED_RAY requires the overload accepting explicit RayOptions.

◆ PointContainmentClassifier() [2/2]

PointContainmentClassifier::PointContainmentClassifier ( libMesh::MeshBase mesh,
const SurfaceElementSet set,
Method  method,
Real  tolerance,
const RayOptions options 
)

Builds the selected backend with explicit ray options.

mesh is builder-owned and must outlive this object (serialized for FIXED_X_RAY / TriangleManifold). set is required for PCA_RAY/USER_SELECTED_RAY (its elements/centroids are referenced by the backend and must also outlive this object) and ignored (may be null) for FIXED_X_RAY.

◆ ~PointContainmentClassifier()

PointContainmentClassifier::~PointContainmentClassifier ( )
default

Member Function Documentation

◆ boundingBox()

const libMesh::BoundingBox & PointContainmentClassifier::boundingBox ( ) const
inline

Method-independent global axis-aligned bounding box of the surface.

Definition at line 98 of file PointContainmentClassifier.h.

98{ return _bounding_box; }
libMesh::BoundingBox _bounding_box
Cached method-independent AABB and element count for the accessors.

◆ contains()

bool PointContainmentClassifier::contains ( const Point &  point) const
inline

Convenience API aligned with TriangleManifold: INSIDE and ON both map to true.

Definition at line 92 of file PointContainmentClassifier.h.

93 {
95 }
SurfaceGeometry::SurfaceSide sideness(const Point &point) const
Classify a query point relative to the closed surface.
@ OUTSIDE
The point lies strictly in the exterior of the closed surface.

◆ numElements()

std::size_t PointContainmentClassifier::numElements ( ) const
inline

Number of surface elements (triangles) backing the classifier.

Definition at line 101 of file PointContainmentClassifier.h.

◆ rayDirection()

Point PointContainmentClassifier::rayDirection ( ) const

The resolved ray direction of the ray-casting backend (user-selected direction for USER_SELECTED_RAY, PCA-selected direction for PCA_RAY).

Errors for FIXED_X_RAY, which has no such backend.

Definition at line 96 of file PointContainmentClassifier.C.

97{
98 if (!_pca)
99 mooseError("PointContainmentClassifier::rayDirection() is only defined for the pca_ray and "
100 "user_selected_ray methods; the fixed_x_ray method has no ray-casting backend.");
101 return _pca->rayDirection();
102}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
std::unique_ptr< AdaptiveRayContainmentCheck > _pca
One of the two backends is constructed; the other stays null.

◆ sideness()

SurfaceGeometry::SurfaceSide PointContainmentClassifier::sideness ( const Point &  point) const

Classify a query point relative to the closed surface.

Definition at line 86 of file PointContainmentClassifier.C.

87{
88 if (_tri)
89 return _tri->sideness(point);
90
91 mooseAssert(_pca, "PointContainmentClassifier: no backend was constructed.");
92 return _pca->sideness(point);
93}
std::unique_ptr< TriangleManifold > _tri
FIXED_X_RAY.

Referenced by contains().

Member Data Documentation

◆ _bounding_box

libMesh::BoundingBox PointContainmentClassifier::_bounding_box
private

Cached method-independent AABB and element count for the accessors.

Definition at line 116 of file PointContainmentClassifier.h.

Referenced by boundingBox().

◆ _method

const Method PointContainmentClassifier::_method
private

Definition at line 109 of file PointContainmentClassifier.h.

◆ _num_elements

std::size_t PointContainmentClassifier::_num_elements = 0
private

Definition at line 117 of file PointContainmentClassifier.h.

Referenced by numElements().

◆ _pca

std::unique_ptr<AdaptiveRayContainmentCheck> PointContainmentClassifier::_pca
private

One of the two backends is constructed; the other stays null.

PCA_RAY or USER_SELECTED_RAY

Definition at line 112 of file PointContainmentClassifier.h.

Referenced by rayDirection(), and sideness().

◆ _tri

std::unique_ptr<TriangleManifold> PointContainmentClassifier::_tri
private

FIXED_X_RAY.

Definition at line 113 of file PointContainmentClassifier.h.

Referenced by sideness().


The documentation for this class was generated from the following files: