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

openPMD: Handle Zero Particles Well #2980

Merged
merged 5 commits into from
Mar 22, 2022

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Mar 17, 2022

When a time step for output encounters zero particles in a species, then we still want to dump them as "empty" species (for a step) in openPMD. That simplifies post-processing a lot and we have the mechanisms in openPMD for it :)

This also enables ADIOS .bp support for BTD :)

Fix #2900
Partly a follow-up to #1898, but mostly a missing implementation for zero particle cases.

To Do

  • finalize coding (dump: makeEmpty())
  • testing
  • fix BTD CI issues
  • check if BTD with ADIOS now works, too

When a time step for output encounters zero particles in a species,
then we still want to dump them as "empty" species in openPMD. That
simplifies post-processing a lot and we have the mechanisms in
openPMD for it :)
@ax3l ax3l added bug Something isn't working component: openPMD openPMD I/O bug: affects latest release Bug also exists in latest release version component: diagnostics all types of outputs labels Mar 17, 2022
@ax3l ax3l changed the title [WIP] openPMD: Handle Zero Particles Well openPMD: Handle Zero Particles Well Mar 18, 2022
@ax3l ax3l marked this pull request as ready for review March 18, 2022 17:23
@ax3l ax3l force-pushed the fix-openPMD-zero-particles-step branch from 679334e to 3dd14cb Compare March 18, 2022 17:23
Write empty records for iterations (steps or lab steps for BTD,
respectively) without particles in a species.
@ax3l ax3l force-pushed the fix-openPMD-zero-particles-step branch from 3dd14cb to b6e7271 Compare March 18, 2022 17:33
@ax3l ax3l requested a review from RTSandberg March 18, 2022 17:35
ax3l added 2 commits March 21, 2022 11:47
- set attributes once
- set constant records once
- clean up into appropriate functions
Works now as well 🎉
@ax3l ax3l added the component: boosted frame boosted frame components & logic label Mar 21, 2022
Copy link
Member

@RevathiJambunathan RevathiJambunathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.
Thank you for this PR @ax3l !
I have minor suggestions in the comments

Source/Diagnostics/WarpXOpenPMD.cpp Outdated Show resolved Hide resolved
Source/Diagnostics/WarpXOpenPMD.cpp Outdated Show resolved Hide resolved
Source/Diagnostics/WarpXOpenPMD.cpp Outdated Show resolved Hide resolved
Source/Diagnostics/WarpXOpenPMD.cpp Outdated Show resolved Hide resolved
Thank you!! :)

Co-authored-by: Revathi  Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
@ax3l ax3l merged commit be559b9 into ECP-WarpX:development Mar 22, 2022
@ax3l ax3l deleted the fix-openPMD-zero-particles-step branch March 22, 2022 04:47
Comment on lines +1009 to +1010
currSpecies["charge"][scalar].makeConstant( charge );
currSpecies["mass"][scalar].makeConstant( mass );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, 2x forgot resetDataset. Fixed in #3451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: boosted frame boosted frame components & logic component: diagnostics all types of outputs component: openPMD openPMD I/O
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Particle openPMD IO issues when species not present in the first dump
3 participants