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

Signed distance function for a circle in 2D space. More...

#include <distance.hpp>

Inheritance diagram for vulpes::geometry::dist2d::CircleDistance< FloatType >:
[legend]
Collaboration diagram for vulpes::geometry::dist2d::CircleDistance< FloatType >:
[legend]

Public Member Functions

 CircleDistance (const Point< FloatType, 2 > &center, FloatType radius)
 Constructor for the circle distance function.
void operator() (const Point< FloatType, 2 > &point, FloatType *distance_buffer) const
 Compute the signed distance between a point and the circle.
std::array< Point< FloatType, 2 >, 2 > bbox () const
 Get the bounding box of the circle.
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, 2 > m_center
 The center of the circle.
const FloatType m_radius
 The radius of the circle.

Detailed Description

template<typename FloatType>
class vulpes::geometry::dist2d::CircleDistance< FloatType >

Signed distance function for a circle in 2D space.

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

Template Parameters
FloatTypeThe type of floating-point value.

Constructor & Destructor Documentation

◆ CircleDistance()

template<typename FloatType>
vulpes::geometry::dist2d::CircleDistance< FloatType >::CircleDistance ( const Point< FloatType, 2 > & center,
FloatType radius )
inline

Constructor for the circle distance function.

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

Member Function Documentation

◆ bbox()

template<typename FloatType>
std::array< Point< FloatType, 2 >, 2 > vulpes::geometry::dist2d::CircleDistance< FloatType >::bbox ( ) const
inline

Get the bounding box of the circle.

Returns
The bounding box as an array of two points.

◆ operator()() [1/2]

template<typename FloatType>
void vulpes::geometry::dist2d::CircleDistance< FloatType >::operator() ( const Point< FloatType, 2 > & point,
FloatType * distance_buffer ) const
inline

Compute the signed distance between a point and the circle.

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, CircleDistance< 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::dist2d::CircleDistance< FloatType >::size ( )
inlinestaticconstexpr

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

Returns
The size of the buffer (1 for the circle and 1 for self).

Member Data Documentation

◆ is_leaf

template<typename FloatType>
bool vulpes::geometry::dist2d::CircleDistance< 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, 2> vulpes::geometry::dist2d::CircleDistance< FloatType >::m_center
private

The center of the circle.

◆ m_radius

template<typename FloatType>
const FloatType vulpes::geometry::dist2d::CircleDistance< FloatType >::m_radius
private

The radius of the circle.


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