chombo-discharge
Public Types | Public Member Functions | Protected Attributes | List of all members
SignedDistanceBVH< T, BV, K > Class Template Reference

Signed distance function for a DCEL mesh. More...

#include <CD_SignedDistanceBVH.H>

Inheritance diagram for SignedDistanceBVH< T, BV, K >:
Inheritance graph
[legend]
Collaboration diagram for SignedDistanceBVH< T, BV, K >:
Collaboration graph
[legend]

Public Types

using Vec3 = EBGeometry::Vec3T< T >
 Alias for always-3D vector with template.
 
using Face = EBGeometry::DCEL::FaceT< T >
 DCEL polygon face, which is the primitive type enclosed in the bounding volume hierarchy.
 
using Node = EBGeometry::BVH::LinearBVH< T, Face, BV, K >
 Alias for BVH node with precision T, enclosing DCEL face with a bounding volume type V.
 

Public Member Functions

 SignedDistanceBVH ()=delete
 Disallowed weak construction.
 
 SignedDistanceBVH (const std::shared_ptr< Node > &a_root, const bool a_flipInside, const Real a_zCoord=0.0)
 Full constructor. More...
 
 SignedDistanceBVH (const SignedDistanceBVH &a_object)
 Copy constructor.
 
virtual ~SignedDistanceBVH ()
 Destructor (does nothing)
 
Real value (const RealVect &a_point) const override
 Value function. More...
 
BaseIF * newImplicitFunction () const override
 Factory method. Sends pointers around.
 

Protected Attributes

Real m_zCoord
 For 2D only. This is the z-coordinate through which we slice the object.
 
std::shared_ptr< Nodem_root
 Pointer to root node in bounding volume hierarchy.
 
bool m_flipInside
 Hook for turning inside to outside.
 
long m_numCalled
 Number of times the implicit function was called. Use for performance tracking.
 
std::chrono::duration< double > m_timespan
 Total time spent computing the signed distance. Use for performance tracking.
 

Detailed Description

template<class T, class BV, int K>
class SignedDistanceBVH< T, BV, K >

Signed distance function for a DCEL mesh.

This class uses the EBGeometry submodule for creating signed distance functions from compelx geometries. The template parameters are the precision and the bounding volume type. To use this class, the user must first create the DCEL mesh and then create the BVH.

Constructor & Destructor Documentation

◆ SignedDistanceBVH()

template<class T , class BV , int K>
SignedDistanceBVH< T, BV, K >::SignedDistanceBVH ( const std::shared_ptr< Node > &  a_root,
const bool  a_flipInside,
const Real  a_zCoord = 0.0 
)

Full constructor.

Parameters
[in]a_rootPointer to root node in the bounding volume hierarchy.
[in]a_flipInsideIf true, turns inside to outside
[in]a_zCoordSpecial flag for 2D – indicates the z-position through which we slice the 3D object. Will no longer be signed distance.

Member Function Documentation

◆ value()

template<class T , class BV , int K>
Real SignedDistanceBVH< T, BV, K >::value ( const RealVect &  a_point) const
override

Value function.

Parameters
[in]a_pointSpatial point

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