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

Signed distance function for a sphere in 3D space. More...

#include <distance.hpp>

Inheritance diagram for vulpes::geometry::dist3d::SphereDistance< FloatType >:
[legend]
Collaboration diagram for vulpes::geometry::dist3d::SphereDistance< FloatType >:
[legend]

Public Member Functions

 SphereDistance (const Point< FloatType, 3 > &center, FloatType radius)
 Constructor for the sphere distance function.
void operator() (const Point< FloatType, 3 > &point, FloatType *distance_buffer) const
 Compute the signed distance between a point and the sphere.
std::array< Point< FloatType, 3 >, 2 > bbox () const
 Get the bounding box of the sphere.
void operator() (const Point< FloatType, Dim > &point, FloatType *distance_buffer) const
 Evaluate the distance function for the given point.

Static Public Member Functions

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

Static Public Attributes

static constexpr bool is_leaf = true
 A flag indicating that this is a leaf node in a composite expression. Indeed we give an explicit formula to compute the distance.

Private Attributes

const Point< FloatType, 3 > m_center
 The center of the sphere.
const FloatType m_radius
 The radius of the sphere.

Detailed Description

template<typename FloatType>
class vulpes::geometry::dist3d::SphereDistance< FloatType >

Signed distance function for a sphere in 3D space.

This class computes the signed distance between a point and a sphere defined by its center and radius.

Template Parameters
FloatTypeThe type of floating-point value.

Constructor & Destructor Documentation

◆ SphereDistance()

template<typename FloatType>
vulpes::geometry::dist3d::SphereDistance< FloatType >::SphereDistance ( const Point< FloatType, 3 > & center,
FloatType radius )
inline

Constructor for the sphere distance function.

Parameters
centerThe center of the sphere.
radiusThe radius of the sphere.

Member Function Documentation

◆ bbox()

template<typename FloatType>
std::array< Point< FloatType, 3 >, 2 > vulpes::geometry::dist3d::SphereDistance< FloatType >::bbox ( ) const
inline

Get the bounding box of the sphere.

Returns
The bounding box as an array of two points.

◆ operator()() [1/2]

template<typename FloatType>
void vulpes::geometry::dist3d::SphereDistance< FloatType >::operator() ( const Point< FloatType, 3 > & point,
FloatType * distance_buffer ) const
inline

Compute the signed distance between a point and the sphere.

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

◆ operator()() [2/2]

void vulpes::geometry::DistanceExpression< FloatType, Dim, SphereDistance< FloatType > >::operator() ( const Point< FloatType, Dim > & point,
FloatType * distance_buffer ) const
inlineinherited

Evaluate the distance function for the given point.

This function computes the signed distance between a point and the shape defined by the Distance type. The result is stored in the provided distance_buffer.

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

◆ size()

template<typename FloatType>
constexpr size_t vulpes::geometry::dist3d::SphereDistance< FloatType >::size ( )
inlinestaticconstexpr

Get the size of the distance buffer for this distance function.

Returns
The size of the buffer (1 for the sphere + 1 for self).

Member Data Documentation

◆ is_leaf

template<typename FloatType>
bool vulpes::geometry::dist3d::SphereDistance< FloatType >::is_leaf = true
staticconstexpr

A flag indicating that this is a leaf node in a composite expression. Indeed we give an explicit formula to compute the distance.

◆ m_center

template<typename FloatType>
const Point<FloatType, 3> vulpes::geometry::dist3d::SphereDistance< FloatType >::m_center
private

The center of the sphere.

◆ m_radius

template<typename FloatType>
const FloatType vulpes::geometry::dist3d::SphereDistance< FloatType >::m_radius
private

The radius of the sphere.


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