SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::operators::backend::mfem Namespace Reference

Namespaces

namespace  detail
 
namespace  volume_keys
 

Classes

struct  BasisBindings
 
class  BasisEvaluation
 Represents an element-local basis evaluation operator, supporting dense or tensor contractions, pointwise mappings, and transpose application. More...
 
struct  BasisWorkspace
 Reusable scratch storage for basis contractions, reducing repeated allocations. More...
 
struct  Closure
 A minimal density-valued volume equation, sufficient to instantiate a volume cache. More...
 
struct  CoefficientTracking
 Track coefficient values using an owned snapshot and the identity of their binding. More...
 
struct  CoefficientView
 
struct  CompactificationCoefficients
 
struct  ContributionData
 
struct  DisplacementCoefficients
 
struct  ElementBasis
 Fixed-mesh basis samples; independent of the current coefficient values and displacement. More...
 
struct  ElementData
 Weighted equation data retains the exact basis, geometry, and samples used to compute it. More...
 
struct  ElementGeometry
 Physical mapping and mapped bases for one frozen displacement. More...
 
class  JacobianOperator
 
class  LinearizedBlock
 An accepted physical block with optional efficient diagonal and sparse assembly operations. More...
 
struct  MappingCoefficients
 
struct  MetadataTracking
 Validate external mesh resources before the graph compares their metadata. More...
 
struct  NumericalWork
 Numerical work derived from the dependency engine's most recent report. More...
 
struct  OperandEvaluator
 
struct  OperandEvaluator< OperandT >
 Scalar and vector H1 gradients share the existing value/divergence coefficient contractions. More...
 
struct  OperandSamples
 Reference samples remain available for derivatives through the physical mapping. More...
 
struct  PreparationRejection
 
class  TensorBasisCache
 Share immutable tensor plans within one operator; copied rules are keyed by their contents. More...
 
struct  VolumeConfiguration
 Stable equation ownership also retains temporary and move-only contribution trees. More...
 
struct  VolumeData
 One accepted result contains ordered contribution batches and the assembled residual. More...
 
struct  VolumeDiscretization
 Borrowed discretization objects must outlive their graph and its accepted results. More...
 
struct  VolumeOptions
 Numerical choices fixed when the graph is constructed. More...
 
struct  VolumeScratch
 Scratch belongs to graph callables and is never a dependency source. More...
 
struct  Workspace
 Reusable scratch for applying the accepted element linearization. More...
 

Concepts

concept  ClosureResult
 
concept  ClosureInputsAccept
 
concept  EvaluableOperand
 Check the complete interface used by preparation, Jacobian application, and its transpose.
 

Typedefs

using Schema = discretization::domain::schema::CoreEnvelopeVacuumDomainSchema
 
using Density = discretization::forms::Operand<discretization::blocks::density::mass>
 
using DensityBinding = discretization::backend::mfem::TermBinding<Closure::Test, Schema>
 
using Vector = ::mfem::Vector
 
using VolumeCoefficients
 
using VolumeMesh = VolumeDiscretization<Closure::Test, Schema>
 
using VolumeInputs
 
using VolumeCache
 
using MatrixAction = std::function<void(const ::mfem::Vector&, ::mfem::Vector&)>
 
using MatrixArrayAction = std::function<void(std::span<const ::mfem::Vector* const>, std::span<::mfem::Vector* const>)>
 Apply the forward action to several directions at once (zeroed outputs, as MatrixAction receives).
 
using PreparationMode = utils::dependencies::PreparationMode
 
template<std::size_t Contribution, typename OperandT, typename Scope = void>
using VolumeOperandResult
 Values need a mapping node only when the operand's physical representation depends on geometry.
 
template<typename CacheT, typename Scope = void>
using VolumeEquationOf = typename std::remove_cvref_t<decltype(std::declval<const CacheT&>().template get<typename volume_keys::Scoped<Scope>::Linearization>())>::Equation
 Recover the equation type from a cache's accepted result type, without accessing a result.
 
template<typename ElementT>
using ElementBatch = std::vector<std::shared_ptr<const ElementT>>
 A stage owns immutable element results, shared with downstream stages and accepted linearizations.
 
using MeshAndCoefficientBindings = volume_keys::Scoped<void>::Bindings
 
template<typename OperandT>
using SamplesFor = OperandSamples
 Associate an operand type pack with equally ordered sample arguments.
 

Enumerations

enum class  PreparationRejectionReason { MAPPING , EQUATION , NON_FINITE }
 
enum class  ContractionMode
 Options enum to control how the tensor contractions are performed. More...
 
enum class  ReferenceOperation
 Options enum to control what is actually evaluated at the reference points. More...
 
enum class  ContractionMode
 Options enum to control how the tensor contractions are performed. More...
 

Functions

template<typename BindingT>
CoefficientView< BindingT > bind (const BindingT &binding, const ::mfem::Vector &values)
 Borrow a term binding and its coefficients without extending their lifetimes.
 
template<typename BindingT>
void bind (const BindingT &, ::mfem::Vector &&)=delete
 
template<typename BindingT>
void bind (const BindingT &, const ::mfem::Vector &&)=delete
 
template<typename BindingT>
void bind (const BindingT &&, const ::mfem::Vector &)=delete
 
template<typename... BindingTs>
auto make_term_coefficients (BindingTs... bindings)
 Associate each physical term with its bound coefficients in an ordinary dependency context.
 
LinearizedBlock linearized_action (int rows, int columns, MatrixAction action, MatrixAction transpose)
 Wrap owned callbacks with checked dimensions, finite results, and overlap-safe application.
 
LinearizedBlock linearized_action (int rows, int columns, MatrixAction action, MatrixAction transpose, MatrixArrayAction batch)
 As above, with a batched forward action used by the operator's ArrayMult.
 
void apply_many (const ::mfem::Operator &action, std::span< const ::mfem::Vector *const > inputs, std::span<::mfem::Vector *const > outputs)
 Apply an operator to several directions; ArrayMult for SERiF actions, otherwise one Mult per direction.
 
LinearizedBlock transpose_block (LinearizedBlock block)
 Transpose a linearized block without discarding efficient assembly and diagonal operations.
 
LinearizedBlock compose_blocks (LinearizedBlock left, LinearizedBlock right)
 Compose linearized blocks in their written mathematical order.
 
LinearizedBlock sum_blocks (int rows, int columns, std::vector< LinearizedBlock > blocks)
 Sum compatible linearized blocks while retaining their native diagonal and sparse assembly operations.
 
template<typename ContributionT, std::size_t Count>
void element_residual (const ElementData< Count > &data, ::mfem::Vector &result, BasisWorkspace &workspace)
 Integrate the cached scalar/vector physics against its actual test operation.
 
template<VolumeEquation EquationT, typename ContributionT, bool Fields, bool Geometry>
void finish_element_action (const ElementData< EquationPlan< EquationT >::operand_count > &data, const ::mfem::DenseMatrix &geometry_derivatives, Workspace &workspace, ::mfem::Vector &result)
 Finish an element action from its field part (workspace.quadrature_values) and, with Geometry, the displacement samples (workspace.displacement_samples): contract the geometry derivatives and integrate.
 
template<VolumeEquation EquationT, typename ContributionT, bool Fields = true, bool Geometry = true>
void element_jacobian_action (const ElementData< EquationPlan< EquationT >::operand_count > &data, const ::mfem::DenseMatrix &geometry_derivatives, const std::array< discretization::backend::mfem::DofMap::Elements, EquationPlan< EquationT >::column_count > &columns, const std::array< const ::mfem::Vector *, EquationPlan< EquationT >::column_count > &directions, const discretization::backend::mfem::DofMap::Elements &displacement_binding, const ::mfem::Vector &displacement_direction, Workspace &workspace, ::mfem::Vector &result)
 Apply the accepted field derivatives and local displacement derivatives.
 
template<VolumeEquation EquationT, typename ContributionT>
void element_geometry_actions (const ElementData< EquationPlan< EquationT >::operand_count > &data, const ::mfem::DenseMatrix &geometry_derivatives, const discretization::backend::mfem::DofMap::Elements &displacement_binding, std::span< const ::mfem::Vector *const > displacement_directions, Workspace &workspace, std::span<::mfem::Vector *const > results)
 element_jacobian_action<false, true> for several displacement directions of one element.
 
template<VolumeEquation EquationT, typename ContributionT>
std::expected< ElementBasis< EquationPlan< EquationT >::operand_count >, PreparationRejection > sample_element_basis (const ContributionT &equation, int element, const discretization::backend::mfem::DofMap &row, const discretization::backend::mfem::DofMap &displacement_binding, const std::array< const discretization::backend::mfem::DofMap *, EquationPlan< EquationT >::column_count > &columns, const mapping::DomainMapper &mapper, const discretization::quadrature::Policy &policy, TensorBasisCache &basis_cache, ContractionMode contraction_mode)
 Sample the contribution's quadrature rule and bases on the fixed computational mesh.
 
elements element_values (basis.element, input.values, workspace.element_values)
 
template<VolumeEquation EquationT, typename ContributionT>
std::expected< ElementGeometry< EquationPlan< EquationT >::operand_count >, PreparationRejection > map_element_geometry (const ElementBasis< EquationPlan< EquationT >::operand_count > &basis, const discretization::backend::mfem::DofMap &displacement_binding, const discretization::backend::mfem::DofMap::Elements &displacement_elements, const ::mfem::Vector &displacement, const MappingCoefficients &compactification, const mapping::DomainMapper &mapper, Workspace &workspace)
 Freeze displacement and compactification, then map quadrature points and bases to physical space.
 
template<EvaluableOperand OperandT, std::size_t Count>
::mfem::Vector map_element_operand (const ::mfem::Vector &reference, const ElementGeometry< Count > &geometry, Workspace &workspace)
 Apply an operand's physical transformation to its cached fixed-mesh samples.
 
template<VolumeEquation EquationT, typename ContributionT>
equations::EquationPoint< typename ContributionT::Operands > element_equation_point (const std::array< std::shared_ptr< const ::mfem::Vector >, EquationPlan< EquationT >::operand_count > &physical_values, const mapping::MappingPointContext &context, int point)
 Pack the physical samples requested by this contribution at one quadrature point.
 
template<VolumeEquation EquationT, typename ContributionT>
bool store_element_linearization (const equations::PointLinearization< typename ContributionT::Operands, typename OperandEvaluator< equations::TestOperandOf< ContributionT > >::Value > &physics, int point, double weight, ElementData< EquationPlan< EquationT >::operand_count > &data)
 Weight a point's residual and derivatives; reject any non-finite stored component.
 
template<VolumeEquation EquationT, typename ContributionT>
std::expected< ElementData< EquationPlan< EquationT >::operand_count >, PreparationRejection > evaluate_element_equation (const ContributionT &equation, double coefficient, std::shared_ptr< const ElementBasis< EquationPlan< EquationT >::operand_count > > basis, std::shared_ptr< const ElementGeometry< EquationPlan< EquationT >::operand_count > > geometry, std::array< std::shared_ptr< const ::mfem::Vector >, EquationPlan< EquationT >::operand_count > reference_values, const std::array< std::shared_ptr< const ::mfem::Vector >, EquationPlan< EquationT >::operand_count > &physical_values, Workspace &workspace)
 Evaluate and weight the equation while retaining its immutable preparation inputs.
 
template<VolumeEquation EquationT, typename ContributionT>
void element_jacobian_transpose (const ElementData< EquationPlan< EquationT >::operand_count > &data, const ::mfem::DenseMatrix &geometry_derivatives, const discretization::backend::mfem::DofMap::Elements &row, const ::mfem::Vector &residual_dual, Workspace &workspace, std::array<::mfem::Vector, EquationPlan< EquationT >::column_count > &column_duals, ::mfem::Vector &displacement_dual)
 Transpose the same accepted field and geometry contractions used by the forward action.
 
template<VolumeEquation Equation, typename Contribution>
auto geometry_integrand_variation (const ElementData< EquationPlan< Equation >::operand_count > &data, int point, const mapping::VolumeMappingContext &context, const mapping::VolumeMappingVariation &variation)
 Differentiate the weighted physics through position, operand mappings and the volume measure.
 
template<VolumeEquation Equation, typename Contribution>
std::expected<::mfem::DenseMatrix, PreparationRejection > element_geometry_derivatives (const ElementData< EquationPlan< Equation >::operand_count > &data, const discretization::backend::mfem::DofMap &displacement_binding, const ::mfem::FiniteElementSpace &compactification_space, const mapping::DomainMapper &mapper, Workspace &workspace)
 Differentiate one weighted integrand with respect to local displacement values and gradients.
 
std::vector< double > checked_diagonal (const LinearizedBlock &block)
 Extract a diagonal and reject a callback that violates its declared physical block dimensions.
 
std::shared_ptr< const ::mfem::SparseMatrix > checked_assembly (const LinearizedBlock &block)
 Assemble a non-null finalized sparse matrix whose dimensions match its declared physical action.
 
LinearizedBlock linearized_block (std::shared_ptr< const ::mfem::SparseMatrix > matrix)
 Retain an already assembled physical block without copying its matrix.
 
LinearizedBlock linearized_block (std::shared_ptr< const ::mfem::DenseMatrix > matrix)
 Retain a small assembled physical block, such as a generated scalar constraint.
 
template<typename CacheT, typename PrepareT>
std::expected< void, PreparationRejection > try_prepare_validated (CacheT &cache, PrepareT &&prepare)
 A failed validation or calculation must make the previous accepted result inaccessible.
 
template<VolumeEquation RowEquationT, typename ContributionT>
const ::mfem::IntegrationRule & equation_rule (const ContributionT &equation, const discretization::quadrature::Policy &policy, ::mfem::ElementTransformation &transformation, const ::mfem::FiniteElement &displacement_element, discretization::quadrature::MappingKind mapping_kind=discretization::quadrature::MappingKind::general, int reconstruction_order=0)
 Resolve one rule covering all operand forms and the geometry weight.
 
LinearizedBlock replace_block_rows (LinearizedBlock original, std::vector< int > selected_rows, std::shared_ptr< const ::mfem::SparseMatrix > replacement)
 Replace selected physical equation rows with an immutable sparse row block in the same unknown coordinates.
 
template<VolumeEquation EquationT, typename SchemaT>
void validate_volume_data (const VolumeData< EquationT, SchemaT > &data)
 Reject changes to discretization objects borrowed by an accepted linearization.
 
template<VolumeEquation EquationT, typename SchemaT, typename VisitT>
void for_each_volume_element (const VolumeData< EquationT, SchemaT > &data, VisitT &&visit)
 Visit each contribution's own batch in equation order, without scanning other contributions.
 
template<VolumeEquation EquationT, typename SchemaT, typename VisitT>
void for_each_volume_linearization (const VolumeData< EquationT, SchemaT > &data, VisitT &&visit)
 Visit equation data together with its graph-owned local geometry derivative matrix.
 
template<VolumeEquation EquationT, typename SchemaT>
int volume_height (const VolumeData< EquationT, SchemaT > &data)
 Return the supported residual size.
 
template<VolumeEquation EquationT, typename SchemaT>
int volume_width (const VolumeData< EquationT, SchemaT > &data)
 Packed directions contain unique coefficient terms followed by displacement.
 
template<VolumeEquation EquationT, typename SchemaT>
std::size_t tensor_element_count (const VolumeData< EquationT, SchemaT > &data)
 Count contribution-elements using tensor contractions for any sampled basis.
 
template<VolumeEquation EquationT, typename SchemaT>
int integration_order (const VolumeData< EquationT, SchemaT > &data, int element)
 Return the largest contribution quadrature order on a supported mesh element.
 
template<VolumeEquation EquationT, typename SchemaT>
void volume_residual (const VolumeData< EquationT, SchemaT > &data, ::mfem::Vector &result)
 Copy the residual already assembled and checked when this result was accepted.
 
template<std::size_t Count>
std::array< discretization::backend::mfem::DofMap::Elements, Count > column_elements (const std::array< const discretization::backend::mfem::DofMap *, Count > &columns)
 Validate coefficient bindings once before a complete element traversal.
 
template<bool Fields = true, bool Geometry = true, VolumeEquation EquationT, typename SchemaT>
void apply_volume_direction (const VolumeData< EquationT, SchemaT > &data, const std::array< const ::mfem::Vector *, EquationPlan< EquationT >::column_count > &directions, const ::mfem::Vector &displacement_direction, Workspace &workspace, ::mfem::Vector &result)
 Apply only the requested directions and assemble their supported residual contribution.
 
template<VolumeEquation EquationT, typename SchemaT>
void apply_volume_displacements (const VolumeData< EquationT, SchemaT > &data, std::span< const ::mfem::Vector *const > displacement_directions, std::span<::mfem::Vector *const > results)
 apply_volume_direction<false, true> for several displacement directions in one traversal.
 
template<VolumeEquation EquationT, typename SchemaT, typename CoefficientsT>
void apply_jacobian (const VolumeData< EquationT, SchemaT > &data, const CoefficientsT &direction, const ::mfem::Vector &displacement_direction, Workspace &workspace, ::mfem::Vector &result)
 Apply a direction whose terms explicitly name the accepted coefficient bindings.
 
template<VolumeEquation EquationT, typename SchemaT>
void apply_jacobian (const VolumeData< EquationT, SchemaT > &data, const ::mfem::Vector &direction, Workspace &workspace, ::mfem::Vector &result)
 Unpack unique coefficient terms and displacement, then use the same numerical action.
 
template<VolumeEquation EquationT, typename SchemaT>
void apply_jacobian_transpose (const VolumeData< EquationT, SchemaT > &data, const ::mfem::Vector &residual_dual, Workspace &workspace, ::mfem::Vector &result)
 Assemble the full coordinate transpose in the same packed order as the forward action.
 
template<std::size_t Contribution, typename OperandT, VolumeEquation EquationT, typename SchemaT, typename Scope = void>
auto make_operand_computations (const std::shared_ptr< VolumeScratch > &scratch)
 Declare one coefficient contraction, followed by a physical mapping when the space requires it.
 
template<std::size_t Index, typename Scope, VolumeEquation EquationT, typename SchemaT, typename ContributionT, typename... Operands>
auto make_contribution_computations (const std::shared_ptr< const VolumeConfiguration< EquationT, SchemaT > > &configuration, const std::shared_ptr< VolumeScratch > &scratch, ContributionBinding< ContributionT > contribution, utils::types::TypeList< Operands... >)
 Build one contribution's branch in the same order as its numerical description.
 
template<typename Scope = void, VolumeEquation EquationT, typename SchemaT, std::size_t... Indices>
auto connect_volume_contributions (const std::shared_ptr< const VolumeConfiguration< EquationT, SchemaT > > &configuration, std::index_sequence< Indices... >)
 Expose contribution computations so deformation and equations can share one dependency graph.
 
template<VolumeEquation EquationT, std::size_t Index, typename Scope = void, typename CacheT>
void report_contribution_preparation (const CacheT &cache, NumericalWork &report)
 Convert the dependency engine's node statuses to numerical work counts for one contribution.
 
template<typename Scope = void, VolumeEquation EquationT, typename SchemaT>
auto make_volume_equation_computations (std::shared_ptr< const EquationT > equation, const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, VolumeOptions options={})
 Declare reusable volume computations without selecting their source of displacement.
 
template<typename Scope = void, VolumeEquation EquationT, typename SchemaT>
auto make_volume_equation_computations (EquationT equation, const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, VolumeOptions options={})
 Own standalone equations while allowing complete models to share their existing immutable members.
 
template<typename Scope = void, VolumeEquation EquationT, typename SchemaT, typename InputsT>
auto make_volume_equation_cache (EquationT equation, const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const InputsT &inputs, VolumeOptions options={})
 Construct a standalone cache from the same computations used by a coupled deformation graph.
 
template<typename Scope = void, typename CacheT, typename DiscretizationT, typename CoefficientsT>
std::expected< void, PreparationRejection > try_prepare_volume (CacheT &cache, const DiscretizationT &discretization, const CoefficientsT &term_coefficients, const ::mfem::Vector &displacement_coefficients, PreparationMode mode=PreparationMode::reuse_unchanged)
 Validate current inputs and atomically publish a complete volume linearization.
 
template<typename Scope = void, typename CacheT, typename DiscretizationT, typename CoefficientsT>
void prepare_volume (CacheT &cache, const DiscretizationT &discretization, const CoefficientsT &term_coefficients, const ::mfem::Vector &displacement_coefficients, PreparationMode mode=PreparationMode::reuse_unchanged)
 Throw a caller-visible numerical error when a complete preparation cannot be accepted.
 
template<typename Scope = void, typename CacheT>
NumericalWork volume_work_report (const CacheT &cache)
 Derive work counts from accepted node statuses; no second report lifecycle is stored.
 
template<typename TestT, typename SchemaT>
 VolumeDiscretization (const discretization::backend::mfem::TermBinding< TestT, SchemaT > &, const discretization::backend::mfem::TermBinding< discretization::blocks::displacement::vector, SchemaT > &, const ::mfem::GridFunction &, const mapping::DomainMapper &) -> VolumeDiscretization< TestT, SchemaT >
 
template<typename Field, VolumeEquation Equation, typename Schema>
std::shared_ptr< const ::mfem::SparseMatrix > assemble_volume_field (const VolumeData< Equation, Schema > &data)
 Assemble a selected field block from accepted weighted derivatives, never by probing the whole system.
 
template<typename Field, VolumeEquation Equation, typename Schema>
std::vector< double > volume_field_diagonal (const VolumeData< Equation, Schema > &data)
 Extract exact physical diagonals, retaining constraint cross terms when hanging nodes are present.
 
template<typename Field, VolumeEquation Equation, typename Schema>
LinearizedBlock volume_field_block (std::shared_ptr< const VolumeData< Equation, Schema > > data)
 Expose efficient physical block operations from an owning accepted dependency result.
 
template<typename TestT, typename SchemaT>
void validate_volume_discretization (const VolumeDiscretization< TestT, SchemaT > &discretization)
 Check borrowed mesh objects before sampling or applying accepted results.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT, typename... Columns>
auto make_volume_binding_input (const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients, utils::types::TypeList< Columns... >)
 Validate one equation's bindings without constructing duplicate coefficient resources.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
auto make_volume_binding_input (const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients)
 Share equation metadata with a model's common physical coefficient context.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT, typename... Columns>
auto make_volume_inputs (const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients, utils::types::TypeList< Columns... > columns)
 Supply precisely the consumed terms for a standalone equation.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
auto make_volume_inputs (const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients)
 Bind equation and reference inputs when displacement will be produced inside the dependency graph.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT, typename... Columns>
auto make_volume_inputs (const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients, const ::mfem::Vector &displacement_coefficients, utils::types::TypeList< Columns... > columns)
 Append a checked external displacement while preserving each original resource's tracking policy.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
auto make_volume_inputs (const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients, const ::mfem::Vector &displacement_coefficients)
 Build a checked source context without retaining the coefficient vectors.
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
void make_volume_inputs (const VolumeDiscretization< typename EquationT::Test, SchemaT > &, const CoefficientsT &, ::mfem::Vector &&)=delete
 
template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
void make_volume_inputs (const VolumeDiscretization< typename EquationT::Test, SchemaT > &, const CoefficientsT &, const ::mfem::Vector &&)=delete
 
template<VolumeEquation EquationT, typename SchemaT, typename ContributionT>
std::expected< ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > >, PreparationRejection > sample_contribution_basis (const VolumeConfiguration< EquationT, SchemaT > &configuration, const ContributionBinding< ContributionT > &contribution, const BasisBindings< EquationPlan< EquationT >::column_count > &bindings, TensorBasisCache &cache)
 Sample the reference discretization once for each supported element of this contribution.
 
template<VolumeEquation EquationT, typename OperandT, typename BindingT>
OperandSamples sample_contribution_operand (const ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > > &basis, const CoefficientView< BindingT > &input, Workspace &workspace)
 Only this operand's coefficients and reference basis determine its reference samples.
 
template<VolumeEquation EquationT, typename SchemaT, typename ContributionT>
std::expected< ElementBatch< ElementGeometry< EquationPlan< EquationT >::operand_count > >, PreparationRejection > map_contribution_geometry (const VolumeConfiguration< EquationT, SchemaT > &configuration, const ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > > &basis, const CoefficientView< typename VolumeConfiguration< EquationT, SchemaT >::DisplacementBinding > &displacement, const MappingCoefficients &compactification, Workspace &workspace)
 Freeze mapping data and mapped bases independently of the equation's coefficient inputs.
 
template<typename OperandT, std::size_t OperandCount>
OperandSamples map_contribution_operand (const OperandSamples &samples, const ElementBatch< ElementGeometry< OperandCount > > &geometry, Workspace &workspace)
 Map only operands whose physical representation depends on deformation.
 
template<VolumeEquation Equation, typename Schema, typename Contribution>
std::expected< ElementBatch<::mfem::DenseMatrix >, PreparationRejection > differentiate_contribution_geometry (const VolumeConfiguration< Equation, Schema > &configuration, const ContributionData< EquationPlan< Equation >::operand_count > &contribution, Workspace &workspace)
 Compute local displacement derivatives as an immutable graph result for this contribution.
 
template<VolumeEquation EquationT, typename ContributionT, typename... Operands>
std::expected< ContributionData< EquationPlan< EquationT >::operand_count >, PreparationRejection > evaluate_contribution_equation (const ContributionBinding< ContributionT > &contribution, const ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > > &basis, const ElementBatch< ElementGeometry< EquationPlan< EquationT >::operand_count > > &geometry, Workspace &workspace, const SamplesFor< Operands > &... samples)
 Evaluate one equation contribution; its basis, mapping and individual operand samples are already prepared.
 
template<VolumeEquation EquationT, typename SchemaT, typename... Contributions>
std::expected< VolumeData< EquationT, SchemaT >, PreparationRejection > collect_volume_results (const std::shared_ptr< const VolumeConfiguration< EquationT, SchemaT > > &configuration, const BasisBindings< EquationPlan< EquationT >::column_count > &bindings, Workspace &workspace, const Contributions &... contributions)
 Collect the results of all contributions into a single VolumeData. This contains the residuals due to each contribution for all degrees of freedom as well as data needed for subsequent jacobian calculations.
 

Variables

template<VolumeEquation EquationT, EvaluableOperand OperandT, typename BindingT>
constexpr std::size_t index = equations::OperandValues<typename Plan::Operands>::template index<OperandT>()
 Contract one operand's fixed-mesh basis with its current coefficients.
 
::mfem::Vector values
 

Typedef Documentation

◆ Density

◆ DensityBinding

◆ ElementBatch

template<typename ElementT>
using serif::operators::backend::mfem::ElementBatch = std::vector<std::shared_ptr<const ElementT>>

A stage owns immutable element results, shared with downstream stages and accepted linearizations.

◆ MatrixAction

◆ MatrixArrayAction

using serif::operators::backend::mfem::MatrixArrayAction = std::function<void(std::span<const ::mfem::Vector* const>, std::span<::mfem::Vector* const>)>

Apply the forward action to several directions at once (zeroed outputs, as MatrixAction receives).

Note
Each output must equal what MatrixAction produces for its input; batching only shares traversals.

◆ MeshAndCoefficientBindings

◆ PreparationMode

◆ SamplesFor

template<typename OperandT>
using serif::operators::backend::mfem::SamplesFor = OperandSamples

Associate an operand type pack with equally ordered sample arguments.

◆ Schema

◆ Vector

◆ VolumeCache

Initial value:
std::declval<Closure>(), std::declval<VolumeMesh>(), std::declval<const VolumeInputs&>()
))
auto make_volume_equation_cache(EquationT equation, const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const InputsT &inputs, VolumeOptions options={})
Construct a standalone cache from the same computations used by a coupled deformation graph.
Definition volume_computations.hpp:187

◆ VolumeCoefficients

Initial value:
bind(std::declval<const DensityBinding&>(), std::declval<const Vector&>())
))
CoefficientView< BindingT > bind(const BindingT &binding, const ::mfem::Vector &values)
Borrow a term binding and its coefficients without extending their lifetimes.
Definition term_coefficients.hpp:23
auto make_term_coefficients(BindingTs... bindings)
Associate each physical term with its bound coefficients in an ordinary dependency context.
Definition term_coefficients.hpp:38

◆ VolumeEquationOf

template<typename CacheT, typename Scope = void>
using serif::operators::backend::mfem::VolumeEquationOf = typename std::remove_cvref_t<decltype(std::declval<const CacheT&>().template get<typename volume_keys::Scoped<Scope>::Linearization>())>::Equation

Recover the equation type from a cache's accepted result type, without accessing a result.

◆ VolumeInputs

Initial value:
std::declval<const VolumeMesh&>(), std::declval<const VolumeCoefficients&>(), std::declval<const Vector&>()
))
auto make_volume_inputs(const VolumeDiscretization< typename EquationT::Test, SchemaT > &discretization, const CoefficientsT &term_coefficients, utils::types::TypeList< Columns... > columns)
Supply precisely the consumed terms for a standalone equation.
Definition volume_inputs.hpp:106

◆ VolumeMesh

◆ VolumeOperandResult

template<std::size_t Contribution, typename OperandT, typename Scope = void>
using serif::operators::backend::mfem::VolumeOperandResult
Initial value:
std::conditional_t<OperandEvaluator<OperandT>::geometry_dependent, typename volume_keys::Scoped<Scope>::template PhysicalValues<Contribution, OperandT>,
typename volume_keys::Scoped<Scope>::template ReferenceValues<Contribution, OperandT>>
Keep equation-local stages distinct while sharing physical coefficient sources.
Definition volume_data.hpp:24

Values need a mapping node only when the operand's physical representation depends on geometry.

Enumeration Type Documentation

◆ ContractionMode [1/2]

Options enum to control how the tensor contractions are performed.

◆ ContractionMode [2/2]

Options enum to control how the tensor contractions are performed.

◆ PreparationRejectionReason

Enumerator
MAPPING 
EQUATION 
NON_FINITE 

◆ ReferenceOperation

Options enum to control what is actually evaluated at the reference points.

Function Documentation

◆ apply_jacobian() [1/2]

template<VolumeEquation EquationT, typename SchemaT>
void serif::operators::backend::mfem::apply_jacobian ( const VolumeData< EquationT, SchemaT > & data,
const ::mfem::Vector & direction,
Workspace & workspace,
::mfem::Vector & result )

Unpack unique coefficient terms and displacement, then use the same numerical action.

◆ apply_jacobian() [2/2]

template<VolumeEquation EquationT, typename SchemaT, typename CoefficientsT>
void serif::operators::backend::mfem::apply_jacobian ( const VolumeData< EquationT, SchemaT > & data,
const CoefficientsT & direction,
const ::mfem::Vector & displacement_direction,
Workspace & workspace,
::mfem::Vector & result )

Apply a direction whose terms explicitly name the accepted coefficient bindings.

◆ apply_jacobian_transpose()

template<VolumeEquation EquationT, typename SchemaT>
void serif::operators::backend::mfem::apply_jacobian_transpose ( const VolumeData< EquationT, SchemaT > & data,
const ::mfem::Vector & residual_dual,
Workspace & workspace,
::mfem::Vector & result )

Assemble the full coordinate transpose in the same packed order as the forward action.

◆ apply_many()

void serif::operators::backend::mfem::apply_many ( const ::mfem::Operator & action,
std::span< const ::mfem::Vector *const > inputs,
std::span<::mfem::Vector *const > outputs )

Apply an operator to several directions; ArrayMult for SERiF actions, otherwise one Mult per direction.

◆ apply_volume_direction()

template<bool Fields = true, bool Geometry = true, VolumeEquation EquationT, typename SchemaT>
void serif::operators::backend::mfem::apply_volume_direction ( const VolumeData< EquationT, SchemaT > & data,
const std::array< const ::mfem::Vector *, EquationPlan< EquationT >::column_count > & directions,
const ::mfem::Vector & displacement_direction,
Workspace & workspace,
::mfem::Vector & result )

Apply only the requested directions and assemble their supported residual contribution.

◆ apply_volume_displacements()

template<VolumeEquation EquationT, typename SchemaT>
void serif::operators::backend::mfem::apply_volume_displacements ( const VolumeData< EquationT, SchemaT > & data,
std::span< const ::mfem::Vector *const > displacement_directions,
std::span<::mfem::Vector *const > results )

apply_volume_direction<false, true> for several displacement directions in one traversal.

Note
Every (direction, element) action runs concurrently with worker-owned scratch, then each direction adds its element results in the original element order, so each result equals the single-direction call.

◆ assemble_volume_field()

template<typename Field, VolumeEquation Equation, typename Schema>
std::shared_ptr< const ::mfem::SparseMatrix > serif::operators::backend::mfem::assemble_volume_field ( const VolumeData< Equation, Schema > & data)
nodiscard

Assemble a selected field block from accepted weighted derivatives, never by probing the whole system.

◆ bind() [1/4]

template<typename BindingT>
void serif::operators::backend::mfem::bind ( const BindingT && ,
const ::mfem::Vector &  )
delete

◆ bind() [2/4]

template<typename BindingT>
void serif::operators::backend::mfem::bind ( const BindingT & ,
::mfem::Vector &&  )
delete

◆ bind() [3/4]

template<typename BindingT>
void serif::operators::backend::mfem::bind ( const BindingT & ,
const ::mfem::Vector &&  )
delete

◆ bind() [4/4]

template<typename BindingT>
CoefficientView< BindingT > serif::operators::backend::mfem::bind ( const BindingT & binding,
const ::mfem::Vector & values )
nodiscard

Borrow a term binding and its coefficients without extending their lifetimes.

◆ checked_assembly()

std::shared_ptr< const::mfem::SparseMatrix > serif::operators::backend::mfem::checked_assembly ( const LinearizedBlock & block)
nodiscard

Assemble a non-null finalized sparse matrix whose dimensions match its declared physical action.

◆ checked_diagonal()

std::vector< double > serif::operators::backend::mfem::checked_diagonal ( const LinearizedBlock & block)
nodiscard

Extract a diagonal and reject a callback that violates its declared physical block dimensions.

◆ collect_volume_results()

template<VolumeEquation EquationT, typename SchemaT, typename... Contributions>
std::expected< VolumeData< EquationT, SchemaT >, PreparationRejection > serif::operators::backend::mfem::collect_volume_results ( const std::shared_ptr< const VolumeConfiguration< EquationT, SchemaT > > & configuration,
const BasisBindings< EquationPlan< EquationT >::column_count > & bindings,
Workspace & workspace,
const Contributions &... contributions )
nodiscard

Collect the results of all contributions into a single VolumeData. This contains the residuals due to each contribution for all degrees of freedom as well as data needed for subsequent jacobian calculations.

Template Parameters
EquationTThe equation type which is being solved, this is used to determine the test and operand types.
SchemaTThe schema type which is being solved, this is used to constrain the support of the contributions and define which material and boundary attributes belong to what dofs
ContributionsThe contributions which are being evaluated, these are the terms in the equation which are being integrated over the volume
Parameters
configurationThe configuration of the volume problem, including the equation and discretization.
bindingsThe basis bindings for the volume problem, including the residual and displacement bindings
workspaceThe workspace for the volume problem, including the full result vector and element
contributionsThe contributions to the volume problem, including their basis, geometry, and operand samples.
Returns
A VolumeData object containing the residuals due to each contribution for all degrees of freedom as well as data needed for subsequent jacobian calculations.
Compiler Errors:
  • If the a contribution defines a residual_offset but that residual offset is not addable to a double producing a double.
Detailed Explanation
This is a really important function on the backend to lets take some time to walk through it. We take in some configuration data (including things like what equation we are solving and what discretization we are using, the basis binding which contains mappings from full dof space to supported dof space, a runtime workspace, and a variable number of contributions.

After some setup we initialize the VolumeData object which will be what we eventually return. The first part is then to loop over all contributions and for each contribution accumulate its residual_offset. See AngularMomentumConstraint for more detail; however, the gist is that this is some constant term which should be removed from the final integrated quantity to evaluate the residual (think the integrated angular momentum - the target angular momentum for the residual).

We first fold over all contributions and accumulate their residuals and following that there is then some basic validation that the total residual offset is finite.

Next we extract the "residual bindings" from the discretization provided by the configuration. The residual bindings is a, after a few inheritances, DofMap. This means it fundamentally represents some term and how that term is supported on the mesh. So when we ask for say the size of the residual binding what that is saying is "how many dofs is this residual defined for". We make the full result a vector the size of the number of dofs the residual is defined for.

We use the CompensatedSum class to help avoid round off and cancellation errors.

We then go through and for each contribution to each element we evaluate the residual from that contribution. The evaluate_residual function is the primary function where we actually integrate an equations contributions over a volume and we include this in the global residual sum. We fold over and call this function for every contribution and for every element. Thereby getting the total residual for the entire volume due to all contributions.

What we end up with is this global_sum. We then need to apply one more modification to it, if we are working with some global scalar (e.g. fixed angular momentum) then we add the residual offset (note that this will often be a negative value, AngularMomentumConstraint for example returns -angular momentum target).

Then, regardless of if we are working with a global scalar or not we gather the full result into the residual vector. Gathering here means that we select all the residual values on supported dofs and distribute them into the correct indices of the full space residual vector. Dofs which are not supported by the residual binding will be set to zero.

TL:DR
Use this function to evaluate the residual of a volume problem, likely you never need to think about the implementation details.

◆ column_elements()

template<std::size_t Count>
std::array< discretization::backend::mfem::DofMap::Elements, Count > serif::operators::backend::mfem::column_elements ( const std::array< const discretization::backend::mfem::DofMap *, Count > & columns)
nodiscard

Validate coefficient bindings once before a complete element traversal.

◆ compose_blocks()

LinearizedBlock serif::operators::backend::mfem::compose_blocks ( LinearizedBlock left,
LinearizedBlock right )
nodiscard

Compose linearized blocks in their written mathematical order.

◆ connect_volume_contributions()

template<typename Scope = void, VolumeEquation EquationT, typename SchemaT, std::size_t... Indices>
auto serif::operators::backend::mfem::connect_volume_contributions ( const std::shared_ptr< const VolumeConfiguration< EquationT, SchemaT > > & configuration,
std::index_sequence< Indices... >  )
nodiscard

Expose contribution computations so deformation and equations can share one dependency graph.

◆ differentiate_contribution_geometry()

template<VolumeEquation Equation, typename Schema, typename Contribution>
std::expected< ElementBatch<::mfem::DenseMatrix >, PreparationRejection > serif::operators::backend::mfem::differentiate_contribution_geometry ( const VolumeConfiguration< Equation, Schema > & configuration,
const ContributionData< EquationPlan< Equation >::operand_count > & contribution,
Workspace & workspace )
nodiscard

Compute local displacement derivatives as an immutable graph result for this contribution.

◆ element_equation_point()

template<VolumeEquation EquationT, typename ContributionT>
equations::EquationPoint< typename ContributionT::Operands > serif::operators::backend::mfem::element_equation_point ( const std::array< std::shared_ptr< const ::mfem::Vector >, EquationPlan< EquationT >::operand_count > & physical_values,
const mapping::MappingPointContext & context,
int point )
nodiscard

Pack the physical samples requested by this contribution at one quadrature point.

◆ element_geometry_actions()

template<VolumeEquation EquationT, typename ContributionT>
void serif::operators::backend::mfem::element_geometry_actions ( const ElementData< EquationPlan< EquationT >::operand_count > & data,
const ::mfem::DenseMatrix & geometry_derivatives,
const discretization::backend::mfem::DofMap::Elements & displacement_binding,
std::span< const ::mfem::Vector *const > displacement_directions,
Workspace & workspace,
std::span<::mfem::Vector *const > results )

element_jacobian_action<false, true> for several displacement directions of one element.

Note
The displacement samples of all directions come from one lane-batched basis evaluation (each lane equals the single evaluation); every direction is then finished exactly as element_jacobian_action finishes it.

◆ element_geometry_derivatives()

template<VolumeEquation Equation, typename Contribution>
std::expected<::mfem::DenseMatrix, PreparationRejection > serif::operators::backend::mfem::element_geometry_derivatives ( const ElementData< EquationPlan< Equation >::operand_count > & data,
const discretization::backend::mfem::DofMap & displacement_binding,
const ::mfem::FiniteElementSpace & compactification_space,
const mapping::DomainMapper & mapper,
Workspace & workspace )
nodiscard

Differentiate one weighted integrand with respect to local displacement values and gradients.

Note
The graph owns this matrix. Its twelve columns are u_c and partial_{xi_k} u_c, ordered as the displacement basis samples. Rows are quadrature points times fixed-mesh test components. This includes the variation of the test map: subsequent forward and transpose actions therefore use the same fixed reference basis and never reevaluate the physical mapping. The twelve directions are exact local derivatives, independent of finite-element order; they are neither finite differences nor probes of the global coefficient vector.

◆ element_jacobian_action()

template<VolumeEquation EquationT, typename ContributionT, bool Fields = true, bool Geometry = true>
void serif::operators::backend::mfem::element_jacobian_action ( const ElementData< EquationPlan< EquationT >::operand_count > & data,
const ::mfem::DenseMatrix & geometry_derivatives,
const std::array< discretization::backend::mfem::DofMap::Elements, EquationPlan< EquationT >::column_count > & columns,
const std::array< const ::mfem::Vector *, EquationPlan< EquationT >::column_count > & directions,
const discretization::backend::mfem::DofMap::Elements & displacement_binding,
const ::mfem::Vector & displacement_direction,
Workspace & workspace,
::mfem::Vector & result )

Apply the accepted field derivatives and local displacement derivatives.

Note
Geometry derivatives are graph results, expressed against the fixed-mesh test basis. The two compile-time switches exclude structurally absent directions without sampling zero fields.

◆ element_jacobian_transpose()

template<VolumeEquation EquationT, typename ContributionT>
void serif::operators::backend::mfem::element_jacobian_transpose ( const ElementData< EquationPlan< EquationT >::operand_count > & data,
const ::mfem::DenseMatrix & geometry_derivatives,
const discretization::backend::mfem::DofMap::Elements & row,
const ::mfem::Vector & residual_dual,
Workspace & workspace,
std::array<::mfem::Vector, EquationPlan< EquationT >::column_count > & column_duals,
::mfem::Vector & displacement_dual )

Transpose the same accepted field and geometry contractions used by the forward action.

◆ element_residual()

template<typename ContributionT, std::size_t Count>
void serif::operators::backend::mfem::element_residual ( const ElementData< Count > & data,
::mfem::Vector & result,
BasisWorkspace & workspace )

Integrate the cached scalar/vector physics against its actual test operation.

◆ element_values()

elements serif::operators::backend::mfem::element_values ( basis. element,
input. values,
workspace. element_values )

◆ equation_rule()

template<VolumeEquation RowEquationT, typename ContributionT>
const ::mfem::IntegrationRule & serif::operators::backend::mfem::equation_rule ( const ContributionT & equation,
const discretization::quadrature::Policy & policy,
::mfem::ElementTransformation & transformation,
const ::mfem::FiniteElement & displacement_element,
discretization::quadrature::MappingKind mapping_kind = discretization::quadrature::MappingKind::general,
int reconstruction_order = 0 )
nodiscard

Resolve one rule covering all operand forms and the geometry weight.

◆ evaluate_contribution_equation()

template<VolumeEquation EquationT, typename ContributionT, typename... Operands>
std::expected< ContributionData< EquationPlan< EquationT >::operand_count >, PreparationRejection > serif::operators::backend::mfem::evaluate_contribution_equation ( const ContributionBinding< ContributionT > & contribution,
const ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > > & basis,
const ElementBatch< ElementGeometry< EquationPlan< EquationT >::operand_count > > & geometry,
Workspace & workspace,
const SamplesFor< Operands > &... samples )
nodiscard

Evaluate one equation contribution; its basis, mapping and individual operand samples are already prepared.

◆ evaluate_element_equation()

template<VolumeEquation EquationT, typename ContributionT>
std::expected< ElementData< EquationPlan< EquationT >::operand_count >, PreparationRejection > serif::operators::backend::mfem::evaluate_element_equation ( const ContributionT & equation,
double coefficient,
std::shared_ptr< const ElementBasis< EquationPlan< EquationT >::operand_count > > basis,
std::shared_ptr< const ElementGeometry< EquationPlan< EquationT >::operand_count > > geometry,
std::array< std::shared_ptr< const ::mfem::Vector >, EquationPlan< EquationT >::operand_count > reference_values,
const std::array< std::shared_ptr< const ::mfem::Vector >, EquationPlan< EquationT >::operand_count > & physical_values,
Workspace & workspace )
nodiscard

Evaluate and weight the equation while retaining its immutable preparation inputs.

◆ finish_element_action()

template<VolumeEquation EquationT, typename ContributionT, bool Fields, bool Geometry>
void serif::operators::backend::mfem::finish_element_action ( const ElementData< EquationPlan< EquationT >::operand_count > & data,
const ::mfem::DenseMatrix & geometry_derivatives,
Workspace & workspace,
::mfem::Vector & result )

Finish an element action from its field part (workspace.quadrature_values) and, with Geometry, the displacement samples (workspace.displacement_samples): contract the geometry derivatives and integrate.

◆ for_each_volume_element()

template<VolumeEquation EquationT, typename SchemaT, typename VisitT>
void serif::operators::backend::mfem::for_each_volume_element ( const VolumeData< EquationT, SchemaT > & data,
VisitT && visit )

Visit each contribution's own batch in equation order, without scanning other contributions.

◆ for_each_volume_linearization()

template<VolumeEquation EquationT, typename SchemaT, typename VisitT>
void serif::operators::backend::mfem::for_each_volume_linearization ( const VolumeData< EquationT, SchemaT > & data,
VisitT && visit )

Visit equation data together with its graph-owned local geometry derivative matrix.

◆ geometry_integrand_variation()

template<VolumeEquation Equation, typename Contribution>
auto serif::operators::backend::mfem::geometry_integrand_variation ( const ElementData< EquationPlan< Equation >::operand_count > & data,
int point,
const mapping::VolumeMappingContext & context,
const mapping::VolumeMappingVariation & variation )
nodiscard

Differentiate the weighted physics through position, operand mappings and the volume measure.

◆ integration_order()

template<VolumeEquation EquationT, typename SchemaT>
int serif::operators::backend::mfem::integration_order ( const VolumeData< EquationT, SchemaT > & data,
int element )
nodiscard

Return the largest contribution quadrature order on a supported mesh element.

◆ linearized_action() [1/2]

LinearizedBlock serif::operators::backend::mfem::linearized_action ( int rows,
int columns,
MatrixAction action,
MatrixAction transpose )
nodiscard

Wrap owned callbacks with checked dimensions, finite results, and overlap-safe application.

◆ linearized_action() [2/2]

LinearizedBlock serif::operators::backend::mfem::linearized_action ( int rows,
int columns,
MatrixAction action,
MatrixAction transpose,
MatrixArrayAction batch )
nodiscard

As above, with a batched forward action used by the operator's ArrayMult.

◆ linearized_block() [1/2]

LinearizedBlock serif::operators::backend::mfem::linearized_block ( std::shared_ptr< const ::mfem::DenseMatrix > matrix)
nodiscard

Retain a small assembled physical block, such as a generated scalar constraint.

◆ linearized_block() [2/2]

LinearizedBlock serif::operators::backend::mfem::linearized_block ( std::shared_ptr< const ::mfem::SparseMatrix > matrix)
nodiscard

Retain an already assembled physical block without copying its matrix.

◆ make_contribution_computations()

template<std::size_t Index, typename Scope, VolumeEquation EquationT, typename SchemaT, typename ContributionT, typename... Operands>
auto serif::operators::backend::mfem::make_contribution_computations ( const std::shared_ptr< const VolumeConfiguration< EquationT, SchemaT > > & configuration,
const std::shared_ptr< VolumeScratch > & scratch,
ContributionBinding< ContributionT > contribution,
utils::types::TypeList< Operands... >  )
nodiscard

Build one contribution's branch in the same order as its numerical description.

◆ make_operand_computations()

template<std::size_t Contribution, typename OperandT, VolumeEquation EquationT, typename SchemaT, typename Scope = void>
auto serif::operators::backend::mfem::make_operand_computations ( const std::shared_ptr< VolumeScratch > & scratch)
nodiscard

Declare one coefficient contraction, followed by a physical mapping when the space requires it.

◆ make_term_coefficients()

template<typename... BindingTs>
auto serif::operators::backend::mfem::make_term_coefficients ( BindingTs... bindings)
nodiscard

Associate each physical term with its bound coefficients in an ordinary dependency context.

◆ make_volume_binding_input() [1/2]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
auto serif::operators::backend::mfem::make_volume_binding_input ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const CoefficientsT & term_coefficients )
nodiscard

Share equation metadata with a model's common physical coefficient context.

◆ make_volume_binding_input() [2/2]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT, typename... Columns>
auto serif::operators::backend::mfem::make_volume_binding_input ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const CoefficientsT & term_coefficients,
utils::types::TypeList< Columns... >  )
nodiscard

Validate one equation's bindings without constructing duplicate coefficient resources.

◆ make_volume_equation_cache()

template<typename Scope = void, VolumeEquation EquationT, typename SchemaT, typename InputsT>
auto serif::operators::backend::mfem::make_volume_equation_cache ( EquationT equation,
const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const InputsT & inputs,
VolumeOptions options = {} )
nodiscard

Construct a standalone cache from the same computations used by a coupled deformation graph.

◆ make_volume_equation_computations() [1/2]

template<typename Scope = void, VolumeEquation EquationT, typename SchemaT>
auto serif::operators::backend::mfem::make_volume_equation_computations ( EquationT equation,
const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
VolumeOptions options = {} )
nodiscard

Own standalone equations while allowing complete models to share their existing immutable members.

◆ make_volume_equation_computations() [2/2]

template<typename Scope = void, VolumeEquation EquationT, typename SchemaT>
auto serif::operators::backend::mfem::make_volume_equation_computations ( std::shared_ptr< const EquationT > equation,
const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
VolumeOptions options = {} )
nodiscard

Declare reusable volume computations without selecting their source of displacement.

Note
This allocates scratch and owns the equation configuration; numerical work begins at try_prepare. Borrowed discretization objects must outlive the computations and their accepted results.

◆ make_volume_inputs() [1/6]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
void serif::operators::backend::mfem::make_volume_inputs ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & ,
const CoefficientsT & ,
::mfem::Vector &&  )
delete

◆ make_volume_inputs() [2/6]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
void serif::operators::backend::mfem::make_volume_inputs ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & ,
const CoefficientsT & ,
const ::mfem::Vector &&  )
delete

◆ make_volume_inputs() [3/6]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
auto serif::operators::backend::mfem::make_volume_inputs ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const CoefficientsT & term_coefficients )
nodiscard

Bind equation and reference inputs when displacement will be produced inside the dependency graph.

◆ make_volume_inputs() [4/6]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT>
auto serif::operators::backend::mfem::make_volume_inputs ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const CoefficientsT & term_coefficients,
const ::mfem::Vector & displacement_coefficients )
nodiscard

Build a checked source context without retaining the coefficient vectors.

◆ make_volume_inputs() [5/6]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT, typename... Columns>
auto serif::operators::backend::mfem::make_volume_inputs ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const CoefficientsT & term_coefficients,
const ::mfem::Vector & displacement_coefficients,
utils::types::TypeList< Columns... > columns )
nodiscard

Append a checked external displacement while preserving each original resource's tracking policy.

◆ make_volume_inputs() [6/6]

template<VolumeEquation EquationT, typename Scope = void, typename SchemaT, typename CoefficientsT, typename... Columns>
auto serif::operators::backend::mfem::make_volume_inputs ( const VolumeDiscretization< typename EquationT::Test, SchemaT > & discretization,
const CoefficientsT & term_coefficients,
utils::types::TypeList< Columns... > columns )
nodiscard

Supply precisely the consumed terms for a standalone equation.

◆ map_contribution_geometry()

template<VolumeEquation EquationT, typename SchemaT, typename ContributionT>
std::expected< ElementBatch< ElementGeometry< EquationPlan< EquationT >::operand_count > >, PreparationRejection > serif::operators::backend::mfem::map_contribution_geometry ( const VolumeConfiguration< EquationT, SchemaT > & configuration,
const ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > > & basis,
const CoefficientView< typename VolumeConfiguration< EquationT, SchemaT >::DisplacementBinding > & displacement,
const MappingCoefficients & compactification,
Workspace & workspace )
nodiscard

Freeze mapping data and mapped bases independently of the equation's coefficient inputs.

◆ map_contribution_operand()

template<typename OperandT, std::size_t OperandCount>
OperandSamples serif::operators::backend::mfem::map_contribution_operand ( const OperandSamples & samples,
const ElementBatch< ElementGeometry< OperandCount > > & geometry,
Workspace & workspace )
nodiscard

Map only operands whose physical representation depends on deformation.

◆ map_element_geometry()

template<VolumeEquation EquationT, typename ContributionT>
std::expected< ElementGeometry< EquationPlan< EquationT >::operand_count >, PreparationRejection > serif::operators::backend::mfem::map_element_geometry ( const ElementBasis< EquationPlan< EquationT >::operand_count > & basis,
const discretization::backend::mfem::DofMap & displacement_binding,
const discretization::backend::mfem::DofMap::Elements & displacement_elements,
const ::mfem::Vector & displacement,
const MappingCoefficients & compactification,
const mapping::DomainMapper & mapper,
Workspace & workspace )
nodiscard

Freeze displacement and compactification, then map quadrature points and bases to physical space.

◆ map_element_operand()

template<EvaluableOperand OperandT, std::size_t Count>
::mfem::Vector serif::operators::backend::mfem::map_element_operand ( const ::mfem::Vector & reference,
const ElementGeometry< Count > & geometry,
Workspace & workspace )
nodiscard

Apply an operand's physical transformation to its cached fixed-mesh samples.

◆ prepare_volume()

template<typename Scope = void, typename CacheT, typename DiscretizationT, typename CoefficientsT>
void serif::operators::backend::mfem::prepare_volume ( CacheT & cache,
const DiscretizationT & discretization,
const CoefficientsT & term_coefficients,
const ::mfem::Vector & displacement_coefficients,
PreparationMode mode = PreparationMode::reuse_unchanged )

Throw a caller-visible numerical error when a complete preparation cannot be accepted.

◆ replace_block_rows()

LinearizedBlock serif::operators::backend::mfem::replace_block_rows ( LinearizedBlock original,
std::vector< int > selected_rows,
std::shared_ptr< const ::mfem::SparseMatrix > replacement )
nodiscard

Replace selected physical equation rows with an immutable sparse row block in the same unknown coordinates.

Note
Replacement row i belongs to selected_rows[i]. Efficient diagonal and sparse assembly remain available when the original block supplies them; no columns are probed. Both matrices must remain immutable after publication.

◆ report_contribution_preparation()

template<VolumeEquation EquationT, std::size_t Index, typename Scope = void, typename CacheT>
void serif::operators::backend::mfem::report_contribution_preparation ( const CacheT & cache,
NumericalWork & report )

Convert the dependency engine's node statuses to numerical work counts for one contribution.

◆ sample_contribution_basis()

template<VolumeEquation EquationT, typename SchemaT, typename ContributionT>
std::expected< ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > >, PreparationRejection > serif::operators::backend::mfem::sample_contribution_basis ( const VolumeConfiguration< EquationT, SchemaT > & configuration,
const ContributionBinding< ContributionT > & contribution,
const BasisBindings< EquationPlan< EquationT >::column_count > & bindings,
TensorBasisCache & cache )
nodiscard

Sample the reference discretization once for each supported element of this contribution.

◆ sample_contribution_operand()

template<VolumeEquation EquationT, typename OperandT, typename BindingT>
OperandSamples serif::operators::backend::mfem::sample_contribution_operand ( const ElementBatch< ElementBasis< EquationPlan< EquationT >::operand_count > > & basis,
const CoefficientView< BindingT > & input,
Workspace & workspace )
nodiscard

Only this operand's coefficients and reference basis determine its reference samples.

◆ sample_element_basis()

template<VolumeEquation EquationT, typename ContributionT>
std::expected< ElementBasis< EquationPlan< EquationT >::operand_count >, PreparationRejection > serif::operators::backend::mfem::sample_element_basis ( const ContributionT & equation,
int element,
const discretization::backend::mfem::DofMap & row,
const discretization::backend::mfem::DofMap & displacement_binding,
const std::array< const discretization::backend::mfem::DofMap *, EquationPlan< EquationT >::column_count > & columns,
const mapping::DomainMapper & mapper,
const discretization::quadrature::Policy & policy,
TensorBasisCache & basis_cache,
ContractionMode contraction_mode )
nodiscard

Sample the contribution's quadrature rule and bases on the fixed computational mesh.

◆ store_element_linearization()

template<VolumeEquation EquationT, typename ContributionT>
bool serif::operators::backend::mfem::store_element_linearization ( const equations::PointLinearization< typename ContributionT::Operands, typename OperandEvaluator< equations::TestOperandOf< ContributionT > >::Value > & physics,
int point,
double weight,
ElementData< EquationPlan< EquationT >::operand_count > & data )
nodiscard

Weight a point's residual and derivatives; reject any non-finite stored component.

◆ sum_blocks()

LinearizedBlock serif::operators::backend::mfem::sum_blocks ( int rows,
int columns,
std::vector< LinearizedBlock > blocks )
nodiscard

Sum compatible linearized blocks while retaining their native diagonal and sparse assembly operations.

◆ tensor_element_count()

template<VolumeEquation EquationT, typename SchemaT>
std::size_t serif::operators::backend::mfem::tensor_element_count ( const VolumeData< EquationT, SchemaT > & data)
nodiscard

Count contribution-elements using tensor contractions for any sampled basis.

◆ transpose_block()

LinearizedBlock serif::operators::backend::mfem::transpose_block ( LinearizedBlock block)
nodiscard

Transpose a linearized block without discarding efficient assembly and diagonal operations.

◆ try_prepare_validated()

template<typename CacheT, typename PrepareT>
std::expected< void, PreparationRejection > serif::operators::backend::mfem::try_prepare_validated ( CacheT & cache,
PrepareT && prepare )
nodiscard

A failed validation or calculation must make the previous accepted result inaccessible.

Make previous results unavailable whenever preparation exits unsuccessfully.

◆ try_prepare_volume()

template<typename Scope = void, typename CacheT, typename DiscretizationT, typename CoefficientsT>
std::expected< void, PreparationRejection > serif::operators::backend::mfem::try_prepare_volume ( CacheT & cache,
const DiscretizationT & discretization,
const CoefficientsT & term_coefficients,
const ::mfem::Vector & displacement_coefficients,
PreparationMode mode = PreparationMode::reuse_unchanged )
nodiscard

Validate current inputs and atomically publish a complete volume linearization.

◆ validate_volume_data()

template<VolumeEquation EquationT, typename SchemaT>
void serif::operators::backend::mfem::validate_volume_data ( const VolumeData< EquationT, SchemaT > & data)

Reject changes to discretization objects borrowed by an accepted linearization.

◆ validate_volume_discretization()

template<typename TestT, typename SchemaT>
void serif::operators::backend::mfem::validate_volume_discretization ( const VolumeDiscretization< TestT, SchemaT > & discretization)

Check borrowed mesh objects before sampling or applying accepted results.

◆ volume_field_block()

template<typename Field, VolumeEquation Equation, typename Schema>
LinearizedBlock serif::operators::backend::mfem::volume_field_block ( std::shared_ptr< const VolumeData< Equation, Schema > > data)
nodiscard

Expose efficient physical block operations from an owning accepted dependency result.

◆ volume_field_diagonal()

template<typename Field, VolumeEquation Equation, typename Schema>
std::vector< double > serif::operators::backend::mfem::volume_field_diagonal ( const VolumeData< Equation, Schema > & data)
nodiscard

Extract exact physical diagonals, retaining constraint cross terms when hanging nodes are present.

◆ volume_height()

template<VolumeEquation EquationT, typename SchemaT>
int serif::operators::backend::mfem::volume_height ( const VolumeData< EquationT, SchemaT > & data)
nodiscard

Return the supported residual size.

◆ volume_residual()

template<VolumeEquation EquationT, typename SchemaT>
void serif::operators::backend::mfem::volume_residual ( const VolumeData< EquationT, SchemaT > & data,
::mfem::Vector & result )

Copy the residual already assembled and checked when this result was accepted.

◆ volume_width()

template<VolumeEquation EquationT, typename SchemaT>
int serif::operators::backend::mfem::volume_width ( const VolumeData< EquationT, SchemaT > & data)
nodiscard

Packed directions contain unique coefficient terms followed by displacement.

◆ volume_work_report()

template<typename Scope = void, typename CacheT>
NumericalWork serif::operators::backend::mfem::volume_work_report ( const CacheT & cache)
nodiscard

Derive work counts from accepted node statuses; no second report lifecycle is stored.

◆ VolumeDiscretization()

template<typename TestT, typename SchemaT>
serif::operators::backend::mfem::VolumeDiscretization ( const discretization::backend::mfem::TermBinding< TestT, SchemaT > & ,
const discretization::backend::mfem::TermBinding< discretization::blocks::displacement::vector, SchemaT > & ,
const ::mfem::GridFunction & ,
const mapping::DomainMapper &  ) -> VolumeDiscretization< TestT, SchemaT >

Variable Documentation

◆ index

template<VolumeEquation EquationT, EvaluableOperand OperandT, typename BindingT>
std::size_t serif::operators::backend::mfem::index = equations::OperandValues<typename Plan::Operands>::template index<OperandT>()
nodiscardconstexpr

Contract one operand's fixed-mesh basis with its current coefficients.

◆ values

return serif::operators::backend::mfem::values