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 formula identity.

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 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 PolytopeQuadratureFormula, 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
Namespace Geometry.

Classes

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