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

Namespaces

namespace  detail
 
namespace  volume_displacement_keys
 

Classes

class  ConstrainedRadialExtension
 Keep radial displacement continuous across hanging faces in local component-block coordinates. More...
 
struct  DeformationValueTracking
 Equal physical values remain reusable when a context is reconstructed. More...
 
struct  GeometrySampleRule
 Borrow one sampling rule; repeat an element to retain the actual union of downstream rules. More...
 
struct  ReferenceDiscretization
 Borrow the paired reference meshes; attributes retain their physical domain meaning. More...
 
struct  ReferenceDiscretizationTracking
 Logical interpolation depends on paired topology and logical coordinates, not physical coordinates. More...
 
struct  ShapeCoefficientTracking
 Capture the values behind a shape view, independently of its temporary wrapper. More...
 
struct  SurfaceDiscretization
 The surface selection needs only its scalar space and boundary label. More...
 
struct  SurfaceDiscretizationTracking
 Track topology and labels once, independently of changes to physical coordinates. More...
 

Functions

auto make_surface_metric_computation ()
 Optionally supply the reference surface mass diagonal in native shape coordinates.
 
template<typename Surface>
requires requires(const Surface& model, std::span<const std::array<double, 3>> positions) { { build_surface_embedding(model, positions) } -> std::same_as<std::expected<SurfaceEmbedding, DeformationFailure>>; }
auto make_deformation_computations ()
 Compile fixed reference factors and evaluate shape motion with one dependency engine.
 
template<typename Surface>
auto make_deformation_graph ()
 Provide a standalone graph while leaving the same computations available for equation composition.
 
std::expected< ConstrainedRadialExtension, DeformationFailure > make_constrained_radial_extension (std::shared_ptr< const RadialInterpolation > interpolation, const ::mfem::FiniteElementSpace &displacement_space, PowerLawRadialExtension interior={}, FixedInfinityRadialExtension vacuum={})
 Compile the original radial extension and the matching serial component-block constraints.
 
template<typename Function>
void for_each_displacement_coefficient (const discretization::backend::mfem::DofMap &binding, Function &&visit)
 Visit the same displacement coordinate mapping for values and their derivatives.
 
std::expected< GeometryStepLimit, DeformationFailure > estimate_geometry_step_limit (const mapping::DomainMapper &mapper, const ::mfem::FiniteElementSpace &displacement_space, const ::mfem::GridFunction &compactification_coordinate, const ::mfem::Vector &accepted_displacement, const ::mfem::Vector &displacement_direction, std::span< const GeometrySampleRule > sample_rules, GeometryStepOptions options={})
 Find the first sampled mapping boundary along accepted + step direction.
 
template<discretization::domain::schema::IsSchema Schema = discretization::domain::schema::CoreEnvelopeVacuumDomainSchema>
requires (Schema::template contains_domain<discretization::domain::StellarDomains>() && Schema::template contains_domain<discretization::domain::VacuumDomain>() && Schema::template contains_boundary<discretization::domain::StellarSurfaceBoundary>() && Schema::template contains_boundary<discretization::domain::InfinitySurfaceBoundary>())
ReferenceDiscretization deformation_discretization (const ::mfem::FiniteElementSpace &scalar_space, const ::mfem::FiniteElementSpace &displacement_space, ::mfem::Mesh &logical_mesh)
 Resolve physical domain names through the schema rather than hard-coded MFEM attributes.
 
template<typename Surface, typename Interior, typename Vacuum>
auto make_deformation_inputs (const DomainDeformation< Surface, Interior, Vacuum > &model, const ReferenceDiscretization &discretization, const std::vector< double > &coefficients)
 Bind physical choices and a borrowed shape vector without evaluating deformation.
 
template<typename Surface, typename Interior, typename Vacuum>
auto make_deformation_inputs (const DomainDeformation< Surface, Interior, Vacuum > &model, const ReferenceDiscretization &discretization, std::span< const double > coefficients)
 Bind shape coordinates directly from a packed numerical state.
 
template<typename Surface, typename Interior, typename Vacuum, std::ranges::range Coefficients>
requires (!std::ranges::borrowed_range<Coefficients>)
void make_deformation_inputs (const DomainDeformation< Surface, Interior, Vacuum > &, const ReferenceDiscretization &, Coefficients &&)=delete
 Reject temporary owning containers whose coefficient storage would expire.
 
std::expected< RadialInterpolation, DeformationFailure > build_radial_interpolation (const ::mfem::FiniteElementSpace &scalar_space, const ::mfem::FiniteElementSpace &vector_space, ::mfem::Mesh &logical_mesh, std::span< const int > stellar_element_support, std::span< const int > vacuum_element_support, int surface_attribute, int infinity_attribute)
 Compile logical-ray interpolation on paired physical and logical meshes. Supports are zero/one element masks. The logical radius is the maximum absolute Cartesian coordinate, preserving the STROID reference foliation after physical distortion. Serial nodal spaces may have hanging nodes away from the conforming stellar surface. The table samples local coefficients; the backend extension enforces their constraints.
 
DeformationStatus validate_scalar_reference_space (const ::mfem::FiniteElementSpace &scalar_space)
 Reject spaces whose coefficients cannot be interpreted as serial nodal positions.
 
DeformationStatus validate_companion_numbering (const ::mfem::FiniteElementSpace &reference_space, const ::mfem::FiniteElementSpace &companion_space)
 Require identical scalar coefficient meanings in two companion spaces. Vector component ordering may differ; element bases and their scalar-node indices must agree.
 
std::expected< std::vector< std::array< double, 3 > >, DeformationFailure > sample_reference_positions (const ::mfem::FiniteElementSpace &scalar_space, ::mfem::Mesh &reference_mesh)
 Sample a paired mesh at the scalar companion nodes, checking shared-node agreement.
 
std::expected< std::vector< int >, DeformationFailure > select_surface_scalar_dofs (const ::mfem::FiniteElementSpace &scalar_space, int surface_attribute)
 Select canonical surface nodes without retaining a mesh or finite-element-space pointer.
 
std::expected< ReferenceSurface, DeformationFailure > sample_reference_surface (const ::mfem::FiniteElementSpace &scalar_space, int surface_attribute)
 Sample physical reference positions in ascending scalar-DOF order.
 
DeformationStatus validate_surface_trace (const ::mfem::FiniteElementSpace &scalar_space, int surface_attribute, const ReferenceSurface &reference_surface, const SurfaceEmbedding &embedding)
 Require the same ordered reference nodes and physical positions as a compiled surface embedding.
 
std::expected< std::vector< double >, DeformationFailure > surface_parameter_mass_diagonal (const ::mfem::FiniteElementSpace &scalar_space, int surface_attribute, const ReferenceSurface &reference_surface, const SurfaceEmbedding &embedding)
 Measure each shape parameter with the reference boundary mass norm of its Cartesian finite-element trace.
 
template<typename MetadataKey = operators::backend::mfem::MeshAndCoefficientBindings, discretization::domain::schema::IsSchema Schema>
auto make_volume_displacement_computations (const discretization::backend::mfem::TermBinding< discretization::blocks::displacement::vector, Schema > &binding)
 Connect a full component-block deformation vector to an equation's displacement binding.
 
template<typename MetadataKey = operators::backend::mfem::MeshAndCoefficientBindings, discretization::domain::schema::IsSchema Schema>
void make_volume_displacement_computations (const discretization::backend::mfem::TermBinding< discretization::blocks::displacement::vector, Schema > &&)=delete
 A graph cannot retain a displacement binding supplied as a temporary.
 

Function Documentation

◆ build_radial_interpolation()

std::expected< RadialInterpolation, DeformationFailure > serif::geometry::deformation::backend::mfem::build_radial_interpolation ( const ::mfem::FiniteElementSpace & scalar_space,
const ::mfem::FiniteElementSpace & vector_space,
::mfem::Mesh & logical_mesh,
std::span< const int > stellar_element_support,
std::span< const int > vacuum_element_support,
int surface_attribute,
int infinity_attribute )
nodiscard

Compile logical-ray interpolation on paired physical and logical meshes. Supports are zero/one element masks. The logical radius is the maximum absolute Cartesian coordinate, preserving the STROID reference foliation after physical distortion. Serial nodal spaces may have hanging nodes away from the conforming stellar surface. The table samples local coefficients; the backend extension enforces their constraints.

◆ deformation_discretization()

template<discretization::domain::schema::IsSchema Schema = discretization::domain::schema::CoreEnvelopeVacuumDomainSchema>
requires (Schema::template contains_domain<discretization::domain::StellarDomains>() && Schema::template contains_domain<discretization::domain::VacuumDomain>() && Schema::template contains_boundary<discretization::domain::StellarSurfaceBoundary>() && Schema::template contains_boundary<discretization::domain::InfinitySurfaceBoundary>())
ReferenceDiscretization serif::geometry::deformation::backend::mfem::deformation_discretization ( const ::mfem::FiniteElementSpace & scalar_space,
const ::mfem::FiniteElementSpace & displacement_space,
::mfem::Mesh & logical_mesh )
nodiscard

Resolve physical domain names through the schema rather than hard-coded MFEM attributes.

◆ estimate_geometry_step_limit()

std::expected< GeometryStepLimit, DeformationFailure > serif::geometry::deformation::backend::mfem::estimate_geometry_step_limit ( const mapping::DomainMapper & mapper,
const ::mfem::FiniteElementSpace & displacement_space,
const ::mfem::GridFunction & compactification_coordinate,
const ::mfem::Vector & accepted_displacement,
const ::mfem::Vector & displacement_direction,
std::span< const GeometrySampleRule > sample_rules,
GeometryStepOptions options = {} )
nodiscard

Find the first sampled mapping boundary along accepted + step direction.

Inputs use the displacement space's true-DOF ordering. The compactification coordinate is fixed throughout this straight volume-displacement path. An exterior map must be affine in displacement. The result covers exactly the supplied rules, including repeats: quadrature rules need not be nested. Only serial spaces are supported. Parallel spaces are rejected before any mapping is evaluated.

◆ for_each_displacement_coefficient()

template<typename Function>
void serif::geometry::deformation::backend::mfem::for_each_displacement_coefficient ( const discretization::backend::mfem::DofMap & binding,
Function && visit )

Visit the same displacement coordinate mapping for values and their derivatives.

Deformation maps use full component blocks, whereas equation bindings use supported DOFs in their MFEM space's ordering. Each supported coefficient has one source in the full deformation vector. Visiting these pairs also defines the exact transpose and the sparse projection without reproducing ordering or support logic.

Parameters
bindingA current, validated displacement binding.
visitReceives the supported row and full component-block column.

◆ make_constrained_radial_extension()

std::expected< ConstrainedRadialExtension, DeformationFailure > serif::geometry::deformation::backend::mfem::make_constrained_radial_extension ( std::shared_ptr< const RadialInterpolation > interpolation,
const ::mfem::FiniteElementSpace & displacement_space,
PowerLawRadialExtension interior = {},
FixedInfinityRadialExtension vacuum = {} )
inlinenodiscard

Compile the original radial extension and the matching serial component-block constraints.

◆ make_deformation_computations()

template<typename Surface>
requires requires(const Surface& model, std::span<const std::array<double, 3>> positions) { { build_surface_embedding(model, positions) } -> std::same_as<std::expected<SurfaceEmbedding, DeformationFailure>>; }
auto serif::geometry::deformation::backend::mfem::make_deformation_computations ( )
nodiscard

Compile fixed reference factors and evaluate shape motion with one dependency engine.

Note
Configuration values are named context inputs. Factories declare work; try_prepare performs it explicitly.

◆ make_deformation_graph()

template<typename Surface>
auto serif::geometry::deformation::backend::mfem::make_deformation_graph ( )
nodiscard

Provide a standalone graph while leaving the same computations available for equation composition.

◆ make_deformation_inputs() [1/3]

template<typename Surface, typename Interior, typename Vacuum, std::ranges::range Coefficients>
requires (!std::ranges::borrowed_range<Coefficients>)
void serif::geometry::deformation::backend::mfem::make_deformation_inputs ( const DomainDeformation< Surface, Interior, Vacuum > & ,
const ReferenceDiscretization & ,
Coefficients &&  )
delete

Reject temporary owning containers whose coefficient storage would expire.

◆ make_deformation_inputs() [2/3]

template<typename Surface, typename Interior, typename Vacuum>
auto serif::geometry::deformation::backend::mfem::make_deformation_inputs ( const DomainDeformation< Surface, Interior, Vacuum > & model,
const ReferenceDiscretization & discretization,
const std::vector< double > & coefficients )
nodiscard

Bind physical choices and a borrowed shape vector without evaluating deformation.

Note
Meshes, spaces, and the vector must outlive the context. Borrowing the container retains its current storage and size even if the caller subsequently resizes it. Coordinate edits must notify MFEM through its normal node-update API.

◆ make_deformation_inputs() [3/3]

template<typename Surface, typename Interior, typename Vacuum>
auto serif::geometry::deformation::backend::mfem::make_deformation_inputs ( const DomainDeformation< Surface, Interior, Vacuum > & model,
const ReferenceDiscretization & discretization,
std::span< const double > coefficients )
nodiscard

Bind shape coordinates directly from a packed numerical state.

Note
The context owns the view, not its storage. The underlying coefficients must remain alive at a stable address while the context is used. Published linearizations own their coefficient values and remain valid after subsequent state changes.

◆ make_surface_metric_computation()

auto serif::geometry::deformation::backend::mfem::make_surface_metric_computation ( )
inlinenodiscard

Optionally supply the reference surface mass diagonal in native shape coordinates.

Note
This reference metric is independent of shape coefficients and the volume extension; requesting it must not compile either.

◆ make_volume_displacement_computations() [1/2]

template<typename MetadataKey = operators::backend::mfem::MeshAndCoefficientBindings, discretization::domain::schema::IsSchema Schema>
void serif::geometry::deformation::backend::mfem::make_volume_displacement_computations ( const discretization::backend::mfem::TermBinding< discretization::blocks::displacement::vector, Schema > && )
delete

A graph cannot retain a displacement binding supplied as a temporary.

◆ make_volume_displacement_computations() [2/2]

template<typename MetadataKey = operators::backend::mfem::MeshAndCoefficientBindings, discretization::domain::schema::IsSchema Schema>
auto serif::geometry::deformation::backend::mfem::make_volume_displacement_computations ( const discretization::backend::mfem::TermBinding< discretization::blocks::displacement::vector, Schema > & binding)
nodiscard

Connect a full component-block deformation vector to an equation's displacement binding.

Reference-dependent validation proves the two spaces assign the same meaning to each scalar coefficient. Subsequent computations own coefficients in the binding's global ordering and supported-DOF numbering, then return the existing CoefficientView into that immutable prerequisite. Cache result ownership keeps the vector's address stable throughout downstream evaluation and accepted-result reuse. MetadataKey selects an equation-scoped binding source when several equations share the graph. The binding itself is borrowed and must outlive this graph and its results, as for volume equations.

◆ sample_reference_positions()

std::expected< std::vector< std::array< double, 3 > >, DeformationFailure > serif::geometry::deformation::backend::mfem::sample_reference_positions ( const ::mfem::FiniteElementSpace & scalar_space,
::mfem::Mesh & reference_mesh )
nodiscard

Sample a paired mesh at the scalar companion nodes, checking shared-node agreement.

◆ sample_reference_surface()

std::expected< ReferenceSurface, DeformationFailure > serif::geometry::deformation::backend::mfem::sample_reference_surface ( const ::mfem::FiniteElementSpace & scalar_space,
int surface_attribute )
nodiscard

Sample physical reference positions in ascending scalar-DOF order.

◆ select_surface_scalar_dofs()

std::expected< std::vector< int >, DeformationFailure > serif::geometry::deformation::backend::mfem::select_surface_scalar_dofs ( const ::mfem::FiniteElementSpace & scalar_space,
int surface_attribute )
nodiscard

Select canonical surface nodes without retaining a mesh or finite-element-space pointer.

◆ surface_parameter_mass_diagonal()

std::expected< std::vector< double >, DeformationFailure > serif::geometry::deformation::backend::mfem::surface_parameter_mass_diagonal ( const ::mfem::FiniteElementSpace & scalar_space,
int surface_attribute,
const ReferenceSurface & reference_surface,
const SurfaceEmbedding & embedding )
nodiscard

Measure each shape parameter with the reference boundary mass norm of its Cartesian finite-element trace.

Note
This is diag(S^T (M_boundary tensor I) S), independent of the interior/vacuum extension and of the current shape coefficients. It uses the mass integrator's standard quadrature and does not orthogonalize harmonic coordinates.

◆ validate_companion_numbering()

DeformationStatus serif::geometry::deformation::backend::mfem::validate_companion_numbering ( const ::mfem::FiniteElementSpace & reference_space,
const ::mfem::FiniteElementSpace & companion_space )
nodiscard

Require identical scalar coefficient meanings in two companion spaces. Vector component ordering may differ; element bases and their scalar-node indices must agree.

◆ validate_scalar_reference_space()

DeformationStatus serif::geometry::deformation::backend::mfem::validate_scalar_reference_space ( const ::mfem::FiniteElementSpace & scalar_space)
nodiscard

Reject spaces whose coefficients cannot be interpreted as serial nodal positions.

◆ validate_surface_trace()

DeformationStatus serif::geometry::deformation::backend::mfem::validate_surface_trace ( const ::mfem::FiniteElementSpace & scalar_space,
int surface_attribute,
const ReferenceSurface & reference_surface,
const SurfaceEmbedding & embedding )
nodiscard

Require the same ordered reference nodes and physical positions as a compiled surface embedding.