[WIP] add utility to convert plotfiles to openPMD w/ compression#1507
[WIP] add utility to convert plotfiles to openPMD w/ compression#1507BenWibking wants to merge 2 commits intodevelopmentfrom
Conversation
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| void SetupMesh(openPMD::Mesh &mesh, const amrex::Geometry &geom, | ||
| const amrex::IntVect &nodal) { | ||
| amrex::Box const &global_box = geom.Domain(); | ||
| auto const global_size = ToReversedVector(global_box.size()); | ||
| auto const grid_spacing = ToReversedVector(geom.CellSize()); | ||
| auto const global_offset = ToReversedVector(geom.ProbLo()); |
There was a problem hiding this comment.
Resize datasets for nodal plotfile variables
In SetupMesh the dataset extent is derived from geom.Domain().size() irrespective of whether the MultiFab is nodal (nodal_flags argument). For nodal/face/edge-centered variables the boxes returned by PlotFileData::get are one cell larger than the cell-centered domain, so global_size underestimates the dataset dimensions while storeChunkRaw later uses the larger nodal local_box.size(). When converting any nodal variable, the chunk offset/size will fall outside the declared dataset and the openPMD write will error or truncate data. Compute the dataset size from a nodal version of the domain (e.g., amrex::convert(geom.Domain(), nodal).size()) before creating the dataset.
Useful? React with 👍 / 👎.



Description
This allows us to use convert AMReX plotfiles to openPMD/ADIOS2 with highly efficient lossy compression.
NOTE: Particles are IGNORED completely in the conversion process.
Related issues
N/A
Checklist
Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an
xinside the square brackets[ ]in the Markdown source below:/azp run.