|
SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
|
These serializers describe physics and numerical choices separately from a file format. physics.hpp, equations.hpp, model.hpp, and numerics.hpp are backend independent. Each component has a stable schema name and version; nested components use the same Serializer<T> protocol as user extensions.
TermIdentity<T> or provide T::stable_id.configuration) combine the model, finite-element description, normalization and preconditioner. The MFEM restore_configuration helper reconstructs their mesh ownership and resolved model composition.Plain option records use an explicit member list in StructSerializer<T>; it is not object-memory serialization or automatic reflection. Existing validate() methods run after reconstruction, and supported bare numerical recipes additionally check their parameter domains. Matrix-, mesh- and solution-dependent validity still belongs to numerical preparation.
decode<Model>(record) reconstructs the original compiled model type only when its authored equation definition has a loader. Arbitrary lambda captures, function pointers, runtime EOS views and custom computation closures cannot be recreated merely from type names or numeric fingerprints. They produce explicit unsupported records; register a named callable with a serializer when reconstruction is required.
A stellar model also saves its resolved concrete equilibrium equations when they are available. restore_stellar_model<OriginalModel>(record) returns an owning RestoredStellarModel<OriginalModel> with that explicit composition. It can reproduce the saved current physics without retaining the original callback. It does not recreate a program that regenerates equations for different EOS parameters or continuation stages. The original authored-definition limitation remains visible in the archive.
Template loading validates a schema that is already compiled into the application. It does not instantiate arbitrary new C++ types from strings in a file. A runtime loader needs an explicit application catalog of supported compiled formulations.
Archive the solve configuration alongside the result: a solved star does not retain every original solver option, prescribed input, integration policy or preconditioner recipe. Preserve requested choices and resolved choices, including the preconditioner composition, reference scales and actual normalization factors. Saving only “use the default” permits a future library version to choose differently.
Quantity tags identify physical meanings, not SI, CGS or code-unit scales. The enclosing archive must provide the unit convention and provenance; normalization reference values do not supply a complete unit system. The polytropic constant's units also depend on its index.
Stored numeric coefficients and public surface parameters round-trip without formatting loss. Validated constructors may recompute derived values, including rotation-axis normalization. Scientific reconstruction therefore does not promise bit-for-bit object memory, derived arithmetic across compiler/library versions, or an identical floating-point trajectory. Exact solver restart has a separate checkpoint contract and supported-policy checks.