Skip to content

Commit 21c3df8

Browse files
committed
Fix: Metadata of Particle Patches
Declared as records, thus `unitDimension` needs to be set.
1 parent bc846dd commit 21c3df8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

openpmd_validator/createExamples_h5.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,14 @@ def write_particles(f, iteration):
546546
particlePatches["extent/y"].attrs["unitSI"] = offset["y"].attrs["unitSI"]
547547
particlePatches["extent/z"].attrs["unitSI"] = offset["z"].attrs["unitSI"]
548548

549+
# particle patches are spatial bounding boxes
550+
particlePatches["offset"].attrs["unitDimension"] = \
551+
np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
552+
particlePatches["extent"].attrs["unitDimension"] = \
553+
np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
554+
# L M T I theta N J
555+
# Dimension of Length per component
556+
549557
# domain decomposition shall be 1D along x (but positions are still 3D)
550558
# we can therefor make the other components constant
551559
particlePatches["offset/y"].attrs["value"] = np.float32(0.0) # full size
@@ -571,6 +579,12 @@ def write_particles(f, iteration):
571579
particlePatches['offset/x'][rank] = rank * grid_layout[0] / mpi_size
572580
particlePatches['extent/x'][rank] = grid_layout[0] / mpi_size
573581

582+
# unitless indices & counters
583+
particlePatches["numParticles"].attrs["unitDimension"] = \
584+
np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
585+
particlePatches["numParticlesOffset"].attrs["unitDimension"] = \
586+
np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
587+
574588

575589
def main():
576590
# Open an exemple file

0 commit comments

Comments
 (0)