https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
SurfaceGeometry Namespace Reference

Classes

struct  RayDirectionOptions
 Ray-direction intent for AdaptiveRayContainmentCheck: an explicit mode plus the direction to use when mode == USER_SPECIFIED (ignored for AUTO_PCA). More...
 

Enumerations

enum class  RayDirectionMode { AUTO_PCA , USER_SPECIFIED }
 How the ray-casting engine obtains its shooting direction. More...
 
enum class  SurfaceSide { INSIDE , OUTSIDE , ON }
 The side of a closed surface where a query point is located. More...
 

Functions

SurfaceSide signedValueSideness (Real phi, Real tolerance, bool inside_is_negative)
 Classify a signed level-set value into a SurfaceSide.
 
SurfaceSide unionSideness (SurfaceSide a, SurfaceSide b)
 Combine two classifications for a union: INSIDE if either is INSIDE, otherwise ON if either is ON, otherwise OUTSIDE (the INSIDE > ON > OUTSIDE precedence).
 
std::ostream & operator<< (std::ostream &os, const SurfaceSide &side)
 Stream a human-readable name for a SurfaceSide value.
 

Enumeration Type Documentation

◆ RayDirectionMode

How the ray-casting engine obtains its shooting direction.

Enumerator
AUTO_PCA 

The engine auto-selects a robust direction via PCA (may use a fallback).

USER_SPECIFIED 

The engine uses the caller-supplied direction exactly, with no auto-selection.

Definition at line 18 of file RayDirectionOptions.h.

19{
24};
@ USER_SPECIFIED
The engine uses the caller-supplied direction exactly, with no auto-selection.
@ AUTO_PCA
The engine auto-selects a robust direction via PCA (may use a fallback).

◆ SurfaceSide

enum class SurfaceGeometry::SurfaceSide
strong

The side of a closed surface where a query point is located.

Enumerator
INSIDE 

The point lies strictly in the interior of the closed surface.

OUTSIDE 

The point lies strictly in the exterior of the closed surface.

ON 

The point lies on the surface itself, within tolerance.

Definition at line 20 of file SurfaceSide.h.

21{
23 INSIDE,
25 OUTSIDE,
27 ON
28};
@ INSIDE
The point lies strictly in the interior of the closed surface.
@ ON
The point lies on the surface itself, within tolerance.
@ OUTSIDE
The point lies strictly in the exterior of the closed surface.

Function Documentation

◆ operator<<()

std::ostream & SurfaceGeometry::operator<< ( std::ostream &  os,
const SurfaceSide side 
)
inline

Stream a human-readable name for a SurfaceSide value.

Defined for debugging output and so test frameworks (e.g. gtest EXPECT_EQ) report the enumerator name rather than its underlying integer value on failure.

Definition at line 53 of file SurfaceSide.h.

55{
56 switch (side)
57 {
58 case SurfaceSide::INSIDE:
59 return os << "INSIDE";
60 case SurfaceSide::OUTSIDE:
61 return os << "OUTSIDE";
62 case SurfaceSide::ON:
63 return os << "ON";
64 }
65 return os;
66}

◆ signedValueSideness()

SurfaceSide SurfaceGeometry::signedValueSideness ( Real  phi,
Real  tolerance,
bool  inside_is_negative 
)

Classify a signed level-set value into a SurfaceSide.

With the signed-distance convention (inside_is_negative == true) a value below -tolerance is INSIDE, a value within +/-tolerance of zero is ON, and a value above +tolerance is OUTSIDE. Setting inside_is_negative == false flips the sign for a level set that is positive in the interior.

Parameters
phiThe signed function value at the query point.
toleranceHalf-width, in value space, of the on-surface band around zero.
inside_is_negativeWhether negative values denote the interior.

Definition at line 18 of file SurfaceSide.C.

19{
20 // Normalize so that negative always denotes the interior.
21 if (!inside_is_negative)
22 phi = -phi;
23
24 if (phi < -tolerance)
25 return SurfaceSide::INSIDE;
26 if (std::abs(phi) <= tolerance)
27 return SurfaceSide::ON;
28 return SurfaceSide::OUTSIDE;
29}

Referenced by PointInSignedFunctionCheckUO::sideness().

◆ unionSideness()

SurfaceSide SurfaceGeometry::unionSideness ( SurfaceSide  a,
SurfaceSide  b 
)

Combine two classifications for a union: INSIDE if either is INSIDE, otherwise ON if either is ON, otherwise OUTSIDE (the INSIDE > ON > OUTSIDE precedence).

Definition at line 36 of file SurfaceSide.C.

37{
38 // Precedence: INSIDE beats ON beats OUTSIDE.
39 if (a == SurfaceSide::INSIDE || b == SurfaceSide::INSIDE)
40 return SurfaceSide::INSIDE;
41 if (a == SurfaceSide::ON || b == SurfaceSide::ON)
42 return SurfaceSide::ON;
43 return SurfaceSide::OUTSIDE;
44}

Referenced by PointInUnionCheckUO::sideness().