https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PointContainmentClassifier.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "SurfaceSide.h"
13#include "MooseTypes.h"
14
15#include "libmesh/bounding_box.h"
16#include "libmesh/parallel.h"
17
18#include <memory>
19
20namespace libMesh
21{
22class MeshBase;
23}
27
37{
38public:
40 enum class Method
41 {
43 PCA_RAY,
51 };
52
55 {
58 int leaf_max_size = 10;
59 FileName obb_file_name = "";
60 FileName ray_file_name = "";
61 const libMesh::Parallel::Communicator * comm = nullptr; // debug output only
62 };
63
69 const SurfaceElementSet * set,
70 Method method,
71 Real tolerance);
72
81 const SurfaceElementSet * set,
82 Method method,
83 Real tolerance,
84 const RayOptions & options);
85
87
89 SurfaceGeometry::SurfaceSide sideness(const Point & point) const;
90
92 bool contains(const Point & point) const
93 {
95 }
96
99
101 std::size_t numElements() const { return _num_elements; }
102
106 Point rayDirection() const;
107
108private:
110
112 std::unique_ptr<AdaptiveRayContainmentCheck> _pca;
113 std::unique_ptr<TriangleManifold> _tri;
114
117 std::size_t _num_elements = 0;
118};
Ray-casting point-in-solid engine over a closed surface mesh represented as a collection of SurfaceEl...
Unified wrapper (facade) over the point-containment backends.
libMesh::BoundingBox _bounding_box
Cached method-independent AABB and element count for the accessors.
SurfaceGeometry::SurfaceSide sideness(const Point &point) const
Classify a query point relative to the closed surface.
Point rayDirection() const
The resolved ray direction of the ray-casting backend (user-selected direction for USER_SELECTED_RAY,...
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.
bool contains(const Point &point) const
Convenience API aligned with TriangleManifold: INSIDE and ON both map to true.
std::unique_ptr< TriangleManifold > _tri
FIXED_X_RAY.
std::unique_ptr< AdaptiveRayContainmentCheck > _pca
One of the two backends is constructed; the other stays null.
std::size_t numElements() const
Number of surface elements (triangles) backing the classifier.
const libMesh::BoundingBox & boundingBox() const
Method-independent global axis-aligned bounding box of the surface.
Method
Backend algorithm used for point-containment queries.
@ 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).
A group of surface elements wrapped for point-containment / distance queries.
Utility for querying point containment against a closed triangulated surface mesh.
SurfaceSide
The side of a closed surface where a query point is located.
Definition SurfaceSide.h:21
@ OUTSIDE
The point lies strictly in the exterior of the closed surface.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Ray-backend tuning + debug output; ignored by FIXED_X_RAY (TriangleManifold).
Point ray_direction
Direction used by USER_SELECTED_RAY; ignored by PCA_RAY.
const libMesh::Parallel::Communicator * comm