Adaptation namespace
Namespace Rodin::
Directory Rodin/tests/benchmarks Directory src/Rodin/Adaptation
Namespace Rodin::
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 , while preserving element quality.
Design
The module follows a strict separation of concerns:
- The level set owns the topology of the tracked domain ( inside, outside).
- Classification converts 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
- class AnalyticMatrixFunction
- Matrix-valued
FunctionBaseadapter built from a single callable of signature(const Geometry::Point&) -> Math::SpatialMatrix<Real>. - class AnalyticVectorFunction
- Vector-valued
FunctionBaseadapter 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.
- 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
CellGeomCacheper 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)
#include <Rodin/Adaptation/CellGeomCache.h>
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).