From 21c3df8537865d64d417d335e6de33d29841eb43 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 17 Apr 2024 11:57:51 -0700 Subject: [PATCH] Fix: Metadata of Particle Patches Declared as records, thus `unitDimension` needs to be set. --- openpmd_validator/createExamples_h5.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openpmd_validator/createExamples_h5.py b/openpmd_validator/createExamples_h5.py index ffe8b76..459953a 100755 --- a/openpmd_validator/createExamples_h5.py +++ b/openpmd_validator/createExamples_h5.py @@ -546,6 +546,14 @@ def write_particles(f, iteration): particlePatches["extent/y"].attrs["unitSI"] = offset["y"].attrs["unitSI"] particlePatches["extent/z"].attrs["unitSI"] = offset["z"].attrs["unitSI"] + # particle patches are spatial bounding boxes + particlePatches["offset"].attrs["unitDimension"] = \ + np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64) + particlePatches["extent"].attrs["unitDimension"] = \ + np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64) + # L M T I theta N J + # Dimension of Length per component + # domain decomposition shall be 1D along x (but positions are still 3D) # we can therefor make the other components constant particlePatches["offset/y"].attrs["value"] = np.float32(0.0) # full size @@ -571,6 +579,12 @@ def write_particles(f, iteration): particlePatches['offset/x'][rank] = rank * grid_layout[0] / mpi_size particlePatches['extent/x'][rank] = grid_layout[0] / mpi_size + # unitless indices & counters + particlePatches["numParticles"].attrs["unitDimension"] = \ + np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64) + particlePatches["numParticlesOffset"].attrs["unitDimension"] = \ + np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64) + def main(): # Open an exemple file