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

Namespaces

namespace  detail
 

Classes

struct  Entry
 The ledger locates each independent field without decoding the rest of the archive. More...
 
struct  EnumSerializer
 Encode enumerations by declared stable spellings, never compiler-dependent integers. More...
 
struct  Error
 Identify the component or field that could not be saved or reconstructed. More...
 
struct  Field
 Associate a field name with an already encoded child. More...
 
struct  Member
 Name a typed field expected by a component's loader. More...
 
struct  NamedMember
 Name a plain configuration member without adding persistence methods to its owner. More...
 
struct  Node
 A named component owns its fields, stable schema identifier, and schema version. More...
 
struct  Pack
 A pack owns its data immediately, so subsequent model changes cannot alter a pending write. More...
 
class  Reader
 Inspect the ledger first, then seek directly to whichever components are actually needed. More...
 
struct  ReadOptions
 Bound resource use when inspecting an unfamiliar archive; limits may be raised explicitly. More...
 
struct  RecipeSerializer
 Preserve the selected equation/unknown identities in every composed inverse. More...
 
struct  SchemaSerializer
 Reconstruct stateless typed numerical declarations only when all their identities match. More...
 
struct  Serializer
 Specialize this protocol beside a component without adding I/O methods to the component itself. More...
 
struct  Serializer< char[Size]>
 
struct  Serializer< dependencies::Binding< Key, Target > >
 
struct  Serializer< dependencies::Bindings< Bindings... > >
 
struct  Serializer< dependencies::DependencyContext< Resources... > >
 
struct  Serializer< dependencies::DependencyContext<> >
 
struct  Serializer< dependencies::KeyList< Terms... > >
 
struct  Serializer< dependencies::Resource< Key, Storage, Policy > >
 
struct  Serializer< dependencies::ValueSnapshot >
 
struct  Serializer< dimensions::QuantityValue< Quantity > >
 
struct  Serializer< discretization::blocks::SystemLayout< Values, Residuals > >
 
struct  Serializer< discretization::quadrature::Policy >
 
struct  Serializer< discretization::quadrature::RuleControl >
 
struct  Serializer< discretization::quadrature::RuleSet >
 
struct  Serializer< eos::models::Polytrope >
 
struct  Serializer< equations::AngularMomentumConstraint >
 
struct  Serializer< equations::BarotropicDensityBalance< EOS > >
 
struct  Serializer< equations::BarycenterConstraint< Axis, Row > >
 
struct  Serializer< equations::EquationRegistry< Equations... > >
 
struct  Serializer< equations::MassNormalization >
 
struct  Serializer< equations::PointMassCompanion >
 
struct  Serializer< equations::PrimalPoissonBalance >
 
struct  Serializer< equations::SurfacePotentialBalance >
 
struct  Serializer< geometry::deformation::DomainDeformation< Surface, Interior, Vacuum > >
 
struct  Serializer< geometry::deformation::FixedInfinityRadialExtension >
 
struct  Serializer< geometry::deformation::GeometryStepLimit >
 Store bounded numerical history as named data, without runtime operators or graph caches. More...
 
struct  Serializer< geometry::deformation::keys::SurfaceMetric >
 
struct  Serializer< geometry::deformation::NodalRadialSurface >
 
struct  Serializer< geometry::deformation::PowerLawRadialExtension >
 
struct  Serializer< geometry::deformation::SphericalHarmonicSurface >
 
struct  Serializer< geometry::surface::IsobaricSurface >
 
struct  Serializer< laneemden::IntegrationOptions >
 
struct  Serializer< model::backend::mfem::StellarDiscretization< Owner, Bindings, Deformation > >
 Integrate native discretizations into packs while keeping application-owner reconstruction explicit. More...
 
struct  Serializer< model::DiscretizationOptions< Model, FiniteElements, Normalization, Preconditioner > >
 
struct  Serializer< model::EosReference< EOS > >
 
struct  Serializer< model::EquilibriumEquations< Interior, Shape, Surface > >
 
struct  Serializer< model::FixedAngularMomentum >
 
struct  Serializer< model::FixedTotalMass >
 
struct  Serializer< model::normalization::SurfaceRows >
 
struct  Serializer< model::NoShapeForce >
 
struct  Serializer< model::NoSurfaceCondition >
 
struct  Serializer< model::preconditioning::None >
 
struct  Serializer< model::StellarModel< EOS, Definition, types::TypeList< Specifications... > > >
 
struct  Serializer< model::StellarState< Layout > >
 
struct  Serializer< Node >
 Preserve a raw component when inspection, rather than typed reconstruction, is wanted. More...
 
struct  Serializer< operators::backend::mfem::VolumeOptions >
 Preserve quadrature and contraction choices separately from physical coefficients. More...
 
struct  Serializer< solver::Backtracking >
 
struct  Serializer< solver::linear::Control >
 
struct  Serializer< solver::linear::FGMRES >
 
struct  Serializer< solver::linear::Report >
 Store bounded numerical history as named data, without runtime operators or graph caches. More...
 
struct  Serializer< solver::linear::Status >
 Preserve stable termination names independently of enum storage or declaration order. More...
 
struct  Serializer< solver::MetricEvaluation >
 Store bounded numerical history as named data, without runtime operators or graph caches. More...
 
struct  Serializer< solver::Newton >
 
struct  Serializer< solver::NewtonCheckpoint< State > >
 Save a portable accepted physical state together with its complete supported Newton history. More...
 
struct  Serializer< solver::NewtonProgress >
 Store bounded numerical history as named data, without runtime operators or graph caches. More...
 
struct  Serializer< solver::normalization::AutomaticPlan >
 
struct  Serializer< solver::normalization::DiagonalNormalization >
 
struct  Serializer< solver::normalization::Dimensionless >
 
struct  Serializer< solver::normalization::DimensionlessRieszCoordinate< Quantity, Metric, Geometry > >
 
struct  Serializer< solver::normalization::FromModel >
 
struct  Serializer< solver::normalization::IdentityCoordinate >
 
struct  Serializer< solver::normalization::LaneEmdenApproximation< Mass, Density > >
 
struct  Serializer< solver::normalization::NormalizationOptions< Scheme, Coordinates, Plan, Sources, Computations > >
 
struct  Serializer< solver::normalization::NormalizationPlan< Values, Residuals > >
 
struct  Serializer< solver::normalization::PhysicalRieszCoordinate< Quantity, Metric > >
 
struct  Serializer< solver::normalization::ReferenceVolumeMetric< Term > >
 
struct  Serializer< solver::normalization::StellarReferenceScales >
 
struct  Serializer< solver::normalization::UnitMetric >
 
struct  Serializer< solver::normalization::WithPointRows< Volume, Quantity, Selection > >
 
struct  Serializer< solver::NormalizedResidualMetric >
 
struct  Serializer< solver::preconditioner::BlockPreconditioner< Row, Field, Strategy > >
 
struct  Serializer< solver::preconditioner::BorderedPreconditioner< Fields, Constraints > >
 
struct  Serializer< solver::preconditioner::CoupledPreconditioner< First, Second, Policy > >
 
struct  Serializer< solver::preconditioner::strategies::coupling::SecondThenFirst >
 
struct  Serializer< solver::preconditioner::strategies::inverse::DenseDirect >
 
struct  Serializer< solver::preconditioner::strategies::inverse::Diagonal >
 
struct  Serializer< solver::preconditioner::strategies::inverse::FixedAMG >
 
struct  Serializer< solver::preconditioner::strategies::inverse::SparseDirect >
 
struct  Serializer< solver::SolveDiagnostics >
 Store bounded numerical history as named data, without runtime operators or graph caches. More...
 
struct  Serializer< solver::SolveResult< State, System, Model > >
 Export scientific results and supported restart data without pretending frozen operators are persistent. More...
 
struct  Serializer< solver::SolverOptions< Metric, Strategies, Linear > >
 
struct  Serializer< solver::SolveStatus >
 Preserve stable termination names independently of enum storage or declaration order. More...
 
struct  Serializer< solver::StandardNewton >
 
struct  Serializer< std::array< T, Size > >
 
struct  Serializer< std::optional< T > >
 
struct  Serializer< std::string >
 
struct  Serializer< std::string_view >
 
struct  Serializer< std::tuple< T... > >
 
struct  Serializer< std::vector< T > >
 Arrays of coefficients are contiguous payloads, while compound values retain named children. More...
 
struct  Serializer< T >
 Store numeric values using explicit portable widths. More...
 
struct  StructSerializer
 Compose an explicitly listed aggregate; the field list is also its constructor order. More...
 
struct  TermIdentity
 Register stable coordinate identities separately from compiler-generated display names. More...
 
struct  TermIdentity< discretization::blocks::barotropic_constant::mass_normalization >
 
struct  TermIdentity< discretization::blocks::density::mass >
 
struct  TermIdentity< discretization::blocks::displacement::vector >
 
struct  TermIdentity< discretization::blocks::gravity::potential >
 
struct  TermIdentity< discretization::blocks::rotation::angular_velocity >
 
struct  TermIdentity< discretization::blocks::surface_deformation::coefficients >
 
struct  TermIdentity< discretization::blocks::surface_deformation::shape_equilibrium >
 
struct  TermIdentity< model::ConstraintOf< Specification > >
 
struct  TermIdentity< model::GeneratedCoordinateOf< Specification > >
 
struct  TopExportOptions
 Sampling and admissibility limits for TOP's single-domain polytrope reader. More...
 
struct  TopExportReport
 Export scales and sampled projection defects; these do not certify oscillation accuracy. More...
 
struct  TopPolytropeSource
 Physical samples in a centered frame whose polar axis is the rotation axis. More...
 
struct  WriteOptions
 Annotations belong to the written observation, not to the stellar physics. More...
 

Typedefs

template<typename OriginalModel>
using RestoredStellarModel = model::StellarModel<typename OriginalModel::EquationOfState, detail::OwnedEquations<OriginalModel>, typename OriginalModel::SpecificationTypes>
 Restore current physics as an explicit composition, without pretending to regenerate a deferred program.
 
template<typename T>
using Result = std::expected<T, Error>
 
using Value
 Portable scientific data; runtime pointers and computational caches have no representation here.
 

Enumerations

enum class  Format { binary , text }
 Both encodings share the same component schemas and indexed, sectioned file layout. More...
 
enum class  VersionTolerance { same_major , exact , any }
 Application-version compatibility is separate from file-format and component-schema compatibility. More...
 

Functions

template<model::StellarModelType Model, typename FiniteElements, typename State>
Result< TopExportReport > export_top (const std::filesystem::path &directory, const Model &stellar_model, const FiniteElements &finite_elements, const State &state, const TopExportOptions &options={})
 Export the accepted density and FE surface of a uniformly rotating vacuum polytrope to TOP.
 
template<typename FiniteElements, typename Solution>
requires requires(const Solution& solution) { solution.has_state(); solution.model(); solution.state(); }
Result< TopExportReport > export_top (const std::filesystem::path &directory, const FiniteElements &finite_elements, const Solution &solution, const TopExportOptions &options={})
 Export a solver result with the separately owned FE resources that interpret its accepted state.
 
template<typename T>
Field named (std::string name, const T &value)
 Assign an explicit top-level name, for example when storing two stars in the same archive.
 
void add_component (Pack &pack, Field component)
 Insert a component while rejecting conflicting definitions of the same named object.
 
template<typename... T>
Pack pack (const T &... values)
 Capture every supplied component; unregistered nested types remain visible as unsupported entries.
 
Result< void > write (const std::filesystem::path &path, const Pack &contents, const WriteOptions &options={})
 Write a complete temporary file and atomically replace the destination only after it closes successfully.
 
template<typename Owner, typename Value>
constexpr auto member_field (std::string_view name, Value Owner::*pointer)
 Deduce a member's stored type from its ordinary C++ declaration.
 
template<typename Term>
Node term_schema ()
 Expose the physical meaning and FE representation of one compiled coordinate.
 
Result< void > validate_schema (const Node &saved, const Node &expected)
 A compiled identity must match and must have an explicit persistence registration.
 
template<typename OriginalModel>
Result< RestoredStellarModel< OriginalModel > > restore_stellar_model (const Node &node)
 Reconstruct resolved physics; future changes requiring the original callback remain a separate capability.
 
template<typename T>
Node encode (const T &value)
 Produce data when a serializer exists, otherwise record the missing capability explicitly.
 
template<typename T>
Result< T > decode (const Node &node)
 Translate invalid saved parameters into a value error at the reconstruction boundary.
 
template<typename T>
Field field (std::string name, const T &value)
 Encode one named field of a component.
 
template<typename... Fields>
Node object (std::string_view type, Fields... fields)
 Compose a component from its independently serialized fields.
 
template<typename T>
Member< T > member (std::string_view name)
 Describe one field to read_object without a separate temporary variable.
 
template<typename T>
Result< T > read_field (const Node &node, std::string_view name)
 Read a required field and retain its full path in any diagnostic.
 
template<typename Construct, typename... Members>
auto read_object (const Node &node, std::string_view type, Construct construct, Members... members) -> Result< std::invoke_result_t< Construct, typename Members::Type... > >
 Construct a component only after every required field has decoded successfully.
 
std::string fingerprint (std::string_view bytes)
 Versioned content identity for accidental corruption and resource matching; not a cryptographic signature.
 
Result< TopExportReport > export_top (const std::filesystem::path &path, const TopPolytropeSource &source, const TopExportOptions &options={})
 Atomically publish a new TOP model directory, refusing to overwrite any destination.
 

Typedef Documentation

◆ RestoredStellarModel

template<typename OriginalModel>
using serif::utils::serialize::RestoredStellarModel = model::StellarModel<typename OriginalModel::EquationOfState, detail::OwnedEquations<OriginalModel>, typename OriginalModel::SpecificationTypes>

Restore current physics as an explicit composition, without pretending to regenerate a deferred program.

◆ Result

template<typename T>
using serif::utils::serialize::Result = std::expected<T, Error>

◆ Value

Initial value:
std::variant<std::monostate, bool, std::int64_t, std::uint64_t, double, std::string,
std::vector<double>, std::vector<std::int64_t>, std::vector<std::uint64_t>>

Portable scientific data; runtime pointers and computational caches have no representation here.

Enumeration Type Documentation

◆ Format

Both encodings share the same component schemas and indexed, sectioned file layout.

Enumerator
binary 
text 

◆ VersionTolerance

Application-version compatibility is separate from file-format and component-schema compatibility.

Enumerator
same_major 
exact 
any 

Function Documentation

◆ add_component()

void serif::utils::serialize::add_component ( Pack & pack,
Field component )

Insert a component while rejecting conflicting definitions of the same named object.

◆ decode()

template<typename T>
Result< T > serif::utils::serialize::decode ( const Node & node)
nodiscard

Translate invalid saved parameters into a value error at the reconstruction boundary.

◆ encode()

template<typename T>
Node serif::utils::serialize::encode ( const T & value)
nodiscard

Produce data when a serializer exists, otherwise record the missing capability explicitly.

◆ export_top() [1/3]

template<typename FiniteElements, typename Solution>
requires requires(const Solution& solution) { solution.has_state(); solution.model(); solution.state(); }
Result< TopExportReport > serif::utils::serialize::export_top ( const std::filesystem::path & directory,
const FiniteElements & finite_elements,
const Solution & solution,
const TopExportOptions & options = {} )
nodiscard

Export a solver result with the separately owned FE resources that interpret its accepted state.

◆ export_top() [2/3]

template<model::StellarModelType Model, typename FiniteElements, typename State>
Result< TopExportReport > serif::utils::serialize::export_top ( const std::filesystem::path & directory,
const Model & stellar_model,
const FiniteElements & finite_elements,
const State & state,
const TopExportOptions & options = {} )
nodiscard

Export the accepted density and FE surface of a uniformly rotating vacuum polytrope to TOP.

Note
StellarModel owns physics, while finite_elements and state supply its numerical realization. Enthalpy is derived only for this external file format; it is not introduced as a SERiF unknown. The native TOP polytrope reader does not represent general EOS or finite-pressure surfaces.

◆ export_top() [3/3]

Result< TopExportReport > serif::utils::serialize::export_top ( const std::filesystem::path & path,
const TopPolytropeSource & source,
const TopExportOptions & options = {} )
nodiscard

Atomically publish a new TOP model directory, refusing to overwrite any destination.

Note
Projects the source surface and pressure-derived enthalpy at common surface-fitted zeta coordinates. Only equatorially symmetric axisymmetric vacuum polytropes with n>=1 are supported. TOP chooses Gamma1 in its equation set, separately from these files.

◆ field()

template<typename T>
Field serif::utils::serialize::field ( std::string name,
const T & value )
nodiscard

Encode one named field of a component.

◆ fingerprint()

std::string serif::utils::serialize::fingerprint ( std::string_view bytes)
nodiscard

Versioned content identity for accidental corruption and resource matching; not a cryptographic signature.

◆ member()

template<typename T>
Member< T > serif::utils::serialize::member ( std::string_view name)
nodiscard

Describe one field to read_object without a separate temporary variable.

◆ member_field()

template<typename Owner, typename Value>
auto serif::utils::serialize::member_field ( std::string_view name,
Value Owner::* pointer )
nodiscardconstexpr

Deduce a member's stored type from its ordinary C++ declaration.

◆ named()

template<typename T>
Field serif::utils::serialize::named ( std::string name,
const T & value )
nodiscard

Assign an explicit top-level name, for example when storing two stars in the same archive.

◆ object()

template<typename... Fields>
Node serif::utils::serialize::object ( std::string_view type,
Fields... fields )
nodiscard

Compose a component from its independently serialized fields.

◆ pack()

template<typename... T>
Pack serif::utils::serialize::pack ( const T &... values)
nodiscard

Capture every supplied component; unregistered nested types remain visible as unsupported entries.

◆ read_field()

template<typename T>
Result< T > serif::utils::serialize::read_field ( const Node & node,
std::string_view name )
nodiscard

Read a required field and retain its full path in any diagnostic.

◆ read_object()

template<typename Construct, typename... Members>
auto serif::utils::serialize::read_object ( const Node & node,
std::string_view type,
Construct construct,
Members... members ) -> Result<std::invoke_result_t<Construct, typename Members::Type...>>
nodiscard

Construct a component only after every required field has decoded successfully.

◆ restore_stellar_model()

template<typename OriginalModel>
Result< RestoredStellarModel< OriginalModel > > serif::utils::serialize::restore_stellar_model ( const Node & node)
nodiscard

Reconstruct resolved physics; future changes requiring the original callback remain a separate capability.

◆ term_schema()

template<typename Term>
Node serif::utils::serialize::term_schema ( )
nodiscard

Expose the physical meaning and FE representation of one compiled coordinate.

◆ validate_schema()

Result< void > serif::utils::serialize::validate_schema ( const Node & saved,
const Node & expected )
inline

A compiled identity must match and must have an explicit persistence registration.

◆ write()

Result< void > serif::utils::serialize::write ( const std::filesystem::path & path,
const Pack & contents,
const WriteOptions & options = {} )
nodiscard

Write a complete temporary file and atomically replace the destination only after it closes successfully.