Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple > Class Template Reference

Implements a quadrature-free finite element integrator. More...

#include <integrator_qfree.hpp>

Inheritance diagram for vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >:
[legend]
Collaboration diagram for vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >:
[legend]

Public Types

using WeakFormIntegratorBaseType
using FeType
using PolyType = FeType::FeSpaceType::PolynomialFast
 The polynomial type used for standard basis functions.
using MonoType = PolyType::MonomialType
 The monomial type for standard polynomials.
using PolyTypeLifted
 The polynomial type "lifted" to a higher dimension. This is used for face integrals involving neighbor cell data, where the polynomial also depends on the coefficients of the affine map between reference cells. The extra 2*dim dimensions account for the diagonal Jacobian and translation vector.
using MonoTypeLifted = PolyTypeLifted::MonomialType
 The monomial type for lifted polynomials.
using index_t = typename MeshType::index_t
 The index type used by the mesh.
using GatheredPolynomial = std::vector<GatheredMonomial<dim>>
 An uncompressed gathered polynomial for a single entry.
using GatheredPolynomialCoef = std::vector<std::pair<double, uint16_t>>
 Coefficients for a compressed gathered polynomial.
using FlatPolyTypeLifted = datastructure::CrsMap<MonoTypeLifted, index_t>
 A compressed representation of a list of lifted polynomials.
using FlatPolyType = datastructure::CrsMap<CompressedMonomial, index_t>
 A compressed representation of a list of standard polynomials.
using CompressedListGatheredPoly
 A compressed representation of a list of gathered polynomials.
using FeExpressionTupleBilinear
using FeExpressionTupleLinear
using FeExpressionTupleFaceBilinear
using FeExpressionTupleFaceLinear
using CellType
using MappingType

Public Member Functions

 WeakFormIntegratorQFree (const MeshType &mesh, CellManager< MeshType, FeType > &cell_manager, const FeExpressionTuple &fe_expression, const FeExpressionFaceTuple &fe_expression_face=FeExpressionFaceTuple{})
 Constructs the quadrature-free integrator.
void integrate (index_t cell_id)
 Performs the full integration process for a given cell.
void computeUpdateFlags ()
 Compute the update flags indicating the values to be updated for each cell in the FEValues.
void computeMaxOrder ()
 Compute the maximum polynomial order among all finite element expressions.
const CellType & getCell (index_t cell_id, bool update_mapping=false)
 Get the cell object for a given cell id.
void preallocate (index_t cell_id)
 Resize the internal storage of local integrals (matrices) to fit the number of finite element expressions taking into account which expressions are computed on the faces and which in the volume, and which expressions are bilinear or linear.
void findCellNeigh ()
 Find the neighboring cell across the current (local) face (m_face_id) and set up the ids for the neighbor FEValues if needed.
void applyBasisScaling ()
 Apply the basis scaling to the integrals and right-hand side contributions if needed.
Eigen::Map< Eigen::MatrixXd > getCurrFaceIntegral (const auto &expr, Eigen::Index expr_id)
 Get a map to the data corresponding to the face integral for the current cell and face being integrated. The data is a raw buffer that points to the correct location in the internal storage.
Eigen::Map< Eigen::VectorXd > getCurrFaceRhs (const auto &expr, Eigen::Index expr_id)
 Get a map to the rhs vector for the current face and expression.
void buildWeakFormPointerTable ()
 Build a lookup table that maps finite element expression pointers to their corresponding data storage locations for integrals and right-hand side contributions.
const auto & getIntegrals () const
 Get a const reference to the (bilinear) volume integrals buffer.
const auto & getRhsIntegrals () const
 Get a const reference to the (linear) volume right-hand side buffer.
const auto & getFaceIntegrals () const
 Get a const reference to the (bilinear) face integrals buffer where both basis functions belong to this cell.
const auto & getRhsFaceIntegrals () const
 Get a const reference to the (linear) face right-hand side buffer.
const auto & getFaceIntegralsNeigh () const
 Get a const reference to the (bilinear) face integrals buffer where one basis function belongs to the neighboring cell.
const auto & getRhsFaceIntegralsNeigh () const
 Get a const reference to the (linear) face rhs buffer where the test function belongs to the neighboring cell.
auto getIntegral (auto wf_ptr, index_t loc_neigh_id=-1) const
 Get the integral (matrix or vector) for the current cell.

Static Public Attributes

static constexpr std::size_t dim = MeshType::self_dim
 The spatial dimension of the mesh.
static constexpr uint32_t s_n_expr
 The number of volume expressions.
static constexpr uint32_t s_n_face_expr
 The number of face expressions.
static constexpr uint32_t s_n_expr_bilinear
 The number of bilinear volume expressions.
static constexpr uint32_t s_n_expr_linear
 The number of linear (RHS) volume expressions.
static constexpr uint32_t s_n_face_expr_bilinear
 The number of bilinear face expressions.
static constexpr uint32_t s_n_face_expr_linear
 The number of linear (RHS) face expressions.
static constexpr index_t s_n_blocks
 The number of blocks for vector/tensor-valued problems.
static constexpr uint32_t nblocks
 Number of vector blocks in the system, e.g. for a scalar problem is 1, for an elasticity problem is dim (2 or 3).

Protected Types

using TypeIJ = std::array<Eigen::Index, 3>
 Helper type for storing indices (i * s_n_blocks + bi, j * s_n_blocks + bj, k) for the bilinear lookup table.
using RepeatingTableIJ = datastructure::CrsMap<TypeIJ, index_t>
 A compressed map used as a lookup table for repeated bilinear polynomials.
using TypeI = std::array<Eigen::Index, 2>
 Helper type for storing indices (i * s_n_blocks + bi, k) for the linear (RHS) lookup table – no trial index.
using RepeatingTableI = datastructure::CrsMap<TypeI, index_t>
 A compressed map used as a lookup table for repeated linear polynomials.
using CellNeighInfo

Protected Member Functions

FlatPolyType compress (const datastructure::CrsMapUncompressed< MonoType > &uncompressed_table)
 Compresses a table of polynomials.
void buildLookupTables ()
 Builds lookup tables to identify and reuse identical polynomials.
std::array< std::vector< GatheredPolynomial >, s_n_face_expr_bilinear > gatherUncompressedLiftedMonomials ()
 Gathers terms for lifted monomials from face expressions (uncompressed stage).
std::vector< std::array< uint8_t, dim *2 > > buildUniqueEvaTableLiftedMonomials (const std::array< std::vector< GatheredPolynomial >, s_n_face_expr_bilinear > &gathered_monos_table)
 Scans all gathered (lifted) monomials to build a table of unique evaluation exponents.
void compressGatheredLiftedPolynomials (const std::array< std::vector< GatheredPolynomial >, s_n_face_expr_bilinear > &gathered_monos_table)
 Compresses the gathered monomials into their final integer-ID-based format.
void gatherLiftedMonomials ()
 Orchestrates the gathering and compression of lifted monomials.
Eigen::Matrix< double, dim, 2 > computeRefToNeighRefMap () const
 Computes the affine mapping from the current cell's reference space to a neighbor's reference space.
void integrateVolumeCell (const double *aints_data)
 Integrates all volume expressions over the current cell.
double updateFaceNormalAndGetNanson ()
 Updates the face normal vector in m_fe_values and computes the Nanson's formula factor.
void precomputeMonomialCoefsForFace ()
 Precomputes the values of the evaluation parts of the gathered monomials for the current face.
void integrateFaceCell (const double *eints_data, double nanson)
 Integrates all face expressions over the current face of the cell.

Protected Attributes

std::array< FlatPolyType, s_n_expr_bilinear > m_poly_table_flat
 Polynomial tables for bilinear volume expressions.
std::array< FlatPolyType, s_n_expr_bilinear > m_poly_table_flat_nodupes
 Unique polynomials for bilinear volume expressions, after deduplication.
std::array< RepeatingTableIJ, s_n_expr_bilinear > m_poly_table_flat_ijs_table
 Lookup table mapping unique bilinear volume polynomials to (row, col, k) entries.
std::array< FlatPolyType, s_n_expr_linear > m_poly_table_flat_linear
 Polynomial tables for linear volume expressions.
std::array< FlatPolyType, s_n_expr_linear > m_poly_table_flat_linear_nodupes
 Unique polynomials for linear volume expressions, after deduplication.
std::array< RepeatingTableI, s_n_expr_linear > m_poly_table_flat_linear_ijs_table
 Lookup table mapping unique linear volume polynomials to (row, k) entries.
std::array< FlatPolyType, s_n_face_expr_bilinear > m_poly_table_face_flat
 Polynomial tables for bilinear face expressions (non-lifted).
std::array< FlatPolyType, s_n_face_expr_bilinear > m_poly_table_face_flat_nodupes
 Unique polynomials for bilinear face expressions.
std::array< RepeatingTableIJ, s_n_face_expr_bilinear > m_poly_table_face_flat_ijs_table
 Lookup table for bilinear face polynomials.
std::array< FlatPolyType, s_n_face_expr_linear > m_poly_table_face_flat_linear
 Polynomial tables for linear face expressions (non-lifted).
std::array< FlatPolyType, s_n_face_expr_linear > m_poly_table_face_flat_linear_nodupes
 Unique polynomials for linear face expressions.
std::array< RepeatingTableI, s_n_face_expr_linear > m_poly_table_face_flat_linear_ijs_table
 Lookup table for linear face polynomials.
std::array< FlatPolyTypeLifted, s_n_face_expr_bilinear > m_poly_table_face_lifted_flat
 Uncompressed polynomial tables for lifted bilinear face expressions.
std::array< CompressedListGatheredPoly, s_n_face_expr_bilinear > m_poly_table_face_lifted_gathered
 Compressed and gathered version of m_poly_table_face_lifted_flat.
std::array< CompressedListGatheredPoly, s_n_face_expr_bilinear > m_poly_table_face_lifted_gathered_nodupes
 Unique polynomials for lifted bilinear face expressions, after gathering and deduplication.
std::array< RepeatingTableIJ, s_n_face_expr_bilinear > m_poly_table_face_lifted_gathered_ijs_table
 Lookup table for lifted bilinear face polynomials.
std::vector< std::array< uint8_t, dim *2 > > m_eva_idx_table
 A table mapping a unique integer ID to a monomial exponent array. Used to evaluate the mapping-dependent parts of gathered monomials.
datastructure::CrsMap< std::pair< double, uint16_t >, index_t > m_gathered_monos
 Stores the unique "gathered" parts of monomials. Each row corresponds to a gather_id and contains a list of (coefficient, eval_id) pairs, representing a sum like \(\sum_i c_i M_i\), where \(M_i\) is an evaluation monomial and eval_id points to a row of m_eva_idx_table.
std::vector< double > m_gather_coef
 Buffer storing the computed values of the gathered parts (from m_gathered_monos) for the current face.
std::vector< double > m_eval_table_ext
 Buffer storing the computed values of the unique evaluation monomials (from m_eva_idx_table) for the current face.
std::array< Eigen::Index, s_n_expr_bilinear > m_npoly_comps_volume
 Stores the number of polynomial components for each bilinear volume expression.
std::array< Eigen::Index, s_n_expr_linear > m_npoly_comps_volume_linear
 Stores the number of polynomial components for each linear volume expression.
std::array< Eigen::Index, s_n_face_expr_bilinear > m_npoly_comps_face
 Stores the number of polynomial components for each bilinear face expression.
std::array< Eigen::Index, s_n_face_expr_linear > m_npoly_comps_face_linear
 Stores the number of polynomial components for each linear face expression.
const MeshType & m_mesh
 A reference to the underlying mesh.
CellManager< MeshType, FeType > & m_cell_manager
 The cell manager.
FeExpressionTuple m_fe_expression
 A tuple of pointers to the finite element expressions to compute the volume integrals.
std::tuple<> m_fe_expression_face
 A tuple of pointers to the finite element expressions to compute the face integrals.
const FeType & m_fe_space
 A reference to the finite element space.
std::size_t m_order
 The maximum polynomial order of the finite element expressions integrated in the volume.
std::size_t m_order_face
 The maximum polynomial order of the finite element expressions integrated on the faces.
std::unordered_map< void *, double * > m_wf_ptr_table
 A map from finite element expression pointers to their corresponding data storage locations.
std::unordered_map< void *, Eigen::MatrixXd > m_neigh_sum_scratch
 Scratch buffers reused by getIntegral to accumulate the sum-over-neighbors case without a fresh heap allocation per call, keyed per weak-form pointer so two different neigh-summed forms queried on the same integrator cannot alias each other's result.
fe::UpdateFlagsType m_update_flags
 Update flags indicating which values to update in FEValues for the volume integrals.
fe::UpdateFlagsType m_update_flags_face
 Update flags indicating which values to update in FEValues for the face integrals.
Eigen::Tensor< double, 3 > m_integrals
 Tensor to store the bilinear volume integrals.
Eigen::MatrixXd m_rhs
 Matrix to store the linear volume right-hand side contributions.
Eigen::Tensor< double, 3 > m_face_integrals
 Tensor to store the bilinear face integrals where both basis functions belong to this cell.
Eigen::MatrixXd m_face_rhs
 Matrix to store the linear face right-hand side contributions.
Eigen::Tensor< double, 4 > m_face_integrals_neigh
 Tensor to store the bilinear face integrals where one basis function belongs to the neighboring cell.
Eigen::Tensor< double, 3 > m_face_rhs_neigh
 Tensor to store the linear face rhs contributions where the test function belongs to the neighboring cell; shape (nrows, s_n_face_expr, n_max_neigh) – dim1 uses s_n_face_expr (total) so getIntegral's slice_neigh_size = nrows * 1 * s_n_face_expr matches the tensor stride.
fe::FeValues< dim > m_fe_values
 The FEValues object to cache ids, normals and the evaluation of shape functions and their derivatives.
bool m_need_neigh_cell
 Flags indicating whether neighboring cell information is needed.
bool m_need_neigh_values
 Flags indicating whether neighboring cell values are needed, a subset of the above, so if this is true the above is true too.
index_t m_cell_id
 Current cell id being integrated, in mesh MPI local enumeration.
index_t m_face_id
 Current face id being integrated, local to the cell.
CellNeighInfo m_cell_neigh_info
 Information about the neighboring cell across the current face it might be empty if the neighbor is not needed or does not exist.
const MappingType * m_mapping
 Pointer to the mapping of the current cell being integrated.

Detailed Description

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
class vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >

Implements a quadrature-free finite element integrator.

Template Parameters
MeshTypeThe type of the mesh.
FeExpressionTupleA tuple of types representing the integrands for volume integrals.
FeExpressionFaceTupleA tuple of types representing the integrands for face integrals.

Overview

This class assembles local stiffness matrices on a cell-by-cell basis using a quadrature-free approach. Instead of relying on numerical quadrature points (like Gauss points), it leverages the fact that the integrands are polynomials. The integration is performed analytically by pre-calculating the integrals of all monomial bases over the reference element.

The core workflow involves several stages of optimization to minimize redundant computations, which is crucial for efficiency.

The Integration Process

  1. Polynomial Representation: The first step, handled by the FeExpression objects, is to express each term of the weak form (e.g., \(c(\mathbf{x}) \nabla \phi_i \cdot \nabla \phi_j\)) as a polynomial in the coordinates of the reference element \(\hat{\mathbf{x}}\). A polynomial \(P(\hat{\mathbf{x}})\) is a sum of monomials:

    \[P(\hat{\mathbf{x}}) = \sum_{k} c_k \hat{\mathbf{x}}^{\alpha_k} \]

    where \(\hat{\mathbf{x}}^{\alpha_k}\) is a monomial (e.g., in 2D, \(\hat{x}^{\alpha_{k,1}} \hat{y}^{\alpha_{k,2}}\)).
  2. Analytical Integration: The integral of this polynomial over a physical cell \(K\) is transformed to an integral over the reference cell \(\hat{K}\) (NOTE, this is done because the basis function is defined on the reference element and we want to avoid to integrate the composition of the physical mapping with the basis function):

    \[\int_K P(\mathbf{x}) \,d\mathbf{x} = \int_{\hat{K}} P(\mathbf{F}(\hat{\mathbf{x}})) G(F) |\det(J)| \,d\hat{\mathbf{x}} \]

    Here, \(G(F)\) represents the pullback. Indeed, the polynomial can be either a vector field or a covector field (e.g. gradient) that needs further transformation. This terms (like the derminant of the the Jacobian), changes on a cell by cell basis and depending of the part of the weak form considered (e.g. in a reaction-diffusion equation we have both a vector and a covector). For this reason, the FeExpression of a weak form does not return one polynomial, but a list of polynomials that summed represent the weak form. To each polynomial of the list is associated a coefficient \(G(F)\) that needs to be multiplied in order to have the correct transformation when applying the physical mapping of the cell. E.g., the inner(grad(u), grad(v)) weak form is made by two polynomials, one that represents de_x(u)de_x(v) and one de_y(u)de_y(v), which require as coefficient the inverse of the jacobian in the x and y components, respectively. The integral is further simplified to become a weighted sum of precomputed monomial integrals. The values \(\int_{\hat{K}} \hat{\mathbf{x}}^{\alpha_k} \,d\hat{\mathbf{x}}\) are computed beforehand for all necessary monomial powers \(\alpha_k\) via the quadrature free algorithm.
  3. Optimization via Compression: To manage the potentially vast number of polynomials and monomials, the class employs several compression techniques:
  • Monomial Compression: Each monomial exponent array \(\alpha_k\) is mapped to a unique integer ID (integr_id). This allows for fast lookups in the precomputed integral table.
  • Polynomial Deduplication: Many entries in the local matrix result in identical polynomials. The buildLookupTables method identifies these duplicates. Unique polynomials are stored once, and a lookup table maps their computed integral value to all corresponding matrix entries (i, j).
  1. Handling Face Integrals and Neighbors (Lifting & Gathering): Face integrals involving terms from a neighboring cell (e.g., in Discontinuous Galerkin methods) are more complex. The coordinates on the neighbor's reference cell, \(\hat{\mathbf{x}}'\), are related to the current cell's coordinates, \(\hat{\mathbf{x}}\), by an affine map: \(\hat{\mathbf{x}}' = \mathbf{A} \hat{\mathbf{x}} + \mathbf{b}\).
  • Lifting: A monomial on the neighbor, like \((\hat{x}')^\beta\), becomes a polynomial in \(\hat{\mathbf{x}}\), \(\mathbf{A}\), and \(\mathbf{b}\). This effectively "lifts" the polynomial into a higher-dimensional space with variables \((\hat{\mathbf{x}}, \mathbf{A}, \mathbf{b})\). For instance, a 1D monomial \((\hat{x}')^2\) becomes \((A\hat{x} + b)^2 = A^2\hat{x}^2 + 2Ab\hat{x} + b^2\).
  • Gathering: To evaluate the integral efficiently, terms are factorized and "gathered". The integral is only with respect to \(\hat{\mathbf{x}}\). The parts dependent on the map \((\mathbf{A}, \mathbf{b})\) are evaluated separately. In particular, each polynomial is written as \( P(x, a, b) = M_p(x) M_q(a, b) P_r(a, b) \) where M_p and M_q are monomials and P_r is a polynomial. All the possible M_p, M_q and P_r are precomputed once (during the construction of the integrator) and evaluated for each cell. M_p is evaluated via the quadrature free algorithm, M_q and P_r (which are not 1 only for FeExpression that need the neighbor), are computed on the fly for each cell.

Member Typedef Documentation

◆ CellNeighInfo

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::CellNeighInfo
protectedinherited

◆ CellType

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::CellType
inherited

◆ CompressedListGatheredPoly

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::CompressedListGatheredPoly
Initial value:

A compressed representation of a list of gathered polynomials.

◆ FeExpressionTupleBilinear

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::FeExpressionTupleBilinear
inherited

◆ FeExpressionTupleFaceBilinear

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::FeExpressionTupleFaceBilinear
inherited

◆ FeExpressionTupleFaceLinear

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::FeExpressionTupleFaceLinear
inherited

◆ FeExpressionTupleLinear

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::FeExpressionTupleLinear
inherited

◆ FeType

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::FeType
Initial value:
std::remove_pointer_t<
std::tuple_element_t<0, FeExpressionTuple>>::FeSpaceType

◆ FlatPolyType

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::FlatPolyType = datastructure::CrsMap<CompressedMonomial, index_t>

A compressed representation of a list of standard polynomials.

◆ FlatPolyTypeLifted

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::FlatPolyTypeLifted = datastructure::CrsMap<MonoTypeLifted, index_t>

A compressed representation of a list of lifted polynomials.

◆ GatheredPolynomial

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::GatheredPolynomial = std::vector<GatheredMonomial<dim>>

An uncompressed gathered polynomial for a single entry.

◆ GatheredPolynomialCoef

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::GatheredPolynomialCoef = std::vector<std::pair<double, uint16_t>>

Coefficients for a compressed gathered polynomial.

◆ index_t

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::index_t = typename MeshType::index_t

The index type used by the mesh.

◆ MappingType

using vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::MappingType
inherited

◆ MonoType

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::MonoType = PolyType::MonomialType

The monomial type for standard polynomials.

◆ MonoTypeLifted

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::MonoTypeLifted = PolyTypeLifted::MonomialType

The monomial type for lifted polynomials.

◆ PolyType

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::PolyType = FeType::FeSpaceType::PolynomialFast

The polynomial type used for standard basis functions.

◆ PolyTypeLifted

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::PolyTypeLifted
Initial value:
std::decay_t<decltype(PolyType{}.template liftDimension<0, 2 * dim>())>
FeType::FeSpaceType::PolynomialFast PolyType
The polynomial type used for standard basis functions.
Definition integrator_qfree.hpp:265

The polynomial type "lifted" to a higher dimension. This is used for face integrals involving neighbor cell data, where the polynomial also depends on the coefficients of the affine map between reference cells. The extra 2*dim dimensions account for the diagonal Jacobian and translation vector.

◆ RepeatingTableI

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::RepeatingTableI = datastructure::CrsMap<TypeI, index_t>
protected

A compressed map used as a lookup table for repeated linear polynomials.

◆ RepeatingTableIJ

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::RepeatingTableIJ = datastructure::CrsMap<TypeIJ, index_t>
protected

A compressed map used as a lookup table for repeated bilinear polynomials.

◆ TypeI

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::TypeI = std::array<Eigen::Index, 2>
protected

Helper type for storing indices (i * s_n_blocks + bi, k) for the linear (RHS) lookup table – no trial index.

◆ TypeIJ

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::TypeIJ = std::array<Eigen::Index, 3>
protected

Helper type for storing indices (i * s_n_blocks + bi, j * s_n_blocks + bj, k) for the bilinear lookup table.

◆ WeakFormIntegratorBaseType

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
using vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::WeakFormIntegratorBaseType
Initial value:
MeshType,
FeExpressionTuple,
FeExpressionFaceTuple>
WeakFormIntegratorBase(const MeshType &mesh, CellManager< MeshType, FeType > &cell_manager, const FeExpressionTuple &fe_expression, const std::tuple<> &fe_expression_face)
Definition integrator_base.hpp:126

Constructor & Destructor Documentation

◆ WeakFormIntegratorQFree()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::WeakFormIntegratorQFree ( const MeshType & mesh,
CellManager< MeshType, FeType > & cell_manager,
const FeExpressionTuple & fe_expression,
const FeExpressionFaceTuple & fe_expression_face = FeExpressionFaceTuple{} )

Constructs the quadrature-free integrator.

Parameters
meshThe mesh object.
cell_managerManages cell data and mappings.
fe_expressionA tuple of volume integrand expressions.
fe_expression_faceA tuple of face integrand expressions.

Member Function Documentation

◆ applyBasisScaling()

void vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::applyBasisScaling ( )
inlineinherited

Apply the basis scaling to the integrals and right-hand side contributions if needed.

This method checks if the finite element type requires basis scaling. If so, it computes the scaling factors based on the Jacobian determinant of the mapping and applies them to the stored integrals and right-hand side contributions.

◆ buildLookupTables()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::buildLookupTables ( )
protected

Builds lookup tables to identify and reuse identical polynomials.

This method analyzes the polynomial tables (m_poly_table_flat, m_poly_table_face_flat, m_poly_table_face_lifted_gathered) for volume and face expressions to find which entries (i, j, k, bi, bj),( where i, j are the basis index, k the index of the sum component to handle coef. of vector and covector, and bi, bj the block index for vectorial problems) share the exact same polynomial. It then creates a table of unique polynomials (_nodupes) and a corresponding index table (_ijs_table) that maps each unique polynomial back to all the original entries it corresponds to. This avoids re-calculating the integral for the same polynomial multiple times.

◆ buildUniqueEvaTableLiftedMonomials()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
std::vector< std::array< uint8_t, WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::dim *2 > > vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::buildUniqueEvaTableLiftedMonomials ( const std::array< std::vector< GatheredPolynomial >, s_n_face_expr_bilinear > & gathered_monos_table)
protected

Scans all gathered (lifted) monomials to build a table of unique evaluation exponents.

Parameters
gathered_monos_tableThe table of uncompressed gathered monomials.

This function loops over all the possible monomial evaluations we have to do (in the lifted variables), both considering the evalut_id part and the monomials in the gather part. It builds a table that maps a unique id to an array representing the exponents of a certain monomial. This table makes it possible to compress the monomials, since we can substitute an exponent (i.e., array) with a unique id.

Returns
A sorted vector of unique exponent arrays needed for evaluation.

◆ buildWeakFormPointerTable()

void vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::buildWeakFormPointerTable ( )
inlineinherited

Build a lookup table that maps finite element expression pointers to their corresponding data storage locations for integrals and right-hand side contributions.

This method populates an unordered map that associates each finite element expression pointer with a pointer to its corresponding data storage location in the internal tensors and matrices. It ensures that each expression is uniquely mapped and checks for duplicates, reporting an error if the same expression is used more than once.

◆ compress()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::FlatPolyType vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::compress ( const datastructure::CrsMapUncompressed< MonoType > & uncompressed_table)
protected

Compresses a table of polynomials.

This function takes a table of uncompressed polynomials (represented by their full monomial lists) and performs two levels of compression:

  1. It compresses the table to a CrsMap.
  2. It compresses each monomial by converting its exponent array into a single linear index.
Parameters
uncompressed_tableAn CrsMapUncompressed map of MonoType monomials.
Returns
A FlatPolyType containing the compressed table of compressed monomials.

◆ compressGatheredLiftedPolynomials()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::compressGatheredLiftedPolynomials ( const std::array< std::vector< GatheredPolynomial >, s_n_face_expr_bilinear > & gathered_monos_table)
protected

Compresses the gathered monomials into their final integer-ID-based format.

Parameters
gathered_monos_tableThe table of uncompressed gathered monomials.

This method converts each GatheredMonomial into a CompressedGatheredMonomial by replacing exponent arrays and coefficient lists with unique integer IDs that point to entries in m_eva_idx_table and m_gathered_monos.

The gathered monomial are stored as three indexes: one that indicates the integral (with respect to the space variable), one that indicates an homogeneous term (e.g. the a in xa(b + 1)) and one the indicates the sum of other monomials, that is the index in the m_gathered_monos table

It is composed by two steps, in the first one, we substitute the std::array<uint8_t, Dim * 2> using the table m_eva_idx_table computed with buildUniqueEvaTable (in both the evalut_id and gather of GatheredMonomial). In the second, we build a table with the unique gathered parts (the gathered part is the sum of monomials times a coefficient); with this table, we substitute the std::vector<std::pair<double, int16_t>> representing the gather part with a unique id.

◆ computeMaxOrder()

void vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::computeMaxOrder ( )
inlineinherited

Compute the maximum polynomial order among all finite element expressions.

Note
This is needed to choose the right quadrature rule or the order of monomial up to which we need to use the quadrature free algorithm.

◆ computeRefToNeighRefMap()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
Eigen::Matrix< double, dim, 2 > vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::computeRefToNeighRefMap ( ) const
inlineprotected

Computes the affine mapping from the current cell's reference space to a neighbor's reference space.

Returns
A matrix of size dim x 2, where the first column is the diagonal of the composite Jacobian and the second is the composite translation vector.

◆ computeUpdateFlags()

void vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::computeUpdateFlags ( )
inlineinherited

Compute the update flags indicating the values to be updated for each cell in the FEValues.

◆ findCellNeigh()

void vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::findCellNeigh ( )
inlineinherited

Find the neighboring cell across the current (local) face (m_face_id) and set up the ids for the neighbor FEValues if needed.

◆ gatherLiftedMonomials()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::gatherLiftedMonomials ( )
protected

Orchestrates the gathering and compression of lifted monomials.

This is a key optimization for face integrals. It factors the lifted monomials to separate the parts that need integration from the parts that only depend on the geometric mapping. This significantly reduces the number of unique terms to compute.

It calls in order:

  1. gatherUncompressedLiftedMonomials
  2. buildUniqueEvaTableLiftedMonomials
  3. compressGatheredLiftedPolynomials
Note
The number of elements in the CrsMap containing the monomials is directly proportional to the cost of integration of each cell. For this reason we compress them by gathering common terms and using suitable lookup table for the value of the components of the gathered monomials

◆ gatherUncompressedLiftedMonomials()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
std::array< std::vector< typename WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::GatheredPolynomial >, WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_face_expr_bilinear > vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::gatherUncompressedLiftedMonomials ( )
protected

Gathers terms for lifted monomials from face expressions (uncompressed stage).

The method gathers each polynomial in the face expressions that need the neighbor (i.e., lifted polynomial). The process is composed by two steps:

  1. By looping over each monomial, we compress the integration part (array to int with getLinearIndex) and gather the common integration parts in the polynomial. That is, we pass from x^2a^2b + x^2ab + x to x^2(a^2b + ab) + x
  2. It further gathers the larges possible monomial in the lifted variables. That is we pass from x^2(a^2b + ab) + x to x^2(ab)(a + 1) + x
Returns
An array of vectors, where each vector contains the gathered polynomials for a specific face expression.

◆ getCell()

const CellType & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getCell ( index_t cell_id,
bool update_mapping = false )
inlineinherited

Get the cell object for a given cell id.

Parameters
cell_idCell id of the considered cell in mesh (local MPI) enumeration
update_mappingIf true, update the internal mapping pointer to the mapping of the current cell
Returns
The cell object corresponding to the given cell id

◆ getCurrFaceIntegral()

Eigen::Map< Eigen::MatrixXd > vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getCurrFaceIntegral ( const auto & expr,
Eigen::Index expr_id )
inlineinherited

Get a map to the data corresponding to the face integral for the current cell and face being integrated. The data is a raw buffer that points to the correct location in the internal storage.

This method returns an Eigen::Map to the face integral matrix for the current cell and face being integrated. It takes into account whether the finite element expression requires neighbor values and whether a neighbor cell exists.

Parameters
exprPointer to the finite element expression for which to get the face integral.
expr_idIndex of the finite element expression in the tuple.
Returns
Eigen::Map<Eigen::MatrixXd> Map to the face integral matrix. If there is no neighbor cell when needed, returns a null map.
Warning
The integral is not yet computed

◆ getCurrFaceRhs()

Eigen::Map< Eigen::VectorXd > vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getCurrFaceRhs ( const auto & expr,
Eigen::Index expr_id )
inlineinherited

Get a map to the rhs vector for the current face and expression.

Returns a writable Eigen::Map into the correct per-neighbor slot of m_face_rhs_neigh (when the expression uses fe::neigh values) or into the flat m_face_rhs column (otherwise). Returns a null map (size 0) when a neighbor is required but absent, or when precompute() rejects this face.

Parameters
exprPointer to the linear face expression.
expr_idIndex of this expression in the linear face tuple.
Returns
Eigen::Map<Eigen::VectorXd> into the appropriate storage.

◆ getFaceIntegrals()

const auto & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getFaceIntegrals ( ) const
inlineinherited

Get a const reference to the (bilinear) face integrals buffer where both basis functions belong to this cell.

◆ getFaceIntegralsNeigh()

const auto & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getFaceIntegralsNeigh ( ) const
inlineinherited

Get a const reference to the (bilinear) face integrals buffer where one basis function belongs to the neighboring cell.

◆ getIntegral()

auto vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getIntegral ( auto wf_ptr,
index_t loc_neigh_id = -1 ) const
inlineinherited

Get the integral (matrix or vector) for the current cell.

Parameters
wf_ptrPointer to the finite element expression.
loc_neigh_idLocal neighbor index (>= 0) to retrieve a single per-neighbor slice. Pass the default (-1) to obtain the sum over all neighbors for neigh-test forms, or the flat result for non-neigh forms.
Returns
A zero-copy view of the requested integral (for the non-summed case) or of an internal scratch accumulator (for the summed case). For linear weak forms the result has one column; for bilinear forms it is square. Valid only until the next getIntegral/integrate call on this integrator.

◆ getIntegrals()

const auto & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getIntegrals ( ) const
inlineinherited

Get a const reference to the (bilinear) volume integrals buffer.

◆ getRhsFaceIntegrals()

const auto & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getRhsFaceIntegrals ( ) const
inlineinherited

Get a const reference to the (linear) face right-hand side buffer.

◆ getRhsFaceIntegralsNeigh()

const auto & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getRhsFaceIntegralsNeigh ( ) const
inlineinherited

Get a const reference to the (linear) face rhs buffer where the test function belongs to the neighboring cell.

◆ getRhsIntegrals()

const auto & vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::getRhsIntegrals ( ) const
inlineinherited

Get a const reference to the (linear) volume right-hand side buffer.

◆ integrate()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::integrate ( index_t cell_id)
virtual

Performs the full integration process for a given cell.

Parameters
cell_idThe index of the cell to integrate over.

Implements vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >.

◆ integrateFaceCell()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::integrateFaceCell ( const double * eints_data,
double nanson )
protected

Integrates all face expressions over the current face of the cell.

Parameters
eints_dataPointer to the precomputed integrals of basis monomials over the reference face.
nansonThe scaling factor from Nanson's formula.

◆ integrateVolumeCell()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::integrateVolumeCell ( const double * aints_data)
protected

Integrates all volume expressions over the current cell.

Parameters
aints_dataPointer to the precomputed integrals of basis monomials over the cell volume.

◆ preallocate()

void vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::preallocate ( index_t cell_id)
inlineinherited

Resize the internal storage of local integrals (matrices) to fit the number of finite element expressions taking into account which expressions are computed on the faces and which in the volume, and which expressions are bilinear or linear.

◆ precomputeMonomialCoefsForFace()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
void vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::precomputeMonomialCoefsForFace ( )
protected

Precomputes the values of the evaluation parts of the gathered monomials for the current face.

This function takes the current cell-to-neighbor mapping and evaluates all unique monomial terms (e.g., \(J^{\beta} T^{\gamma}\)) that were identified during the gathering process. The results are stored in m_eval_table_ext and m_gather_coef for fast lookup during integration.

◆ updateFaceNormalAndGetNanson()

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple>
double vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::updateFaceNormalAndGetNanson ( )
protected

Updates the face normal vector in m_fe_values and computes the Nanson's formula factor.

Returns
The Nanson factor ( \(|\det(J)| \|J^{-T} \mathbf{n}_{\hat{F}}\|^{-1}\)), which scales the reference face integral to the physical face integral.

Member Data Documentation

◆ dim

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::size_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::dim = MeshType::self_dim
inlinestaticconstexpr

The spatial dimension of the mesh.

◆ m_cell_id

index_t vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_cell_id
protectedinherited

Current cell id being integrated, in mesh MPI local enumeration.

◆ m_cell_manager

CellManager<MeshType, FeType>& vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_cell_manager
protectedinherited

The cell manager.

◆ m_cell_neigh_info

CellNeighInfo vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_cell_neigh_info
protectedinherited

Information about the neighboring cell across the current face it might be empty if the neighbor is not needed or does not exist.

◆ m_eva_idx_table

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::vector<std::array<uint8_t, dim * 2> > vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_eva_idx_table
protected

A table mapping a unique integer ID to a monomial exponent array. Used to evaluate the mapping-dependent parts of gathered monomials.

◆ m_eval_table_ext

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::vector<double> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_eval_table_ext
protected

Buffer storing the computed values of the unique evaluation monomials (from m_eva_idx_table) for the current face.

◆ m_face_id

index_t vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_face_id
protectedinherited

Current face id being integrated, local to the cell.

◆ m_face_integrals

Eigen::Tensor<double, 3> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_face_integrals
protectedinherited

Tensor to store the bilinear face integrals where both basis functions belong to this cell.

◆ m_face_integrals_neigh

Eigen::Tensor<double, 4> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_face_integrals_neigh
protectedinherited

Tensor to store the bilinear face integrals where one basis function belongs to the neighboring cell.

◆ m_face_rhs

Eigen::MatrixXd vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_face_rhs
protectedinherited

Matrix to store the linear face right-hand side contributions.

◆ m_face_rhs_neigh

Eigen::Tensor<double, 3> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_face_rhs_neigh
protectedinherited

Tensor to store the linear face rhs contributions where the test function belongs to the neighboring cell; shape (nrows, s_n_face_expr, n_max_neigh) – dim1 uses s_n_face_expr (total) so getIntegral's slice_neigh_size = nrows * 1 * s_n_face_expr matches the tensor stride.

◆ m_fe_expression

FeExpressionTuple vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_fe_expression
protectedinherited

A tuple of pointers to the finite element expressions to compute the volume integrals.

◆ m_fe_expression_face

std::tuple<> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_fe_expression_face
protectedinherited

A tuple of pointers to the finite element expressions to compute the face integrals.

◆ m_fe_space

const FeType& vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_fe_space
protectedinherited

A reference to the finite element space.

◆ m_fe_values

fe::FeValues<dim> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_fe_values
protectedinherited

The FEValues object to cache ids, normals and the evaluation of shape functions and their derivatives.

◆ m_gather_coef

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::vector<double> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_gather_coef
protected

Buffer storing the computed values of the gathered parts (from m_gathered_monos) for the current face.

◆ m_gathered_monos

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
datastructure::CrsMap<std::pair<double, uint16_t>, index_t> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_gathered_monos
protected

Stores the unique "gathered" parts of monomials. Each row corresponds to a gather_id and contains a list of (coefficient, eval_id) pairs, representing a sum like \(\sum_i c_i M_i\), where \(M_i\) is an evaluation monomial and eval_id points to a row of m_eva_idx_table.

◆ m_integrals

Eigen::Tensor<double, 3> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_integrals
protectedinherited

Tensor to store the bilinear volume integrals.

◆ m_mapping

const MappingType* vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_mapping
protectedinherited

Pointer to the mapping of the current cell being integrated.

◆ m_mesh

const MeshType& vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_mesh
protectedinherited

A reference to the underlying mesh.

◆ m_need_neigh_cell

bool vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_need_neigh_cell
protectedinherited

Flags indicating whether neighboring cell information is needed.

◆ m_need_neigh_values

bool vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_need_neigh_values
protectedinherited

Flags indicating whether neighboring cell values are needed, a subset of the above, so if this is true the above is true too.

◆ m_neigh_sum_scratch

std::unordered_map<void*, Eigen::MatrixXd> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_neigh_sum_scratch
mutableprotectedinherited

Scratch buffers reused by getIntegral to accumulate the sum-over-neighbors case without a fresh heap allocation per call, keyed per weak-form pointer so two different neigh-summed forms queried on the same integrator cannot alias each other's result.

◆ m_npoly_comps_face

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<Eigen::Index, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_npoly_comps_face
protected

Stores the number of polynomial components for each bilinear face expression.

◆ m_npoly_comps_face_linear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<Eigen::Index, s_n_face_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_npoly_comps_face_linear
protected

Stores the number of polynomial components for each linear face expression.

◆ m_npoly_comps_volume

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<Eigen::Index, s_n_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_npoly_comps_volume
protected

Stores the number of polynomial components for each bilinear volume expression.

◆ m_npoly_comps_volume_linear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<Eigen::Index, s_n_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_npoly_comps_volume_linear
protected

Stores the number of polynomial components for each linear volume expression.

◆ m_order

std::size_t vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_order
protectedinherited

The maximum polynomial order of the finite element expressions integrated in the volume.

◆ m_order_face

std::size_t vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_order_face
protectedinherited

The maximum polynomial order of the finite element expressions integrated on the faces.

◆ m_poly_table_face_flat

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_flat
protected

Polynomial tables for bilinear face expressions (non-lifted).

◆ m_poly_table_face_flat_ijs_table

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<RepeatingTableIJ, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_flat_ijs_table
protected

Lookup table for bilinear face polynomials.

◆ m_poly_table_face_flat_linear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_face_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_flat_linear
protected

Polynomial tables for linear face expressions (non-lifted).

◆ m_poly_table_face_flat_linear_ijs_table

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<RepeatingTableI, s_n_face_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_flat_linear_ijs_table
protected

Lookup table for linear face polynomials.

◆ m_poly_table_face_flat_linear_nodupes

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_face_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_flat_linear_nodupes
protected

Unique polynomials for linear face expressions.

◆ m_poly_table_face_flat_nodupes

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_flat_nodupes
protected

Unique polynomials for bilinear face expressions.

◆ m_poly_table_face_lifted_flat

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyTypeLifted, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_lifted_flat
protected

Uncompressed polynomial tables for lifted bilinear face expressions.

◆ m_poly_table_face_lifted_gathered

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<CompressedListGatheredPoly, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_lifted_gathered
protected

Compressed and gathered version of m_poly_table_face_lifted_flat.

◆ m_poly_table_face_lifted_gathered_ijs_table

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<RepeatingTableIJ, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_lifted_gathered_ijs_table
protected

Lookup table for lifted bilinear face polynomials.

◆ m_poly_table_face_lifted_gathered_nodupes

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<CompressedListGatheredPoly, s_n_face_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_face_lifted_gathered_nodupes
protected

Unique polynomials for lifted bilinear face expressions, after gathering and deduplication.

◆ m_poly_table_flat

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_flat
protected

Polynomial tables for bilinear volume expressions.

◆ m_poly_table_flat_ijs_table

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<RepeatingTableIJ, s_n_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_flat_ijs_table
protected

Lookup table mapping unique bilinear volume polynomials to (row, col, k) entries.

◆ m_poly_table_flat_linear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_flat_linear
protected

Polynomial tables for linear volume expressions.

◆ m_poly_table_flat_linear_ijs_table

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<RepeatingTableI, s_n_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_flat_linear_ijs_table
protected

Lookup table mapping unique linear volume polynomials to (row, k) entries.

◆ m_poly_table_flat_linear_nodupes

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_expr_linear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_flat_linear_nodupes
protected

Unique polynomials for linear volume expressions, after deduplication.

◆ m_poly_table_flat_nodupes

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
std::array<FlatPolyType, s_n_expr_bilinear> vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::m_poly_table_flat_nodupes
protected

Unique polynomials for bilinear volume expressions, after deduplication.

◆ m_rhs

Eigen::MatrixXd vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_rhs
protectedinherited

Matrix to store the linear volume right-hand side contributions.

◆ m_update_flags

fe::UpdateFlagsType vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_update_flags
protectedinherited

Update flags indicating which values to update in FEValues for the volume integrals.

◆ m_update_flags_face

fe::UpdateFlagsType vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_update_flags_face
protectedinherited

Update flags indicating which values to update in FEValues for the face integrals.

◆ m_wf_ptr_table

std::unordered_map<void*, double*> vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::m_wf_ptr_table
protectedinherited

A map from finite element expression pointers to their corresponding data storage locations.

◆ nblocks

uint32_t vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, std::tuple<> >::nblocks
inlinestaticconstexprinherited

Number of vector blocks in the system, e.g. for a scalar problem is 1, for an elasticity problem is dim (2 or 3).

◆ s_n_blocks

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
index_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_blocks
inlinestaticconstexpr
Initial value:

The number of blocks for vector/tensor-valued problems.

◆ s_n_expr

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
uint32_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_expr
inlinestaticconstexpr
Initial value:

The number of volume expressions.

◆ s_n_expr_bilinear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
uint32_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_expr_bilinear
inlinestaticconstexpr
Initial value:

The number of bilinear volume expressions.

◆ s_n_expr_linear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
uint32_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_expr_linear
inlinestaticconstexpr
Initial value:

The number of linear (RHS) volume expressions.

◆ s_n_face_expr

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
uint32_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_face_expr
inlinestaticconstexpr
Initial value:

The number of face expressions.

◆ s_n_face_expr_bilinear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
uint32_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_face_expr_bilinear
inlinestaticconstexpr
Initial value:

The number of bilinear face expressions.

◆ s_n_face_expr_linear

template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
uint32_t vulpes::assemble::WeakFormIntegratorQFree< MeshType, FeExpressionTuple, FeExpressionFaceTuple >::s_n_face_expr_linear
inlinestaticconstexpr
Initial value:

The number of linear (RHS) face expressions.


The documentation for this class was generated from the following file: