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

Namespaces

namespace  backend
 
namespace  checks
 
namespace  computations
 
namespace  detail
 
namespace  equation
 
namespace  keys
 
namespace  normalization
 
namespace  preconditioning
 
namespace  state
 

Classes

struct  ConstraintOf
 Identify a generated residual independently from its target and unknown units. More...
 
struct  DiscretizationOptions
 Select a descriptive star, its existing finite-element resources, and its numerical coordinates. More...
 
struct  EnforcementOf
 Select an explicit numerical enforcement while preserving the public physical prescription. More...
 
class  EosReference
 Reuse one immutable EOS in equation objects, optionally retaining shared ownership. More...
 
struct  EquilibriumEquations
 State the chosen equations explicitly, without selecting physics from the EOS. More...
 
struct  EquilibriumPlan
 Collect the explicitly selected physical coefficients and supported constraint coordinates. More...
 
class  FixedAngularMomentum
 Prescribe angular momentum while angular velocity remains an independent solved coordinate. More...
 
class  FixedTotalMass
 Prescribe total stellar mass while the effective surface-potential level remains an independent solved coordinate. More...
 
struct  GeneratedCoordinateOf
 Name another prescription, including a forward declaration, without erasing its identity. More...
 
struct  ModelPlan
 Derive physical coordinates from explicit equations, independently of numerical solvability. More...
 
struct  NoShapeForce
 Explicitly omit a shape equation from a declarative formulation. More...
 
struct  NoSurfaceCondition
 Explicitly omit a surface prescription from a declarative formulation. More...
 
struct  ScalarConstraint
 Declare independent target, unknown and residual units and stable descriptive identities. More...
 
struct  SpecificationDefinition
 Declare a prescription once; numerical providers and normalization consume this metadata. More...
 
struct  SpecificationDescriptor
 Inspect canonical prescription identity without claiming numerical availability. More...
 
struct  StellarMeshOptions
 Resolve a spherical stellar interior and a compactified exterior on a curved reference mesh. More...
 
class  StellarModel
 
class  StellarModel< EquationOfStateT, EquationDefinitionT, utils::types::TypeList< Specifications... > >
 Own immutable physics and an explicit formulation, independently of meshes, caches and solvers. More...
 
struct  StellarState
 Own one stellar candidate in physical coordinates, including any solved surface shape. More...
 
struct  StellarSurfaceRefinementOptions
 Add mesh resolution at the stellar interface before creating field spaces. More...
 

Concepts

concept  EquilibriumEquationDescription
 Recognize composition without instantiating any numerical equation contract.
 
concept  ExecutableEquilibriumDescription
 Recognize current equation backends without instantiating an invalid complete plan.
 
concept  ExecutableInteriorEquations
 The current interior backend can evaluate every explicitly listed equation.
 
concept  ModelSpecification
 Recognize a self-describing prescription without demanding executable physics or optional metadata.
 
concept  DimensionalScalarSpecification
 Require exact dimensional agreement only when scalar numerical metadata is needed.
 
concept  ValidSpecificationPack
 Prescriptions accompany one separately owned EOS; no numerical capability is assumed.
 
concept  StellarModelType
 Safely recognize descriptions, including when presented with an incomplete specialization.
 
concept  HasUniqueSpecificationForRole
 
concept  SpecificationEndpointsValid
 Validate physical ownership, available inputs and uniquely owned generated equations.
 
concept  SpecificationTopologyValid
 Validate physical endpoints and every derivative in an explicitly declared contract.
 
concept  SpecificationBackendAvailable
 Require a registered implementation for every declared generated derivative, including explicit zeros.
 

Typedefs

template<ExecutableEquilibriumDescription Description, typename Plan>
using ActualEquilibriumCouplings = typename detail::EquilibriumCouplings<Description, detail::ExecutionSurface<Plan>>::Type
 Inspect the actual derivative producers admitted by the explicitly supplied physical formulation.
 
template<typename... Fields>
using Reads = utils::types::TypeList<Fields...>
 
template<typename... Equations>
using Changes = utils::types::TypeList<Equations...>
 
template<DimensionalScalarSpecification Specification>
using GeneratedCoordinateQuantity = typename Specification::ModelDefinition::ScalarDescription::CoordinateQuantity
 Query scalar units only once the owning prescription is complete.
 
template<DimensionalScalarSpecification Specification>
using ConstraintQuantity = typename Specification::ModelDefinition::ScalarDescription::ResidualQuantity
 Residual units remain independent from the target and generated coordinate.
 
template<SpecificationRole Role, StellarModelType Candidate>
using SpecificationsForRole = typename std::remove_cvref_t<Candidate>::template SpecificationsForRole<Role>
 
template<typename Row, typename Field>
using Derivative = operators::PhysicalBlock<utils::dependencies::KeyList<Row>, utils::dependencies::KeyList<Field>>
 Name a physical derivative using the shared block-source key convention.
 
template<utils::dependencies::IsBinding... Additional>
using SpecificationBindings
 Map physical names and built-in generated identities once; custom identities require explicit bindings.
 
using DefaultSpecificationBindings = SpecificationBindings<>
 
template<ExecutableInteriorEquations Registry>
using DeclaredEquationCouplings = typename detail::InteriorCouplings<std::remove_cvref_t<Registry>>::Type
 Derive declared interior couplings from actual operands rather than a second physical sparsity table.
 

Enumerations

enum class  SpecificationRole {
  constitutive_law , boundary_condition , invariant , phase_condition ,
  gauge_choice , rotation_law
}
 Physical purpose of a prescription, independently of its numerical implementation. More...
 
enum class  GeneratedStateKind { none , multiplier , physical_coordinate , solver_border }
 Distinguish prescribed physics from the physical meaning of a generated scalar. More...
 

Functions

template<ExecutableInteriorEquations Registry, typename Discretization, discretization::blocks::SystemLayoutType Layout, typename... AdditionalComputations, typename... AdditionalContributions>
auto make_model_graph (std::shared_ptr< const Registry > registry, std::shared_ptr< const Discretization > discretization, const Layout &layout, std::tuple< AdditionalComputations... > additional={}, utils::dependencies::KeyList< AdditionalContributions... > contributions={}, operators::backend::mfem::VolumeOptions options={})
 Construct the complete stellar graph at one explicit composition point.
 
template<ExecutableInteriorEquations Registry, typename Discretization, discretization::blocks::SystemLayoutType Layout, typename... AdditionalComputations, typename... AdditionalContributions>
auto make_model_graph (Registry registry, std::shared_ptr< const Discretization > discretization, const Layout &layout, std::tuple< AdditionalComputations... > additional={}, utils::dependencies::KeyList< AdditionalContributions... > contributions={}, operators::backend::mfem::VolumeOptions options={})
 Retain a standalone registry, including move-only equations supplied as an rvalue.
 
template<typename Bound, typename Layout, typename... NumericalComputations>
auto make_equilibrium_graph (std::shared_ptr< const Bound > bound, const Layout &layout, std::tuple< NumericalComputations... > numerical={}, operators::backend::mfem::VolumeOptions options={})
 Connect the explicit equilibrium definition in one readable place.
 
template<StellarModelType Model, typename FiniteElements, typename Normalization, typename Preconditioner>
requires normalization::ReferenceResolvable<Normalization, Model>
auto make_discretization (DiscretizationOptions< Model, FiniteElements, Normalization, Preconditioner > options)
 Resolve model defaults while preserving compile-time field, scheme, and coordinate choices.
 
template<typename Model>
auto share_equation_of_state (std::shared_ptr< const Model > model)
 Share the EOS subobject while retaining the model that owns it.
 
template<typename EOS>
EosReference< EOS > borrow_eos (const EOS &eos) noexcept
 Borrow the model-owned EOS when the prepared graph already retains its immutable model owner.
 
template<typename EOS>
requires (!std::is_lvalue_reference_v<EOS>)
void borrow_eos (EOS &&)=delete
 Borrowing never extends a temporary EOS lifetime.
 
template<typename Interior, typename Shape = NoShapeForce, typename Surface = NoSurfaceCondition>
 EquilibriumEquations (Interior, Shape={}, Surface={}) -> EquilibriumEquations< Interior, Shape, Surface >
 Preserve every authored member when a declaration passes through a templated model factory.
 
template<typename Model>
requires requires(const Model& model) { model.equations(); } && EquilibriumEquationDescription<decltype(detail::resolve_equation_member(std::declval<const Model&>().equations(), std::declval<const Model&>()))>
auto resolve_equilibrium_equations (const Model &model)
 Resolve an explicit composition at binding; retain the model while the result borrows its members.
 
template<typename Model>
requires (!std::is_lvalue_reference_v<Model>)
void resolve_equilibrium_equations (Model &&)=delete
 A temporary model cannot retain the equation members borrowed by the resolved description.
 
template<typename Model, typename Description, typename Plan, typename Bindings = DefaultSpecificationBindings, typename ExplicitZeroCouplings = utils::dependencies::KeyList<>>
consteval bool executable_model_topology ()
 Validate a complete selected formulation without inferring solvability or selecting physics.
 
template<discretization::blocks::SystemLayoutType Layout>
 StellarState (Layout) -> StellarState< std::remove_cvref_t< Layout > >
 Infer a state's layout type from its physical coordinate description.
 
template<discretization::blocks::SystemLayoutType Layout>
 StellarState (Layout, std::vector< double >) -> StellarState< std::remove_cvref_t< Layout > >
 Infer a state's layout type when adopting physical coefficients.
 
template<typename EOS, typename Definition, typename... Specifications>
requires ValidSpecificationPack<std::remove_cvref_t<Specifications>...>
 StellarModel (EOS &&, Definition &&, Specifications &&...) -> StellarModel< std::remove_cvref_t< EOS >, std::remove_cvref_t< Definition >, typename detail::CanonicalSpecifications< std::remove_cvref_t< Specifications >... >::Type >
 
template<typename EOS, typename Definition, typename... Specifications>
requires ValidSpecificationPack<std::remove_cvref_t<Specifications>...>
auto make_stellar_model (EOS &&eos, Definition &&definition, Specifications &&... specifications)
 Construct a typed physical description with programmer-selected equations.
 
static void validate_target (double value, bool zero_allowed, std::string_view name)
 Validate a dimensional scalar target before storing a physical prescription.
 
template<typename Owner, utils::dependencies::IsDependencyContext Bindings>
auto make_stellar_discretization (std::shared_ptr< Owner > owner, Bindings bindings, const ::mfem::GridFunction &compactification, const mapping::DomainMapper &mapper)
 Retain the supplied resource owner without copying finite-element spaces or changing their addresses.
 
template<typename Owner, typename Bindings, typename DomainModel>
auto with_deformation (StellarDiscretization< Owner, Bindings > discretization, DomainModel model, geometry::deformation::backend::mfem::ReferenceDiscretization reference)
 Add an explicit deformation prescription without changing the physical equation definition.
 

Variables

template<SpecificationRole Role, typename Candidate>
constexpr std::size_t specification_role_count
 Inspect role counts without instantiating invalid model specializations.
 

Typedef Documentation

◆ ActualEquilibriumCouplings

template<ExecutableEquilibriumDescription Description, typename Plan>
using serif::model::ActualEquilibriumCouplings = typename detail::EquilibriumCouplings<Description, detail::ExecutionSurface<Plan>>::Type

Inspect the actual derivative producers admitted by the explicitly supplied physical formulation.

◆ Changes

template<typename... Equations>
using serif::model::Changes = utils::types::TypeList<Equations...>

◆ ConstraintQuantity

template<DimensionalScalarSpecification Specification>
using serif::model::ConstraintQuantity = typename Specification::ModelDefinition::ScalarDescription::ResidualQuantity

Residual units remain independent from the target and generated coordinate.

◆ DeclaredEquationCouplings

template<ExecutableInteriorEquations Registry>
using serif::model::DeclaredEquationCouplings = typename detail::InteriorCouplings<std::remove_cvref_t<Registry>>::Type

Derive declared interior couplings from actual operands rather than a second physical sparsity table.

◆ DefaultSpecificationBindings

◆ Derivative

Name a physical derivative using the shared block-source key convention.

◆ GeneratedCoordinateQuantity

template<DimensionalScalarSpecification Specification>
using serif::model::GeneratedCoordinateQuantity = typename Specification::ModelDefinition::ScalarDescription::CoordinateQuantity

Query scalar units only once the owning prescription is complete.

◆ Reads

template<typename... Fields>
using serif::model::Reads = utils::types::TypeList<Fields...>

◆ SpecificationBindings

template<utils::dependencies::IsBinding... Additional>
using serif::model::SpecificationBindings
Initial value:
The value of this global scalar is the effective surface-potential level Us. Its paired residual enfo...
Definition fields.hpp:85
The angular_velocity term represents the angular velocity of the system. It is a global scalar that i...
Definition fields.hpp:127
Definition binding.hpp:9
Definition binding.hpp:33

Map physical names and built-in generated identities once; custom identities require explicit bindings.

◆ SpecificationsForRole

template<SpecificationRole Role, StellarModelType Candidate>
using serif::model::SpecificationsForRole = typename std::remove_cvref_t<Candidate>::template SpecificationsForRole<Role>

Enumeration Type Documentation

◆ GeneratedStateKind

Distinguish prescribed physics from the physical meaning of a generated scalar.

Enumerator
none 
multiplier 
physical_coordinate 
solver_border 

◆ SpecificationRole

Physical purpose of a prescription, independently of its numerical implementation.

Enumerator
constitutive_law 
boundary_condition 
invariant 
phase_condition 
gauge_choice 
rotation_law 

Function Documentation

◆ borrow_eos() [1/2]

template<typename EOS>
EosReference< EOS > serif::model::borrow_eos ( const EOS & eos)
nodiscardnoexcept

Borrow the model-owned EOS when the prepared graph already retains its immutable model owner.

◆ borrow_eos() [2/2]

template<typename EOS>
requires (!std::is_lvalue_reference_v<EOS>)
void serif::model::borrow_eos ( EOS && )
delete

Borrowing never extends a temporary EOS lifetime.

◆ EquilibriumEquations()

template<typename Interior, typename Shape = NoShapeForce, typename Surface = NoSurfaceCondition>
serif::model::EquilibriumEquations ( Interior ,
Shape = {},
Surface = {} ) -> EquilibriumEquations< Interior, Shape, Surface >

Preserve every authored member when a declaration passes through a templated model factory.

Note
Explicit deduction avoids compiler substitution dropping defaulted aggregate members. Deduced declarations supply preceding slots: use NoShapeForce before a surface condition when the shape force is absent. Explicitly typed aggregates may still skip members.

◆ executable_model_topology()

template<typename Model, typename Description, typename Plan, typename Bindings = DefaultSpecificationBindings, typename ExplicitZeroCouplings = utils::dependencies::KeyList<>>
bool serif::model::executable_model_topology ( )
nodiscardconsteval

Validate a complete selected formulation without inferring solvability or selecting physics.

Note
Closed equations define zero derivatives for other coordinates, but that fact cannot admit a missing custom multiplier force. ExplicitZeroCouplings is an explicit author registration, not a fallback.

◆ make_discretization()

template<StellarModelType Model, typename FiniteElements, typename Normalization, typename Preconditioner>
requires normalization::ReferenceResolvable<Normalization, Model>
auto serif::model::make_discretization ( DiscretizationOptions< Model, FiniteElements, Normalization, Preconditioner > options)
nodiscard

Resolve model defaults while preserving compile-time field, scheme, and coordinate choices.

Note
Finite-element resources remain explicit: normalization does not choose a mesh or approximation order.

◆ make_equilibrium_graph()

template<typename Bound, typename Layout, typename... NumericalComputations>
auto serif::model::make_equilibrium_graph ( std::shared_ptr< const Bound > bound,
const Layout & layout,
std::tuple< NumericalComputations... > numerical = {},
operators::backend::mfem::VolumeOptions options = {} )
nodiscard

Connect the explicit equilibrium definition in one readable place.

Note
Interior physics, shape force and surface replacement remain separate declarations. The final physical-system computation collects additions before replacing rows.

◆ make_model_graph() [1/2]

template<ExecutableInteriorEquations Registry, typename Discretization, discretization::blocks::SystemLayoutType Layout, typename... AdditionalComputations, typename... AdditionalContributions>
auto serif::model::make_model_graph ( Registry registry,
std::shared_ptr< const Discretization > discretization,
const Layout & layout,
std::tuple< AdditionalComputations... > additional = {},
utils::dependencies::KeyList< AdditionalContributions... > contributions = {},
operators::backend::mfem::VolumeOptions options = {} )
nodiscard

Retain a standalone registry, including move-only equations supplied as an rvalue.

◆ make_model_graph() [2/2]

template<ExecutableInteriorEquations Registry, typename Discretization, discretization::blocks::SystemLayoutType Layout, typename... AdditionalComputations, typename... AdditionalContributions>
auto serif::model::make_model_graph ( std::shared_ptr< const Registry > registry,
std::shared_ptr< const Discretization > discretization,
const Layout & layout,
std::tuple< AdditionalComputations... > additional = {},
utils::dependencies::KeyList< AdditionalContributions... > contributions = {},
operators::backend::mfem::VolumeOptions options = {} )
nodiscard

Construct the complete stellar graph at one explicit composition point.

Note
The registry is the authoritative equation list. Additional declarations supply deformation, boundary treatment, constraints, normalization or inverses; only named contribution results modify the physical system. Dependency preparation schedules the work and publishes complete results.

◆ make_stellar_discretization()

template<typename Owner, utils::dependencies::IsDependencyContext Bindings>
auto serif::model::backend::mfem::make_stellar_discretization ( std::shared_ptr< Owner > owner,
Bindings bindings,
const ::mfem::GridFunction & compactification,
const mapping::DomainMapper & mapper )
nodiscard

Retain the supplied resource owner without copying finite-element spaces or changing their addresses.

◆ make_stellar_model()

template<typename EOS, typename Definition, typename... Specifications>
requires ValidSpecificationPack<std::remove_cvref_t<Specifications>...>
auto serif::model::make_stellar_model ( EOS && eos,
Definition && definition,
Specifications &&... specifications )
nodiscard

Construct a typed physical description with programmer-selected equations.

◆ resolve_equilibrium_equations() [1/2]

template<typename Model>
requires requires(const Model& model) { model.equations(); } && EquilibriumEquationDescription<decltype(detail::resolve_equation_member(std::declval<const Model&>().equations(), std::declval<const Model&>()))>
auto serif::model::resolve_equilibrium_equations ( const Model & model)
nodiscard

Resolve an explicit composition at binding; retain the model while the result borrows its members.

◆ resolve_equilibrium_equations() [2/2]

template<typename Model>
requires (!std::is_lvalue_reference_v<Model>)
void serif::model::resolve_equilibrium_equations ( Model && )
delete

A temporary model cannot retain the equation members borrowed by the resolved description.

◆ share_equation_of_state()

template<typename Model>
auto serif::model::share_equation_of_state ( std::shared_ptr< const Model > model)
nodiscard

Share the EOS subobject while retaining the model that owns it.

◆ StellarModel()

template<typename EOS, typename Definition, typename... Specifications>
requires ValidSpecificationPack<std::remove_cvref_t<Specifications>...>
serif::model::StellarModel ( EOS && ,
Definition && ,
Specifications && ... ) -> StellarModel< std::remove_cvref_t< EOS >, std::remove_cvref_t< Definition >, typename detail::CanonicalSpecifications< std::remove_cvref_t< Specifications >... >::Type >

◆ StellarState() [1/2]

template<discretization::blocks::SystemLayoutType Layout>
serif::model::StellarState ( Layout ) -> StellarState< std::remove_cvref_t< Layout > >

Infer a state's layout type from its physical coordinate description.

◆ StellarState() [2/2]

template<discretization::blocks::SystemLayoutType Layout>
serif::model::StellarState ( Layout ,
std::vector< double >  ) -> StellarState< std::remove_cvref_t< Layout > >

Infer a state's layout type when adopting physical coefficients.

◆ validate_target()

static void serif::model::validate_target ( double value,
bool zero_allowed,
std::string_view name )
static

Validate a dimensional scalar target before storing a physical prescription.

◆ with_deformation()

template<typename Owner, typename Bindings, typename DomainModel>
auto serif::model::backend::mfem::with_deformation ( StellarDiscretization< Owner, Bindings > discretization,
DomainModel model,
geometry::deformation::backend::mfem::ReferenceDiscretization reference )
nodiscard

Add an explicit deformation prescription without changing the physical equation definition.

Variable Documentation

◆ specification_role_count

template<SpecificationRole Role, typename Candidate>
std::size_t serif::model::specification_role_count
inlineconstexpr
Initial value:
= []
{
{
return std::remove_cvref_t<Candidate>::template specification_role_count<Role>;
}
else
{
return std::size_t{0};
}
}()
Safely recognize descriptions, including when presented with an incomplete specialization.
Definition stellar_model.hpp:165
constexpr std::size_t specification_role_count
Inspect role counts without instantiating invalid model specializations.
Definition stellar_model.hpp:169

Inspect role counts without instantiating invalid model specializations.