Spectral examples sequence¶
This page gives a reading and running order through three programs that add one concept at a time: a spectral model, simulator orchestration, and a nonlinear model with output.
Sequence¶
Step |
Executable |
New idea |
|---|---|---|
1 |
|
Subclass |
2 |
|
Add |
3 |
|
Add a nonlinear operator split, initial data, and VTK output |
Together they mirror how a research application usually grows: first verify the physics step, then add framework-managed lifecycle and output.
Build and run¶
From the repository root:
cmake --build build --target \
04_diffusion_model \
05_simulator \
12_cahn_hilliard
mpirun -n 1 ./build/examples/04_diffusion_model
mpirun -n 1 ./build/examples/05_simulator
mpirun -n 1 ./build/examples/12_cahn_hilliard
Begin with one rank. After all three programs exit with status zero, repeat with a rank count supported by your launcher allocation and the example dimensions. The programs do not share one mandatory success message; see Example run output.
Read the sources¶
File |
Look for |
|---|---|
Field allocation, Fourier-space operator construction, and forward/backward transforms |
|
Simulator construction, modifiers, time control, and ownership |
|
Nonlinear split, initial state, and VTK write cadence |
Treat these compiled examples as the code-level source of truth. This page explains their order rather than copying their implementations.
Continue by goal¶
Goal |
Next document |
|---|---|
Understand |
|
Build a JSON-driven application |
|
Understand JSON-to-simulator wiring |
|
Inspect output in ParaView |
|
Find every runnable example |
|
Look up API-focused snippets |