Rodin::Adaptation namespace

Namespace Rodin::Tests::Benchmarks.

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

Namespace Rodin::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 WNGIR (Welsch natural-gradient interface registration): 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 (WNGIR) moves and curves the mesh. It never decides topology.

The WNGIR 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 bulk, observation, and admissibility metrics. Hard admissibility (element validity) is enforced by a nonlinear line search.

Key classes

  • WNGIRParameters — solve configuration (budgets, tolerances, weights)
  • WNGIRReport — per-solve diagnostics
  • WNGIRSolver — backend-independent solver driver

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>.
struct CellGeomCache
Per-cell geometry cache for the 2D triangular affine prototype.
template<class TrialFunctionType, class TestFunctionType>
class WNGIR
Backend-independent WNGIR mesh-fitting solver.

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

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.

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).