Rodin::Distance::SignedPoisson class

Poisson approximation to the signed distance function.

This class computes an approximation to the signed distance function by solving a Poisson equation with different forcing terms in interior and exterior regions:

\[ -\Delta u = f \quad \text{in } \Omega \]
\[ u = 0 \quad \text{on } \Gamma \]

where $ f $ changes sign based on the region, and $ \Gamma $ is the interface.

Variants

This class provides two operator() overloads:

  1. Unsigned distance (full domain)
  2. Signed distance (with specified interior/interface regions)

Usage Example

P1 fes(mesh);
SignedPoisson signedDist;
// Signed distance with regions:
auto u = signedDist(interfaceAttr, interiorAttr, fes);

Public functions

template<class FES>
auto operator()(const FES& fes) const -> auto
Computes the unsigned Poisson-based distance approximation.
template<class FES>
auto operator()(Geometry::Attribute interface, Geometry::Attribute region, const FES& fes) const -> auto
Computes the signed distance for specified interface and region.
template<class FES>
auto operator()(const FlatSet<Geometry::Attribute>& interface, const FlatSet<Geometry::Attribute>& region, const FES& fes) const -> auto
Computes the signed distance for specified interface and region sets.

Function documentation

template<class FES>
auto Rodin::Distance::SignedPoisson::operator()(const FES& fes) const

Computes the unsigned Poisson-based distance approximation.

Template parameters
FES Finite element space type
Parameters
fes in Finite element space on which to solve
Returns Grid function containing the distance approximation

Solves the Poisson equation over the entire domain with uniform forcing term.

template<class FES>
auto Rodin::Distance::SignedPoisson::operator()(Geometry::Attribute interface, Geometry::Attribute region, const FES& fes) const

Computes the signed distance for specified interface and region.

Template parameters
FES Finite element space type
Parameters
interface in Attribute marking the interface (zero level set)
region in Attribute marking the interior region
fes in Finite element space on which to solve
Returns Grid function containing the signed distance approximation

Convenience overload that accepts single attributes for interface and region.

template<class FES>
auto Rodin::Distance::SignedPoisson::operator()(const FlatSet<Geometry::Attribute>& interface, const FlatSet<Geometry::Attribute>& region, const FES& fes) const

Computes the signed distance for specified interface and region sets.

Template parameters
FES Finite element space type
Parameters
interface in Set of attributes marking the interface
region in Set of attributes marking the interior region
fes in Finite element space on which to solve
Returns Grid function containing the signed distance approximation

Solves the Poisson equation with different forcing terms in the interior and exterior regions, creating a signed distance approximation.