Autosave¶
Last changes: Documentation changelog
Contract¶
This page records the table, field, and stage autosave policies that schedule persistent output during a stage.
Governing equations¶
No physical equation is introduced; autosave is transport and persistence policy.
Symbols and SI units¶
Sampling periods are in seconds or in steps; quantities carry the units defined by their observables.
Assumptions and validity¶
Exactly one of the time or step cadence must be set; formats and layouts are validated immediately.
Python API¶
Python |
Type |
Default |
SI unit |
Validation |
Meaning |
Backend support |
ProblemIR |
|---|---|---|---|---|---|---|---|
— |
— |
— |
\(1\) |
— |
— |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
— |
|
|
|
\(\mathrm{s}\) |
Exactly one of |
Time-based scalar-table cadence |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
step |
Exactly one of |
Step-based scalar-table cadence |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
default set |
\(1\) |
Supported quantity ids |
Table columns |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
Supported quantity ids; normalized and de-duplicated |
Additional scalar-table columns |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
Expressions are normalized by the source helper |
Additional scalar-table expressions |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
Non-empty |
Table identity |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
Known field id |
Field cadence |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
Exactly one of |
Time-based field cadence |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
step |
Exactly one of |
Step-based field cadence |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
|
Save target |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
|
Scalar-table autosave policy |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
Every item must be |
Field autosave policies |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
|
Persistence format |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(1\) |
|
Layout policy |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
Complete stage-first example¶
# %% Relax stage with table and field autosave
import fullmag as fm
nm = 1.0e-9
study = fm.study("autosave_api_example")
study.engine("fdm")
study.device("cpu", precision="double")
study.mode("strict")
study.objects.mesh.defaults(cell_size=(2 * nm, 2 * nm, 5 * nm))
film = study.geometry(fm.Box(100 * nm, 20 * nm, 5 * nm), name="film")
film.Ms = 800.0e3
film.Aex = 13.0e-12
film.alpha = 1.0
film.m = fm.init.UniformMagnetization((1.0, 0.1, 0.0))
study.exchange()
study.stages.add_relax(stage_id="relax", algorithm="projected_gradient_bb", max_steps=1000, tolT=1e-8).autosave(
fm.StageAutosave(
table=fm.TableAutosave(
every_steps=10,
quantities=["step", "mx", "my", "mz", "e_ex", "e_total", "max_torque_T"],
),
fields=[fm.FieldAutosave("m", every_steps=100)],
)
)
ProblemIR¶
StageAutosave.to_ir() emits kind, target, layout, format, table, and fields; a time
policy lower to sample_period_s/every_seconds and "auto" lower to a Sinc-based
sample_period_policy.
Round-trip and failure semantics¶
Requested intent is the value authored by Python and preserved in ProblemIR; resolved execution is the planner or realization result. Validation errors identify the violated domain rule, and unsupported combinations are rejected explicitly rather than silently substituted.
Ambiguous (both/neither) cadence, unsupported formats, duplicate field quantities, and txt with
field outputs fail immediately.
Discrete realization¶
Cadence is consumed by the runtime sampler; persistence formats map to JSON/Zarr/HDF5 writers.
Implementation mapping¶
Anchor: packages/fullmag-py/src/fullmag/model/study.py (TableAutosave, FieldAutosave,
StageAutosave).
Validation¶
Ownership and cadence tests exercise the policy normalizations.
Limitations¶
Autosave is authoring policy; actual artifact production requires an executed lane.
Scientific bibliography¶
No physical model is introduced.
Control Room crosswalk¶
Status: Table/field autosave and result inspection are partial; unsupported output formats remain not implemented.
Python/API surface |
Control Room path |
Status |
Transaction |
|---|---|---|---|
Parameters documented on this page |
|
|
Submit autosave draft; output resources are revised after execution |
Parameters without a named UI field |
|
|
Python-only until implemented |
not implemented: frontend support for output parameters not rendered by the autosave/result inspectors.
See Control Room capability register for the support matrix and not implemented policy.
Frontend source owner: apps/control-room/src/modules/inspector/panels/stages/AutosaveStageInspector.tsx (AutosaveStageInspector).
Source-code index¶
Claim |
Path |
Stable symbol |
Responsibility |
Evidence |
|---|---|---|---|---|
Autosave policies |
|
|
Cadence/format lowering |
Ownership and cadence tests |
Source-map coverage¶
Claim |
Path |
Stable symbol |
Responsibility |
Evidence |
|---|---|---|---|---|
Table cadence and quantity selection. |
|
|
Table cadence and quantity selection. |
Source-map validator and focused API tests |
Field cadence and field selection. |
|
|
Field cadence and field selection. |
Source-map validator and focused API tests |
Stage output format, layout, and target. |
|
|
Stage output format, layout, and target. |
Source-map validator and focused API tests |