Represents an element-local basis evaluation operator, supporting dense or tensor contractions, pointwise mappings, and transpose application.
More...
|
| void | sample (const ::mfem::FiniteElement &element, const ::mfem::IntegrationRule &rule, ReferenceOperation operation, int copies, TensorBasisCache &cache, ContractionMode mode, const ElementReconstruction *reconstruction=nullptr) |
| | Prepare basis values or derivatives at quadrature points using a dense matrix or tensor-product representation.
|
| |
| void | set_constant (int points) |
| | Set the basis evaluation to a constant basis with the given number of points.
|
| |
| void | reset_from (const BasisEvaluation &reference, int components) |
| | Allocate storage for a mapped basis using the reference's coefficient ordering and quadrature points.
|
| |
| template<typename MapT> |
| void | map_point (int point, const BasisEvaluation &reference, MapT &&map, BasisWorkspace &workspace) |
| | Apply a pointwise linear map to the reference basis or its geometry variation.
|
| |
| void | evaluate (const ::mfem::Vector &coefficients, ::mfem::Vector &values, BasisWorkspace &workspace) const |
| | Apply the basis to native coefficients; no integration weight is introduced.
|
| |
| void | evaluate_many (const ::mfem::Vector &coefficients, ::mfem::Vector &values, int lanes, BasisWorkspace &workspace) const |
| | evaluate() for several coefficient vectors stored lane-interleaved (entry i of lane j at i * lanes + j).
|
| |
| void | integrate (const ::mfem::Vector &values, ::mfem::Vector &coefficients, BasisWorkspace &workspace) const |
| | Apply the coordinate transpose to already weighted quadrature duals.
|
| |
| int | height () const noexcept |
| | Number of flattened quadrature samples.
|
| |
| int | width () const noexcept |
| | Number of native element coefficients.
|
| |
| bool | uses_tensor () const noexcept |
| | Report whether contractions use verified Cartesian factors.
|
| |
Represents an element-local basis evaluation operator, supporting dense or tensor contractions, pointwise mappings, and transpose application.
Consider a scalar field represented on one finite element:
\[\rho_h(\xi) = \sum_{j=1}^{n} c_j \phi_j(\xi).
\]
Here, \(c_{j}\) is a scalar coefficient, \(\phi_{j}\) is its associated basis function, and \(\xi\) is the canonical reference coordinate. The field is expressed in these coordinates through the element mapping.
For a quadrature rule with \(N_{q}\) points, define the evaluation matrix \(\mathbf{E}\) by
\[E_{qj} = \phi_j(\xi_q).
\]
\(\mathbf{E}\) therefore has \(N_{q}\) rows and \(n\) columns. The field value at one point is
\[\rho_h(\xi_q) = \sum_{j=1}^{n} E_{qj} c_j.
\]
Collecting the samples into a vector gives
\[\boldsymbol{\rho}_h = \mathbf{E}\mathbf{c}.
\]
This class represents that linear operation without necessarily storing the full matrix \(\mathbf{E}\): it can instead apply equivalent tensor contractions.
- Example
- Evaluate a constant scalar field on the reference cube, then compute its integral against each basis function.
::mfem::H1_HexahedronElement element(1);
const ::mfem::IntegrationRule& rule =
::mfem::IntRules.Get(::mfem::Geometry::CUBE, 2);
backend::TensorBasisCache cache;
backend::BasisWorkspace workspace;
backend::BasisEvaluation basis;
basis.sample(
element,
rule,
backend::ReferenceOperation::value,
1,
cache,
backend::ContractionMode::automatic
);
::mfem::Vector coefficients(element.GetDof());
coefficients = 2.0;
::mfem::Vector values;
basis.evaluate(coefficients, values, workspace);
::mfem::Vector weighted_values(rule.GetNPoints());
for (int q = 0; q < rule.GetNPoints(); ++q) {
weighted_values[q] = rule.IntPoint(q).weight * values[q];
}
::mfem::Vector element_integrals;
basis.integrate(weighted_values, element_integrals, workspace);
Definition basis_evaluation.hpp:15
Definition basis_evaluation.hpp:15
Each output entry approximates
\[ \int_{\hat K} \phi_j(\xi)\rho_h(\xi)\,d\xi.
\]
These are element-DOF integral contributions, not reconstructed field coefficients. Integration over a physical element additionally requires the appropriate volume Jacobian in the quadrature weights.