ADC-376 export hyqmom15 campaign to ParaView (.vti + .pvd) - #49
Merged
Conversation
The campaign writes npz snapshots that ParaView cannot open. Add to_paraview.py: convert each case to a VTK time series on the uniform [-0.5,0.5]^2 grid -- one ImageData .vti per snapshot (cell data: density, ux/uy + speed, phi, the realizability margin lam_min, the 15 moments) plus a .pvd collection ParaView opens as an animation. The runs are single-rank so each snapshot is one grid; parallel .pvti pieces would only apply to an MPI-distributed run. Hand-written VTK XML (base64 binary), no VTK/pyvista dependency. Chain it into the finalize sbatch + README + a build-free check; the round-trip was verified bit-exact via pyvista.
Review nits: ux/uy now read 0 in sub-density-floor cells instead of the raw moment, and an explicit --case that matches no snapshots exits 1 instead of silently reporting success.
Each snapshot now also calls sim.write(format='vtk') -> a native ImageData .vti (CellData mom_<moment> + phi) ParaView/VisIt open directly, alongside the npz. to_paraview.py stays as the optional enriched export (derived density/velocity/realizability fields + a .pvd time collection).
Running the analysis on real campaign output surfaced it: the new paraview/ output dir was picked up as a case, adding a spurious '## paraview / no snapshots' section to rapport.md. Exclude figures/h5/ paraview consistently across make_rapport, export_h5, and the plot tools.
…tron The full run showed dicotron loses realizability without the projector (lam_min -4e5, all cells non-realizable, M00 floored) -- the rollup needs relaxation15, which the campaign ran with projection=False. Thread a --projection flag through run_campaign/run_one/_run_diocotron to build_periodic_sim, which now passes projection=True to build_moment_model (native build_projection, distinct .so). Lets us re-run dicotron with the projector and show it stays realizable.
The old README had grown to 582 lines of historical and issue-tracking cruft. Rewrite it following the project docguide (minimum viable, write for humans, link instead of duplicating): what the package is, quick start, the model API, the five cases, a short validation summary that points to matlab_ref/REFERENCE.md, realizability and the native projector, the analysis/ParaView toolchain, the campaign results, and the layout. 154 lines, en-US, ASCII, no issue-tracker references.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the hyqmom15 campaign viewable in ParaView, two ways.
1) Native adc_cpp VTK in the run
_run_and_recordnow also callssim.write(format="vtk", step=k)— adc_cpp's native writer emits one ImageData.vtiper snapshot (CellDatamom_<moment>+phi), opened directly by ParaView/VisIt. This is the easy, native path; every future run producesstep_*.vtiper case alongside the npz.2)
to_paraview.py— optional enriched exportThe native writer emits raw moments; this converter (from the npz) adds physics-ready cell fields — density, ux/uy + speed, the realizability margin
lam_min— and a<case>.pvdtime collection (realtvalues) underparaview/. Useful for nicer viz and to convert existing npz (e.g. a run made before the native write landed).On "parallel": runs are single-rank (no MPI) → each snapshot is one grid → a single
.vtiis correct. Parallel pieces (.pvti) would only apply to an MPI-distributed run.Validation
ruff clean;
check_campaign7/7. The enriched exporter's round-trip was verified bit-exact with pyvista (density Δ=0, orientation checked on a non-square grid, byte-exact at Np=256); 2-agent review cleared it. The native write uses adc_cpp's documented default VTK format; exercised on the next ROMEO run.Part of ADC-376.