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
-
template<class F>class AnalyticMatrixFunction
- Matrix-valued
FunctionBaseadapter built from a single callable of signature(const Geometry::Point&) -> Math::SpatialMatrix<Real>. -
template<class F>class AnalyticVectorFunction
- Vector-valued
FunctionBaseadapter 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 induced by a displacement, evaluated with memoisation.
-
template<class TrialFunctionType, class TestFunctionType>class WNGIR
- Backend-independent WNGIR mesh-fitting solver.
- struct WNGIRAdmissibilityReport
- Sampled geometric admissibility diagnostics.
- class WNGIRLoss
- Fixed-scale Welsch loss and its consistent IRLS weight.
- struct WNGIRParameters
- Runtime parameters controlling WNGIR assembly and iteration.
- struct WNGIRReport
- Diagnostics produced by a WNGIR solve.
Functions
-
template<class F>AnalyticVectorFunction(F, std::size_t) -> AnalyticVectorFunction< F >
- Deduction guide for analytic vector functions.
-
template<class F>AnalyticMatrixFunction(F, std::size_t, std::size_t) -> 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
CellGeomCacheper cell, in mesh-iteration order. - auto wngirAdmissibilityQuadratureOrder(std::size_t feOrder) -> std::size_t
- Returns the sampled admissibility quadrature order for FE order.
-
template<class Displacement>auto evaluateWNGIRAdmissibilitySampled(Displacement& u, const Math::
Vector<Real>& uData, Real jMin, std::size_t quadratureOrder = 0) -> WNGIRAdmissibilityReport - Evaluates sampled Jacobian and relative-distortion admissibility.
- TEST(Rodin_Adaptation_WNGIRLoss, InfluenceMatchesFiniteDifference)
- Verifies that the analytic influence equals the loss derivative.
- TEST(Rodin_Adaptation_WNGIRLoss, SaturatesAtHalfScaleSquared)
- Verifies bounded Welsch energy.
Function documentation
template<class F>
Rodin:: Adaptation:: AnalyticVectorFunction(F,
std::size_t) -> AnalyticVectorFunction< F >
Deduction guide for analytic vector functions.
template<class F>
Rodin:: Adaptation:: AnalyticMatrixFunction(F,
std::size_t,
std::size_t) -> AnalyticMatrixFunction< F >
Deduction guide for analytic matrix functions.
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).