SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serialize Directory Reference
Directory dependency graph for serialize:

Files

 configuration.hpp
 
 discretization.hpp
 
 options.hpp
 
 resources.hpp
 
 top.hpp
 

Detailed Description

save_discretization(discretization) records the physical and logical reference meshes, finite-element collections and spaces, term support and reduced numbering, compactification coefficients, mapping prescription, and deformation prescription. The application's resource owner and computational caches are not persistent data.

restore_discretization<Original>(node) returns an expected owning discretization. Original supplies its compile-time term, domain-schema and deformation types. The returned object has a new resource-owner type; this is why ordinary decode<Original> cannot reconstruct an arbitrary application-owned discretization. Its bindings and reference spaces borrow only resources retained by that new owner.

For a complete make_discretization(...) configuration, include configuration.hpp and use restore_configuration<OriginalConfiguration>(node). This restores the resolved physical equations, independent FE resources, normalization choices and preconditioner recipe together. The original model's authored callback is replaced by the saved resolved equations; executable callbacks cannot be recreated from data.

For an external mesh, call save_discretization(discretization, {.embed_mesh = false}). Supply a MeshResolver to restoration: it receives each requested content fingerprint and returns native MFEM mesh text. mesh_text(mesh) produces the canonical text expected by this resolver. The same content and reconstruction checks apply to embedded and external meshes. Paths are deliberately left to the application.

Mesh text uses the classic locale and max_digits10. Restoration disables MFEM's refinement marking and optional element-orientation repair, then requires the reconstructed native mesh text to match exactly. Space reconstruction also checks the native signed element numbering; typed bindings check domain support and reduced numbering. Existing geometry validation checks paired reference meshes and shared scalar/displacement companion collections.

The current native format supports finite conforming serial 3D meshes and fixed-order standard H1, L2 and RT spaces. Unsupported resource kinds remain explicit unsupported nodes in the archive. Exact restoration currently requires the same MFEM version, MFEM exception support and its MFEM_ERROR_THROW error policy, so malformed native input can be reported instead of terminating the application. The loader does not change the application's global MFEM error policy. Additional dependency versions and MFEM feature configuration are provenance, not reconstructed objects. MPI library information is queried only if MPI is already running.

Store physical StellarState coefficients alongside the matching numerical description. The caller supplies that pairing; a bare coefficient vector cannot identify its originating mesh. State loading validates the compiled coordinate schema, backend loading validates the mesh and FE representation, and Newton resumption additionally checks the rebuilt accepted residual metric. Element samples, residuals, Jacobians and preconditioners are recomputed from the loaded inputs. A loaded candidate still requires numerical qualification before it can be reported as a converged equilibrium.