Rodin/Geometry/PolytopeQuadrature.h file

Cached quadrature data attached to mesh polytopes.

This file defines:

Purpose

Reference quadrature formulas belong to the Rodin::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 slot stores:

  • one hot entry for the fastest repeated-hit access path,
  • one small bounded ring buffer of owned cached quadratures.

Lookup order is:

  • hot entry,
  • bounded per-slot cache,
  • lazy construction on miss.

Hits in the bounded cache are promoted to the hot slot. Misses are inserted into the bounded cache in round-robin order and then promoted to the hot slot.

Key

The cache key is the address of the quadrature formula object:

\[ \texttt{const QF::QuadratureFormulaBase*} \]

This design assumes that callers obtain quadrature formulas from a canonical source such as Rodin::QF::PolytopeQuadratureFormula::get, so that the same logical formula has a stable object identity.

Namespaces

namespace Rodin
The Rodin library for finite element methods and shape optimization.
namespace Rodin::Geometry
Module for dealing with meshes, polytopes, and geometric operations.

Classes

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