Skip to content

Commit 499274c

Browse files
sbryngelsonclaude
andcommitted
Add viz unit tests with checked-in 1D/2D/3D fixture data
37 tests covering step parsing, label formatting, format/timestep discovery, binary and silo readers (1D/2D/3D), binary-silo consistency, and rendering (1D, 2D, 3D slice). Fixture data generated from minimal MFC runs (m=15, MUSCL) in both binary and silo formats (~1MB total). Also adds --step last support and updates visualization docs with tiled rendering, interactive mode, and LaTeX label sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent db19ff4 commit 499274c

27 files changed

Lines changed: 440 additions & 6 deletions

File tree

docs/documentation/visualization.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ MFC includes a built-in visualization command that renders images and videos dir
1414
### Basic usage
1515

1616
```bash
17-
# Plot pressure at timestep 1000
18-
./mfc.sh viz case_dir/ --var pres --step 1000
17+
# Plot pressure at the last available timestep
18+
./mfc.sh viz case_dir/ --var pres --step last
1919

2020
# Plot density at all available timesteps
2121
./mfc.sh viz case_dir/ --var rho --step all
@@ -44,6 +44,7 @@ The `--step` argument accepts several formats:
4444
|--------|---------|-------------|
4545
| Single | `--step 1000` | One timestep |
4646
| Range | `--step 0:10000:500` | Start:end:stride (inclusive) |
47+
| Last | `--step last` | Most recent available timestep |
4748
| All | `--step all` | Every available timestep |
4849

4950
### Rendering options
@@ -104,6 +105,45 @@ Generate MP4 videos from a range of timesteps:
104105
Videos are saved as `case_dir/viz/<varname>.mp4`.
105106
The color range is automatically computed from the first, middle, and last frames unless `--vmin`/`--vmax` are specified.
106107

108+
### Tiled 1D rendering
109+
110+
For 1D cases, omitting `--var` (or passing `--var all`) renders all variables in a single tiled figure:
111+
112+
```bash
113+
# Tiled plot of all variables at the last timestep
114+
./mfc.sh viz case_dir/ --step last
115+
116+
# Equivalent explicit form
117+
./mfc.sh viz case_dir/ --var all --step last
118+
```
119+
120+
Each variable gets its own subplot with automatic LaTeX-style axis labels.
121+
Tiled mode is only available for 1D data.
122+
123+
### Interactive mode
124+
125+
Launch a browser-based interactive viewer with `--interactive`:
126+
127+
```bash
128+
./mfc.sh viz case_dir/ --interactive
129+
130+
# Custom port
131+
./mfc.sh viz case_dir/ --interactive --port 9000
132+
```
133+
134+
The interactive viewer provides a Dash web UI with:
135+
- Variable and timestep selection
136+
- Live plot updates
137+
- Pan, zoom, and hover inspection
138+
139+
> [!NOTE]
140+
> Interactive mode requires the `dash` Python package.
141+
142+
### Plot styling
143+
144+
Axis labels use LaTeX-style math notation — for example, `pres` is labeled as \f$p\f$, `vel1` as \f$u\f$, and `alpha1` as \f$\alpha_1\f$.
145+
Plots use serif fonts and the Computer Modern math font for consistency with publication figures.
146+
107147
### Format selection
108148

109149
The output format is auto-detected from the case directory.
912 Bytes
Binary file not shown.
912 Bytes
Binary file not shown.
912 Bytes
Binary file not shown.
912 Bytes
Binary file not shown.
912 Bytes
Binary file not shown.
912 Bytes
Binary file not shown.
9.52 KB
Binary file not shown.
9.52 KB
Binary file not shown.
9.52 KB
Binary file not shown.

0 commit comments

Comments
 (0)