Rodin::Adaptation namespace

Namespace Benchmarks.

Directory Rodin/tests/benchmarks Directory src/Rodin/Adaptation

Namespace Adaptation

Module for moving-interface mesh adaptation.

The Adaptation module provides tools for fitting and adapting meshes to moving interfaces described by level set functions. Its centerpiece is SWIFT (Strain-distributed Welsch Implicit-interface Fitting Technique): a variational method that displaces mesh vertices so that a discrete interface tracks the zero set of a level set function $ \phi $ , while preserving element quality.

Design

The module follows a strict separation of concerns:

  • The level set $ \phi $ owns the topology of the tracked domain ( $ \phi < 0 $ inside, $ \phi > 0 $ outside).
  • Classification converts $ \phi $ into discrete cell attributes (see Geometry utilities such as the min s-t cut classifier).
  • Geometry fitting (SWIFT) moves and curves the mesh. It never decides topology.

The SWIFT step solves a metric-preconditioned (natural-gradient) problem built entirely in the variational form language: a surface force (the Welsch first variation, assembled on interface facets) balanced against fitting and centered distribution metrics. Affine quadratic hinges recover quality in the direction problem. Hard admissibility (element validity) is enforced by a nonlinear line search.

Key classes

  • Parameters — budgets, tolerances and weights
  • Report — per-solve diagnostics
  • Problem — local fitting without mesh mutation
  • Adapt — owned P1 setup and in-place displacement

Namespaces

namespace SWIFT
Robust interface fitting with a fitting–distribution metric.

Classes

template<class F>
class AnalyticMatrixFunction
Matrix-valued FunctionBase adapter built from a single callable of signature (const Geometry::Point&) -> Math::SpatialMatrix<Real>.
template<class F>
class AnalyticVectorFunction
Vector-valued FunctionBase adapter built from a single callable of signature (const Geometry::Point&) -> Math::SpatialVector<Real>.
class CellDeformation
Lazily evaluated deformation state of a mesh cell.
struct CellGeomCache
Per-cell geometry cache for the 2D triangular affine prototype.
template<class Displacement, class LocatorType>
class DeformationMap
The deformation $\Phi(x)=x+u(x)$ induced by a displacement, evaluated with memoisation.

Functions

template<class F>
AnalyticVectorFunction(F f, std::size_t dimension) -> AnalyticVectorFunction< F >
Deduction guide for analytic vector functions.
template<class F>
AnalyticMatrixFunction(F f, std::size_t rows, std::size_t cols) -> AnalyticMatrixFunction< F >
Deduction guide for analytic matrix functions.
auto precomputeCellGeometry(const Geometry::Mesh<Rodin::Context::Local>& mesh) -> std::pair<std::vector<CellGeomCache>, std::unordered_map<Index, size_t>>
Build a CellGeomCache per cell, in mesh-iteration order.

Function documentation

template<class F>
Rodin::Adaptation::AnalyticVectorFunction(F f, std::size_t dimension) -> AnalyticVectorFunction< F >

Deduction guide for analytic vector functions.

Parameters
f Function operand.
dimension Spatial dimension.

template<class F>
Rodin::Adaptation::AnalyticMatrixFunction(F f, std::size_t rows, std::size_t cols) -> AnalyticMatrixFunction< F >

Deduction guide for analytic matrix functions.

Parameters
f Function operand.
rows Number of rows.
cols Number of columns.

std::pair<std::vector<CellGeomCache>, std::unordered_map<Index, size_t>> Rodin::Adaptation::precomputeCellGeometry(const Geometry::Mesh<Rodin::Context::Local>& mesh)

Build a CellGeomCache per cell, in mesh-iteration order.

Parameters
mesh Mesh on which the object is defined.
Returns Cell geometry caches and the map from cell indices to cache positions.

The returned vector is indexed by LOCAL iteration order — not by mesh cell index. The cache entry .index records the parent mesh's cell index; the second returned map gives the parent-index -> local-index translation for use by the rest of the pipeline.

Throws if A_K(xhat_q) is singular at any quadrature point, or if the branch sign sigma_K(xhat_q) is inconsistent across quadrature points (which would mean a curved or inverted element; this 2D affine prototype rejects them).