Skip to content

Commit

Permalink
Merge pull request #76 from ax3l/fix-patch-meta-2.0.X
Browse files Browse the repository at this point in the history
Fix: Metadata of Particle Patches
  • Loading branch information
ax3l authored Jun 18, 2024
2 parents bc846dd + 21c3df8 commit b59051f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions openpmd_validator/createExamples_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b59051f

Please sign in to comment.