Skip to content

Commit dd7518d

Browse files
authored
Merge pull request #75 from ax3l/fix-patch-meta
Fix: Metadata of Particle Patches
2 parents dab928b + 9b639a0 commit dd7518d

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
@@ -535,6 +535,14 @@ def write_particles(f, iteration):
535535
particlePatches["extent/y"].attrs["unitSI"] = offset["y"].attrs["unitSI"]
536536
particlePatches["extent/z"].attrs["unitSI"] = offset["z"].attrs["unitSI"]
537537

538+
# particle patches are spatial bounding boxes
539+
particlePatches["offset"].attrs["unitDimension"] = \
540+
np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
541+
particlePatches["extent"].attrs["unitDimension"] = \
542+
np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
543+
# L M T I theta N J
544+
# Dimension of Length per component
545+
538546
# domain decomposition shall be 1D along x (but positions are still 3D)
539547
# we can therefor make the other components constant
540548
particlePatches["offset/y"].attrs["value"] = np.float32(0.0) # full size
@@ -560,6 +568,12 @@ def write_particles(f, iteration):
560568
particlePatches['offset/x'][rank] = rank * grid_layout[0] / mpi_size
561569
particlePatches['extent/x'][rank] = grid_layout[0] / mpi_size
562570

571+
# unitless indices & counters
572+
particlePatches["numParticles"].attrs["unitDimension"] = \
573+
np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
574+
particlePatches["numParticlesOffset"].attrs["unitDimension"] = \
575+
np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], dtype=np.float64)
576+
563577

564578
def main():
565579
# Open an exemple file

0 commit comments

Comments
 (0)