Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Metadata of Particle Patches #75

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading