Skip to content

Commit 3144880

Browse files
Merge branch 'master' of github.com:danieljvickers/MFC
2 parents f722e38 + 00aa603 commit 3144880

4 files changed

Lines changed: 45 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
continue-on-error: true
150150

151151
github:
152-
name: ${{ matrix.nvhpc && format('NVHPC {0} ({1})', matrix.nvhpc, matrix.target) || format('Github ({0}, {1}, {2}, intel={3})', matrix.os, matrix.mpi, matrix.debug, matrix.intel) }}
152+
name: ${{ matrix.nvhpc && format('NVHPC {0} ({1})', matrix.nvhpc, matrix.target) || format('Github ({0}, {1}, {2}, {3})', matrix.os, matrix.mpi, matrix.debug, matrix.intel && 'intel' || 'GNU') }}
153153
needs: [lint-gate, file-changes, rebuild-cache]
154154
if: >-
155155
!cancelled() &&

docs/documentation/visualization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Post-processed data in Silo-HDF5 format (`format=1`) can be opened directly in P
205205
Paraview 5.11.0 has been confirmed to work with the MFC databases for some parallel environments.
206206
Nevertheless, the installation and configuration of Paraview can be environment-dependent and are left to the user.
207207

208-
The user can launch Paraview and open the index files under `/silo_hdf5/root`.
208+
The user can launch Paraview and open the series file `/silo_hdf5/collection.silo.series`.
209209
Once the database is loaded, flow field variables contained in the database can be added to the render view.
210210
Further information on Paraview can be found in its [documentation](https://docs.paraview.org/en/latest/).
211211
The figure below shows the iso-contour of the liquid void fraction (`alpha1`) in the database generated by the example case `3D_sphbubcollapse`.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env python3
2+
"""Generate SILO series file for time-series visualization in ParaView/VisIt."""
3+
4+
import json
5+
import sys
6+
from pathlib import Path
7+
8+
9+
def generate_silo_series(case_dir):
10+
"""Generate collection.silo.series file from existing collection files."""
11+
root_dir = Path(case_dir) / "silo_hdf5" / "root"
12+
series_file = Path(case_dir) / "silo_hdf5" / "collection.silo.series"
13+
14+
if not root_dir.exists():
15+
return
16+
17+
collection_files = sorted(
18+
root_dir.glob("collection_*.silo"),
19+
key=lambda p: int(p.stem.split("_")[1]),
20+
)
21+
22+
if not collection_files:
23+
return
24+
25+
files = [{"name": f"root/{f.name}", "time": i} for i, f in enumerate(collection_files)]
26+
27+
series_data = {"file-series-version": "1.0", "files": files}
28+
29+
with open(series_file, "w") as f:
30+
json.dump(series_data, f, indent=2)
31+
32+
33+
if __name__ == "__main__":
34+
if len(sys.argv) < 2:
35+
print("Usage: generate_silo_series.py <case_dir>")
36+
sys.exit(1)
37+
38+
case_dir = sys.argv[1]
39+
generate_silo_series(case_dir)

toolchain/templates/include/helpers.mako

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ END
9999
exit 1
100100
fi
101101
102+
% if target.name == 'post_process':
103+
python3 "${MFC_ROOT_DIR}/toolchain/templates/include/generate_silo_series.py" '${os.path.dirname(input)}'
104+
% endif
105+
102106
% if output_summary:
103107
104108
cd '${MFC_ROOT_DIR}'

0 commit comments

Comments
 (0)