Add offline multiFab converter and tool to generate npy file#60
Merged
ruohai0925 merged 1 commit intoruohai0925:developmentfrom Mar 7, 2026
Merged
Add offline multiFab converter and tool to generate npy file#60ruohai0925 merged 1 commit intoruohai0925:developmentfrom
ruohai0925 merged 1 commit intoruohai0925:developmentfrom
Conversation
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.
Summary
Updates the offline tools in
Tools/multiFabConverter/offline/for use with MPI-enabled pyAMReX: a parallel visualization script (main.py), a batch plt→npy conversion script (script_plt_to_npz.py), and a single README documenting both.Changes
main.pyDistributionMappingwhen reading the plot file.Rank r: n/N boxes) after loading the plt.input_mf[:](collective) then, on rank 0, extracts a 2D slice ofx_velocityat a given z and savesslice_z.png.script_plt_to_npz.pympirun) to convert one or more plt files to a stacked.npyarray(n_samples, ncomp, nx, ny).plt*subdirs, uses the latest one.-ooutput path,-llevel,-ccomponent names (default:x_velocity,y_velocity,avg_pressure).README.mdTesting
main.py: run with MPI and a valid plt path, e.g.mpirun -np 4 python main.py <path_to_plt>; check per-rank box output andslice_z.pngon rank 0.script_plt_to_npz.py: e.g.python script_plt_to_npz.py <path_to_plt> -o out.npy; verifyout.npyshape and components.