SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::operators::backend::mfem::OperandEvaluator< OperandT > Struct Template Referencefinal

Scalar and vector H1 gradients share the existing value/divergence coefficient contractions. More...

#include <operand_evaluation.hpp>

Public Types

using Term = typename OperandT::term_type
 
using Value = discretization::forms::OperandValue<OperandT>
 
using ReferenceValue = std::conditional_t<needs_vector_gradient, std::array<double, 9>, Value>
 

Static Public Member Functions

static void sample_basis (const discretization::backend::mfem::DofMap &binding, int element, const ::mfem::IntegrationRule &rule, BasisEvaluation &basis, TensorBasisCache &cache, ContractionMode mode, ::mfem::ElementTransformation &transformation, BasisWorkspace &workspace)
 A global coefficient has basis one; spatial operands use their native element basis.
 
static void sample_basis (const ::mfem::FiniteElement &element, const ::mfem::IntegrationRule &rule, BasisEvaluation &basis, TensorBasisCache &cache, ContractionMode mode, ::mfem::ElementTransformation &transformation, BasisWorkspace &workspace, const discretization::backend::mfem::ElementReconstruction *reconstruction=nullptr)
 Sample a canonical tensor/dense basis, then apply MFEM's fixed-mesh mapping.
 
static void map_basis_point (int point, const mapping::MappingPointContext &context, const BasisEvaluation &reference, BasisEvaluation &result, BasisWorkspace &workspace, const mapping::MappingPointVariation *variation=nullptr)
 Apply SERiF's map to small tensor point maps, or to dense basis columns on other elements.
 
static void evaluate (const BasisEvaluation &basis, const ::mfem::Vector &coefficients, ::mfem::Vector &values, BasisWorkspace &workspace)
 Apply a cached tensor or dense basis using reusable contraction scratch.
 
static void integrate (const BasisEvaluation &basis, const ::mfem::Vector &values, ::mfem::Vector &result, BasisWorkspace &workspace)
 Transpose the same contraction; global scalar reductions retain compensated summation.
 
static ReferenceValue reference_value (const ::mfem::Vector &values, int point)
 Read the reference data needed for one physical operand sample.
 
static Value physical_value (const ReferenceValue &reference, const mapping::MappingPointContext &context)
 Apply only SERiF's additional fixed-mesh to physical map (MFEM's map is already included).
 
static Value geometry_variation (const ReferenceValue &reference, const mapping::MappingPointContext &context, const mapping::MappingPointVariation &variation)
 At fixed coefficients: scalar gradients and H1 divergence vary through A^-1; values do not vary.
 

Static Public Attributes

static constexpr int components = discretization::forms::component_count<Value>
 
static constexpr bool global_scalar = discretization::blocks::GlobalScalarTerm<Term>
 
static constexpr bool divergence = std::same_as<typename OperandT::operation_type, discretization::forms::Operation::Divergence>
 
static constexpr bool vector_copies
 
static constexpr bool h1_divergence = vector_copies && divergence
 
static constexpr bool scalar_gradient = ScalarGradientOperand<OperandT>
 
static constexpr bool vector_gradient = VectorGradientOperand<OperandT>
 
static constexpr bool needs_vector_gradient = h1_divergence || vector_gradient
 
static constexpr bool geometry_dependent = needs_vector_gradient || scalar_gradient
 
static constexpr int reference_components = needs_vector_gradient ? 9 : components
 

Static Private Member Functions

static Value transform_vector_gradient (const ReferenceValue &gradient, const ::mfem::DenseMatrix &inverse)
 Apply G_x = G_X A^-1; the inverse variation gives the same contraction for delta(G_x).
 
static Value transform_gradient (const ReferenceValue &gradient, const ::mfem::DenseMatrix &inverse)
 grad_x(z) = A^-T grad_X(z); the inverse variation gives its geometry derivative.
 
static double gradient_trace (const ReferenceValue &gradient, const ::mfem::DenseMatrix &inverse)
 div_x(u) = trace(G A^-1); replacing A^-1 by its variation gives delta(div_x(u)).
 

Detailed Description

template<MappedOperand OperandT>
struct serif::operators::backend::mfem::OperandEvaluator< OperandT >

Scalar and vector H1 gradients share the existing value/divergence coefficient contractions.

Member Typedef Documentation

◆ ReferenceValue

template<MappedOperand OperandT>
using serif::operators::backend::mfem::OperandEvaluator< OperandT >::ReferenceValue = std::conditional_t<needs_vector_gradient, std::array<double, 9>, Value>

◆ Term

template<MappedOperand OperandT>
using serif::operators::backend::mfem::OperandEvaluator< OperandT >::Term = typename OperandT::term_type

◆ Value

template<MappedOperand OperandT>
using serif::operators::backend::mfem::OperandEvaluator< OperandT >::Value = discretization::forms::OperandValue<OperandT>

Member Function Documentation

◆ evaluate()

template<MappedOperand OperandT>
serif::operators::backend::mfem::OperandEvaluator< OperandT >::evaluate ( const BasisEvaluation & basis,
const ::mfem::Vector & coefficients,
::mfem::Vector & values,
BasisWorkspace & workspace )
inlinestatic

Apply a cached tensor or dense basis using reusable contraction scratch.

◆ geometry_variation()

template<MappedOperand OperandT>
static Value serif::operators::backend::mfem::OperandEvaluator< OperandT >::geometry_variation ( const ReferenceValue & reference,
const mapping::MappingPointContext & context,
const mapping::MappingPointVariation & variation )
inlinestatic

At fixed coefficients: scalar gradients and H1 divergence vary through A^-1; values do not vary.

◆ gradient_trace()

template<MappedOperand OperandT>
static double serif::operators::backend::mfem::OperandEvaluator< OperandT >::gradient_trace ( const ReferenceValue & gradient,
const ::mfem::DenseMatrix & inverse )
inlinestaticprivate

div_x(u) = trace(G A^-1); replacing A^-1 by its variation gives delta(div_x(u)).

◆ integrate()

template<MappedOperand OperandT>
static void serif::operators::backend::mfem::OperandEvaluator< OperandT >::integrate ( const BasisEvaluation & basis,
const ::mfem::Vector & values,
::mfem::Vector & result,
BasisWorkspace & workspace )
inlinestatic

Transpose the same contraction; global scalar reductions retain compensated summation.

◆ map_basis_point()

template<MappedOperand OperandT>
static void serif::operators::backend::mfem::OperandEvaluator< OperandT >::map_basis_point ( int point,
const mapping::MappingPointContext & context,
const BasisEvaluation & reference,
BasisEvaluation & result,
BasisWorkspace & workspace,
const mapping::MappingPointVariation * variation = nullptr )
inlinestatic

Apply SERiF's map to small tensor point maps, or to dense basis columns on other elements.

◆ physical_value()

template<MappedOperand OperandT>
static Value serif::operators::backend::mfem::OperandEvaluator< OperandT >::physical_value ( const ReferenceValue & reference,
const mapping::MappingPointContext & context )
inlinestatic

Apply only SERiF's additional fixed-mesh to physical map (MFEM's map is already included).

◆ reference_value()

template<MappedOperand OperandT>
static ReferenceValue serif::operators::backend::mfem::OperandEvaluator< OperandT >::reference_value ( const ::mfem::Vector & values,
int point )
inlinestatic

Read the reference data needed for one physical operand sample.

◆ sample_basis() [1/2]

template<MappedOperand OperandT>
static void serif::operators::backend::mfem::OperandEvaluator< OperandT >::sample_basis ( const ::mfem::FiniteElement & element,
const ::mfem::IntegrationRule & rule,
BasisEvaluation & basis,
TensorBasisCache & cache,
ContractionMode mode,
::mfem::ElementTransformation & transformation,
BasisWorkspace & workspace,
const discretization::backend::mfem::ElementReconstruction * reconstruction = nullptr )
inlinestatic

Sample a canonical tensor/dense basis, then apply MFEM's fixed-mesh mapping.

◆ sample_basis() [2/2]

template<MappedOperand OperandT>
static void serif::operators::backend::mfem::OperandEvaluator< OperandT >::sample_basis ( const discretization::backend::mfem::DofMap & binding,
int element,
const ::mfem::IntegrationRule & rule,
BasisEvaluation & basis,
TensorBasisCache & cache,
ContractionMode mode,
::mfem::ElementTransformation & transformation,
BasisWorkspace & workspace )
inlinestatic

A global coefficient has basis one; spatial operands use their native element basis.

◆ transform_gradient()

template<MappedOperand OperandT>
static Value serif::operators::backend::mfem::OperandEvaluator< OperandT >::transform_gradient ( const ReferenceValue & gradient,
const ::mfem::DenseMatrix & inverse )
inlinestaticprivate

grad_x(z) = A^-T grad_X(z); the inverse variation gives its geometry derivative.

◆ transform_vector_gradient()

template<MappedOperand OperandT>
static Value serif::operators::backend::mfem::OperandEvaluator< OperandT >::transform_vector_gradient ( const ReferenceValue & gradient,
const ::mfem::DenseMatrix & inverse )
inlinestaticprivate

Apply G_x = G_X A^-1; the inverse variation gives the same contraction for delta(G_x).

Member Data Documentation

◆ components

template<MappedOperand OperandT>
int serif::operators::backend::mfem::OperandEvaluator< OperandT >::components = discretization::forms::component_count<Value>
staticconstexpr

◆ divergence

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::divergence = std::same_as<typename OperandT::operation_type, discretization::forms::Operation::Divergence>
staticconstexpr

◆ geometry_dependent

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::geometry_dependent = needs_vector_gradient || scalar_gradient
staticconstexpr

◆ global_scalar

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::global_scalar = discretization::blocks::GlobalScalarTerm<Term>
staticconstexpr

◆ h1_divergence

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::h1_divergence = vector_copies && divergence
staticconstexpr

◆ needs_vector_gradient

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::needs_vector_gradient = h1_divergence || vector_gradient
staticconstexpr

◆ reference_components

template<MappedOperand OperandT>
int serif::operators::backend::mfem::OperandEvaluator< OperandT >::reference_components = needs_vector_gradient ? 9 : components
staticconstexpr

◆ scalar_gradient

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::scalar_gradient = ScalarGradientOperand<OperandT>
staticconstexpr

◆ vector_copies

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::vector_copies
staticconstexpr
Initial value:
= [] {
if constexpr (global_scalar) {
return false;
} else {
}
}()
static constexpr std::size_t rank
The rank of the functional space associated with the term.
Definition traits.hpp:52
static constexpr bool global_scalar
Definition operand_evaluation.hpp:37

◆ vector_gradient

template<MappedOperand OperandT>
bool serif::operators::backend::mfem::OperandEvaluator< OperandT >::vector_gradient = VectorGradientOperand<OperandT>
staticconstexpr

The documentation for this struct was generated from the following files: