template<>
Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType> class

Class which generates the signed distance function of a domain.

Given a domain $ \Omega \subset D $ , with boundary $ \partial \Omega $ then the signed distance function $ \phi : D \rightarrow \mathbb{R} $ is defined by:

\[ \phi(x) = \begin{cases} d(x, \partial \Omega) & \text{if } x \in \Omega\\ 0 & \text{if } x \in \partial \Omega\\ -d(x, \partial \Omega) & \text{if } x \in \Omega^c \end{cases} \]

where

\[ d(x, \partial \Omega) := \inf_{y \in \partial \Omega} d(x, y) \]

Constructors, destructors, conversion operators

Distancer(const FESType& fes)
Creates a Distancer2D object with default values.

Public functions

auto setInteriorDomain(const Geometry::Attribute& ref) -> Distancer&
Specifies which material reference is to be understood as the interior domains.
auto setInteriorDomain(const FlatSet<Geometry::Attribute>& refs) -> Distancer&
Specifies which material references are to be understood as the interior domains.
auto enableScaling(bool b = true) -> Distancer&
Specifies whether to enable the scaling of the contour mesh.
auto setCPUs(unsigned int ncpu) -> Distancer&
Specifies how many CPUs to use when distancing in parallel.
auto getCPUs() const -> unsigned int
auto distance(const Geometry::Mesh<Context::Sequential>& box) -> RealGridFunction
Computes a signed distance function to a subdomain.
auto distance(const Geometry::Mesh<Context::Sequential>& box, const Geometry::Mesh<Context::Sequential>& contour) -> RealGridFunction
Computes a signed distance function from a given bounding box and contour.

Function documentation

template<>
Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::Distancer(const FESType& fes)

Creates a Distancer2D object with default values.

Parameters
fes in Finite element space for the distance function

template<>
Distancer& Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::setInteriorDomain(const Geometry::Attribute& ref)

Specifies which material reference is to be understood as the interior domains.

Parameters
ref in Interior material reference
Returns Reference to self (for method chaining)

By default, the interior elements are assumed to have the material reference 3.

template<>
Distancer& Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::setInteriorDomain(const FlatSet<Geometry::Attribute>& refs)

Specifies which material references are to be understood as the interior domains.

Parameters
refs in Interior material references
Returns Reference to self (for method chaining)

By default, the interior elements are assumed to have the material reference 3.

template<>
Distancer& Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::enableScaling(bool b = true)

Specifies whether to enable the scaling of the contour mesh.

Specifies whether the contour mesh should be scaled down so that the contour's bounding box is 95% of the enclosing bounding box.

By default, it is enabled.

template<>
Distancer& Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::setCPUs(unsigned int ncpu)

Specifies how many CPUs to use when distancing in parallel.

Parameters
ncpu in Number of CPUs to use

By default, it will utilize std::thread::hardware_concurrency().

template<>
unsigned int Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::getCPUs() const

Returns Number of CPUs which will be used when performing the distancing.

template<>
RealGridFunction Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::distance(const Geometry::Mesh<Context::Sequential>& box)

Computes a signed distance function to a subdomain.

Parameters
box in Bounding box $ D $ containing $ \Omega $ .
Returns Signed distance function representing $ \Omega $ .

This function generates the signed distance function $ d_\Omega $ to a domain $ \Omega $ which is contained in the given bounding box $ D $ , where $ \Omega $ is identified by its material reference. By default, the elements of $ \Omega $ are assumed to be specified by the number 3.

template<>
RealGridFunction Rodin::External::MMG::Distancer<typename FormLanguage::Traits<RealGridFunction>::FESType>::distance(const Geometry::Mesh<Context::Sequential>& box, const Geometry::Mesh<Context::Sequential>& contour)

Computes a signed distance function from a given bounding box and contour.

Parameters
box in Bounding box $ D $ containing the contour.
contour in Orientable contour $ \partial \Omega $ to distance.
Returns Signed distance function representing $ \Omega $ .

This function generates the signed distance function $ d_\Omega $ to a domain $ \Omega $ supplied by means of a mesh of its boundary $ \partial \Omega $ , at the vertices of a computational mesh of a bounding box $ D $ .