Examples¶
Every study file is made and read the same way, in every language:
createdeclares every name the file will hold, with its units and its role: inputs (parameters), names such as a status (labels), and results (scalars, and fields on a mesh).add_rungives each run's values; opening the file to append adds runs later.openreads:selectpicks rows by a condition, such asstatus == converged, and aget_call reads one name for those rows.gamut validatechecks a file against the rules of the specification.
The examples build on one another: most studies need only the first two,
and each of the others adds one idea, for when a study has it. Each is a
program in examples/,
shown with what it prints, and the tests run every one. Where an example
is written in more than one language, the programs are the same and print
the same lines; choosing a language shows it in every example.
| Example | For a study with | Languages | |
|---|---|---|---|
| 1 | Run tables | inputs and results per run, and which runs failed; no mesh | Python, MATLAB, Julia, C++, Rust |
| 2 | One mesh | every run on one mesh, with fields at its nodes or cells | Python, MATLAB, Julia, C++, Rust |
| 3 | Geometry families | several shapes meshed with one topology, and a train/test split | Python, MATLAB, Julia, C++, Rust |
| 4 | Changing meshes | a different mesh per run | Python, MATLAB, Julia, C++, Rust |
| 5 | Time series | transient runs, a row per saved step | Python, MATLAB, Julia, C++, Rust |
| 6 | Uncertainty and gradients | a spread, quantiles or a derivative beside a result | Python, MATLAB, Julia, C++, Rust |
| 7 | Models | a fitted model to share and evaluate on new inputs | Python, MATLAB; the built-in model in Julia, C++ and Rust too |
| 8 | Reading parts | more data than memory, regions, other units | Python, MATLAB, Julia, C++, Rust |
| 9 | Combining files | runs from several files, or a subset of one | Python, MATLAB, Julia, C++, Rust |
| 10 | VTK | a folder of VTK files to bring in, or to write back out | Python, command line |
The reference has the command line and each language's spelling of the same calls; how it works explains what the files hold and why.