SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers > Class Template Referencefinal

Evaluate explicit stellar candidates using one reusable dependency cache. More...

#include <equilibrium_evaluator.hpp>

Collaboration diagram for serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >:
[legend]

Public Types

using Plan = typename Bound::Plan
 
using Layout = typename Plan::Layout
 
using SurfaceFormulation = typename Plan::Surface::Formulation
 
using Cache = utils::dependencies::ComputationCache<Graph, Inputs, EquilibriumFailure, Observers>
 
using Result = std::remove_cvref_t<decltype(std::declval<const Cache&>().template get<ResultKey>())>
 
using Evaluation = std::expected<Result, typename Cache::Failure>
 
template<typename RequestedKey>
using EvaluationFor = std::expected<std::remove_cvref_t<decltype(std::declval<const Cache&>().template get<RequestedKey>())>, typename Cache::Failure>
 

Public Member Functions

 EquilibriumEvaluator (std::shared_ptr< const Bound > bound, Graph graph, Layout layout, AdditionalInputs additional, Observers observers=Observers{})
 Retain the physical and finite-element owners before constructing the reusable cache.
 
const Layout & layout () const noexcept
 Inspect the independently ordered physical unknown and residual coordinates.
 
const Cache & cache () const noexcept
 Inspect the latest evaluation's work report and requested graph services.
 
const auto & model () const noexcept
 Inspect the immutable physical definition used by every evaluation.
 
const Bound & binding () const noexcept
 Inspect the owned physical and FE bindings for solver geometry and numerical policies.
 
template<typename... InputsT>
requires requires(EquilibriumEvaluator& evaluator, const InputsT&... inputs) { evaluator.template evaluate_result<ResultKey>(inputs...); }
Evaluation evaluate (const InputsT &... inputs)
 Evaluate a candidate without preparing its inverse.
 
template<typename... InputsT>
requires utils::dependencies::ContainsKey<preconditioning::PreparedSystem, typename Graph::Results> && requires(EquilibriumEvaluator& evaluator, const InputsT&... inputs) { evaluator.template evaluate_result<preconditioning::PreparedSystem>(inputs...); }
auto prepare_linear_system (const InputsT &... inputs) -> decltype(evaluate_result< preconditioning::PreparedSystem >(inputs...))
 Prepare an owning Jacobian and matching inverse only when a linear correction is needed.
 

Private Member Functions

template<typename RequestedKey, typename Coefficients, typename Geometry>
requires (detail::coefficient_inputs<Coefficients>(typename Plan::Coefficients{}))
auto evaluate_result (const Coefficients &coefficients, const Geometry &geometry, utils::dependencies::PreparationMode mode=utils::dependencies::PreparationMode::reuse_unchanged) -> EvaluationFor< RequestedKey >
 Evaluate explicitly bound fields and geometry, allowing arbitrary caller-owned storage.
 
template<typename RequestedKey, utils::dependencies::IsDependencyContext Prescribed = utils::dependencies::DependencyContext<>>
requires Plan::has_shape
&&detail::PrescribedInputsFor< Plan, Prescribed > auto evaluate_result (const StellarState< Layout > &state, const Prescribed &prescribed=Prescribed{}, utils::dependencies::PreparationMode mode=utils::dependencies::PreparationMode::reuse_unchanged) -> EvaluationFor< RequestedKey >
 Evaluate a moving star directly from its physical fields and shape in one owning state.
 
template<typename RequestedKey, utils::dependencies::IsDependencyContext Prescribed = utils::dependencies::DependencyContext<>>
requires (!Plan::has_shape) && detail::PrescribedInputsFor<Plan, Prescribed>
auto evaluate_result (const StellarState< Layout > &state, const ::mfem::Vector &displacement, const Prescribed &prescribed=Prescribed{}, utils::dependencies::PreparationMode mode=utils::dependencies::PreparationMode::reuse_unchanged) -> EvaluationFor< RequestedKey >
 Evaluate a fixed-geometry star; prescribed displacement is independent of its solved fields.
 
void validate_state (const StellarState< Layout > &state)
 Reject a same-type state with incompatible coordinate sizes before constructing backend views.
 

Private Attributes

std::shared_ptr< const Bound > m_bound
 
Cache m_cache
 
Layout m_layout
 
AdditionalInputs m_additional
 

Detailed Description

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
class serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >

Evaluate explicit stellar candidates using one reusable dependency cache.

Note
Successful evaluation returns an owning frozen result; it does not accept a solver step. Retain that handle while evaluating other candidates. Numerical rejection makes the current cache unavailable without changing previously returned results. This object never owns the caller's state.

Member Typedef Documentation

◆ Cache

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::Cache = utils::dependencies::ComputationCache<Graph, Inputs, EquilibriumFailure, Observers>

◆ Evaluation

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::Evaluation = std::expected<Result, typename Cache::Failure>

◆ EvaluationFor

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
template<typename RequestedKey>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::EvaluationFor = std::expected<std::remove_cvref_t<decltype(std::declval<const Cache&>().template get<RequestedKey>())>, typename Cache::Failure>

◆ Layout

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::Layout = typename Plan::Layout

◆ Plan

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::Plan = typename Bound::Plan

◆ Result

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::Result = std::remove_cvref_t<decltype(std::declval<const Cache&>().template get<ResultKey>())>

◆ SurfaceFormulation

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
using serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::SurfaceFormulation = typename Plan::Surface::Formulation

Constructor & Destructor Documentation

◆ EquilibriumEvaluator()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::EquilibriumEvaluator ( std::shared_ptr< const Bound > bound,
Graph graph,
Layout layout,
AdditionalInputs additional,
Observers observers = Observers{} )
inline

Retain the physical and finite-element owners before constructing the reusable cache.

Member Function Documentation

◆ binding()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
const Bound & serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::binding ( ) const
inlinenodiscardnoexcept

Inspect the owned physical and FE bindings for solver geometry and numerical policies.

◆ cache()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
const Cache & serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::cache ( ) const
inlinenodiscardnoexcept

Inspect the latest evaluation's work report and requested graph services.

◆ evaluate()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
template<typename... InputsT>
requires requires(EquilibriumEvaluator& evaluator, const InputsT&... inputs) { evaluator.template evaluate_result<ResultKey>(inputs...); }
Evaluation serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::evaluate ( const InputsT &... inputs)
inlinenodiscard

Evaluate a candidate without preparing its inverse.

Parameters
inputsAn owning state (and prescribed inputs), or explicit coefficient and geometry views. Fixed-geometry states also take the prescribed displacement. A final PreparationMode is optional. Selected evaluation services are prepared in the same transaction; linear-only services remain unrequested.

◆ evaluate_result() [1/3]

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
template<typename RequestedKey, typename Coefficients, typename Geometry>
requires (detail::coefficient_inputs<Coefficients>(typename Plan::Coefficients{}))
auto serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::evaluate_result ( const Coefficients & coefficients,
const Geometry & geometry,
utils::dependencies::PreparationMode mode = utils::dependencies::PreparationMode::reuse_unchanged ) -> EvaluationFor<RequestedKey>
inlinenodiscardprivate

Evaluate explicitly bound fields and geometry, allowing arbitrary caller-owned storage.

Note
Nonfinite coefficients are numerical rejections. Incorrect bindings and sizes are caller errors. Either failure invalidates current cache access before returning or reporting the error.

◆ evaluate_result() [2/3]

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
template<typename RequestedKey, utils::dependencies::IsDependencyContext Prescribed = utils::dependencies::DependencyContext<>>
requires (!Plan::has_shape) && detail::PrescribedInputsFor<Plan, Prescribed>
auto serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::evaluate_result ( const StellarState< Layout > & state,
const ::mfem::Vector & displacement,
const Prescribed & prescribed = Prescribed{},
utils::dependencies::PreparationMode mode = utils::dependencies::PreparationMode::reuse_unchanged ) -> EvaluationFor<RequestedKey>
inlinenodiscardprivate

Evaluate a fixed-geometry star; prescribed displacement is independent of its solved fields.

◆ evaluate_result() [3/3]

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
template<typename RequestedKey, utils::dependencies::IsDependencyContext Prescribed = utils::dependencies::DependencyContext<>>
requires Plan::has_shape
&&detail::PrescribedInputsFor< Plan, Prescribed > auto serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::evaluate_result ( const StellarState< Layout > & state,
const Prescribed & prescribed = Prescribed{},
utils::dependencies::PreparationMode mode = utils::dependencies::PreparationMode::reuse_unchanged ) -> EvaluationFor<RequestedKey>
inlinenodiscardprivate

Evaluate a moving star directly from its physical fields and shape in one owning state.

◆ layout()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
const Layout & serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::layout ( ) const
inlinenodiscardnoexcept

Inspect the independently ordered physical unknown and residual coordinates.

◆ model()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
const auto & serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::model ( ) const
inlinenodiscardnoexcept

Inspect the immutable physical definition used by every evaluation.

◆ prepare_linear_system()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
template<typename... InputsT>
requires utils::dependencies::ContainsKey<preconditioning::PreparedSystem, typename Graph::Results> && requires(EquilibriumEvaluator& evaluator, const InputsT&... inputs) { evaluator.template evaluate_result<preconditioning::PreparedSystem>(inputs...); }
auto serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::prepare_linear_system ( const InputsT &... inputs) -> decltype(evaluate_result<preconditioning::PreparedSystem>(inputs...))
inlinenodiscard

Prepare an owning Jacobian and matching inverse only when a linear correction is needed.

Parameters
inputsThe same candidate and optional preparation arguments accepted by evaluate().
Note
A numerical inverse failure preserves every previously returned preparation.

◆ validate_state()

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
void serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::validate_state ( const StellarState< Layout > & state)
inlineprivate

Reject a same-type state with incompatible coordinate sizes before constructing backend views.

Member Data Documentation

◆ m_additional

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
AdditionalInputs serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::m_additional
private

◆ m_bound

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
std::shared_ptr<const Bound> serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::m_bound
private

◆ m_cache

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
Cache serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::m_cache
private

◆ m_layout

template<typename Bound, typename Graph, typename Inputs, typename AdditionalInputs = utils::dependencies::DependencyContext<>, typename ResultKey = keys::PhysicalSystem, utils::dependencies::IsKeyList EvaluationServices = utils::dependencies::KeyList<>, utils::dependencies::IsKeyList LinearServices = utils::dependencies::KeyList<>, typename Observers = utils::dependencies::Observers<>>
Layout serif::model::backend::mfem::EquilibriumEvaluator< Bound, Graph, Inputs, AdditionalInputs, ResultKey, EvaluationServices, LinearServices, Observers >::m_layout
private

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