Skip to content

Commit

Permalink
Merge pull request #75 from ax3l/fix-patch-meta
Browse files Browse the repository at this point in the history
Fix: Metadata of Particle Patches
  • Loading branch information
ax3l committed Jun 18, 2024
2 parents dab928b + 9b639a0 commit dd7518d
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 @@ -535,6 +535,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 @@ -560,6 +568,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 dd7518d

Please sign in to comment.