Rodin/Geometry/PolytopeQuadrature.h file

Cached quadrature data attached to mesh polytopes.

This file defines:

  • PolytopeQuadrature, which stores the mapped quadrature points associated with a specific quadrature formula on a specific polytope.
  • PolytopeQuadratureIndex, a mesh-owned, thread-safe cache indexed by polytope dimension, polytope index, and quadrature persistent formula.

Purpose

Reference quadrature formulas belong to the QF module and live on reference polytopes. In contrast, this file provides a geometry-side cache of their realization on concrete mesh polytopes.

For a polytope $ \tau $ and a reference quadrature formula $ \{ (\hat x_q, w_q) \}_{q=1}^{n_q} $ , the realized quadrature consists of the mapped geometric points:

\[ p_q = x_\tau(\hat x_q), \qquad q = 1, \dots, n_q, \]

where $ x_\tau $ is the polytope transformation.

Cache organization

The cache is organized as:

\[ (d, i) \mapsto \text{Slot}_{d,i} \]

where:

  • $ d $ is the polytope dimension,
  • $ i $ is the polytope index within that dimension.

Each dimension stores formula-version entries, each owning a dense array of polytope slots. A hot formula pointer and a bounded formula lookup accelerate access; the complete formula index retains every published version.

Lookup order is:

  • hot entry,
  • bounded formula lookup and complete formula index,
  • lazy construction on miss.

Hits are promoted to the hot formula pointer. New versions are appended to stable owned storage; previously borrowed quadratures are not replaced.

Key

The formula key is the address of a persistent immutable QuadratureFormula. Its samples and address remain valid until process termination. Earlier mapped samples remain alive until mesh geometry flush; changing integrator order selects a different published formula.

Namespaces

namespace Rodin
The Rodin library for finite element methods and shape optimization.
namespace Rodin::Geometry
Meshes, geometric transformations, and mapped evaluation.

Classes

class Rodin::Geometry::PolytopeQuadrature
Cached quadrature attached to one specific polytope.
class Rodin::Geometry::PolytopeQuadratureIndex
Thread-safe cache of polytope quadratures.