Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 > Class Template Reference

Represents the difference of two signed distance functions. More...

#include <distance.hpp>

Inheritance diagram for vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >:
[legend]
Collaboration diagram for vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >:
[legend]

Public Member Functions

 DifferenceDistance (D1 const &u, D2 const &v)
 Constructor for the difference distance function.
void operator() (const Point< FloatType, Dim > &point, FloatType *distance_buffer) const
 Compute the distance between a point and the difference of two shapes.
std::array< Point< FloatType, Dim >, 2 > bbox () const
 Get the bounding box of the difference of two shapes.

Static Public Member Functions

static constexpr size_t size ()
 Get the size of the distance buffer for this difference operation.

Static Public Attributes

static constexpr bool is_leaf = false
 A flag indicating that this is a non-leaf node in a composite expression.

Private Attributes

std::conditional_t< D1::is_leaf, const D1 &, const D1 > m_u
std::conditional_t< D2::is_leaf, const D2 &, const D2 > m_v

Detailed Description

template<typename FloatType, int32_t Dim, typename D1, typename D2>
class vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >

Represents the difference of two signed distance functions.

This class computes the signed distance between a point and the difference of two shapes, where the distance to the difference is defined as the maximum of the negative distance to the second shape and the distance to the first shape.

Template Parameters
FloatTypeThe type of floating-point value.
DimThe dimensionality of the space (e.g., 2D or 3D).
D1The first distance function.
D2The second distance function.

Constructor & Destructor Documentation

◆ DifferenceDistance()

template<typename FloatType, int32_t Dim, typename D1, typename D2>
vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::DifferenceDistance ( D1 const & u,
D2 const & v )
inline

Constructor for the difference distance function.

Parameters
uThe first distance function.
vThe second distance function.

Member Function Documentation

◆ bbox()

template<typename FloatType, int32_t Dim, typename D1, typename D2>
std::array< Point< FloatType, Dim >, 2 > vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::bbox ( ) const
inline

Get the bounding box of the difference of two shapes.

The bounding box of the difference is the bounding box of the first shape.

Returns
The bounding box as an array of two points.

◆ operator()()

template<typename FloatType, int32_t Dim, typename D1, typename D2>
void vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::operator() ( const Point< FloatType, Dim > & point,
FloatType * distance_buffer ) const
inline

Compute the distance between a point and the difference of two shapes.

The distance is defined as the maximum of the negative distance to the second shape and the distance to the first shape.

Parameters
pointThe point for which the distance is to be computed.
distance_bufferThe buffer where the computed distances will be stored.

◆ size()

template<typename FloatType, int32_t Dim, typename D1, typename D2>
constexpr size_t vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::size ( )
inlinestaticconstexpr

Get the size of the distance buffer for this difference operation.

The size is the sum of the sizes of the individual distance buffers for A and B.

Returns
The size of the distance buffer.

Member Data Documentation

◆ is_leaf

template<typename FloatType, int32_t Dim, typename D1, typename D2>
bool vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::is_leaf = false
staticconstexpr

A flag indicating that this is a non-leaf node in a composite expression.

◆ m_u

template<typename FloatType, int32_t Dim, typename D1, typename D2>
std::conditional_t<D1::is_leaf, const D1&, const D1> vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::m_u
private

The first distance function. If it is concrete we just need a reference, otherwise we copy the expression.

◆ m_v

template<typename FloatType, int32_t Dim, typename D1, typename D2>
std::conditional_t<D2::is_leaf, const D2&, const D2> vulpes::geometry::DifferenceDistance< FloatType, Dim, D1, D2 >::m_v
private

The first distance function. If it is concrete we just need a reference, otherwise we copy the expression.


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