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

Particle Buffer for Backtransformed Diagnostics #1898

Merged
merged 85 commits into from
Jan 7, 2022

Conversation

RevathiJambunathan
Copy link
Member

@RevathiJambunathan RevathiJambunathan commented Apr 19, 2021

This PR implements the capability to transform particle-data from boosted-frame to lab-frame and visualize it using plotfiles and openpmd format using the new BTD interface.

Please note that the output below is not in SI to compare with old BTD. However, the code has been fixed to only output SI units similar to FullDiagnostics.
Also an Abort is added in the code when adios backend is used with openpmd format to write particles in lab-frame. A corresponding Issue is generated #2448

Below is the 2D input file that was used to verify the simulations using the customized output from old BTD with that from new BTD using plotfile and openpmd format.
inputs_2d_boost_testBTD.txt

Output from old-BTD for 2nd snapshot
Ez_old_BTD_iteration2

Output from new-BTD with plotfile format

Ez_newBTD_plotfile_iteration2

Output from new BTD with openpmd format :
I was unable to plot particles and fields in the same slice using openpmd-viewer , but they are plotted separately here
Screenshot from 2021-10-12 20-18-19
Screenshot from 2021-10-12 20-19-36
Screenshot from 2021-10-12 20-19-56

I compared the mean(uz) from old BTD and new BTD (plotfile) and found that both outputs agree exactly.
for completeness : mean(uz) for the driver particles in WarpX units from old and new BTD = 59605413002956.99

@ax3l ax3l requested review from ax3l and atmyers June 28, 2021 21:14
@ax3l ax3l added the component: diagnostics all types of outputs label Jun 28, 2021
@RevathiJambunathan RevathiJambunathan force-pushed the AddParticlesForBTD branch 3 times, most recently from 93c5c5c to 8c6ffe0 Compare September 13, 2021 21:57
@RevathiJambunathan RevathiJambunathan marked this pull request as ready for review September 20, 2021 20:48
@RevathiJambunathan RevathiJambunathan force-pushed the AddParticlesForBTD branch 2 times, most recently from e32554c to 877945e Compare September 21, 2021 17:57
@ax3l ax3l self-assigned this Oct 12, 2021
@RevathiJambunathan RevathiJambunathan force-pushed the AddParticlesForBTD branch 3 times, most recently from f95521b to 911bf14 Compare October 18, 2021 19:06
@ax3l
Copy link
Member

ax3l commented Oct 18, 2021

ADIOS2 backend issue will we approached in openPMD/openPMD-api#1126

We will add an assert for now.

@RevathiJambunathan
Copy link
Member Author

RevathiJambunathan commented Oct 25, 2021

a9e84d5 This commit add the Abort.
When test for adios (bp) backend with write_species = 0, I had to restructure some of the code to ensure that only fields output works. So the commit include that as well.

This commit add this in the documentation.
8137d3e. Also added documentation mentioning how to use BackTransformed option. This was necessary to explain the abort.

@RevathiJambunathan RevathiJambunathan force-pushed the AddParticlesForBTD branch 2 times, most recently from 7dc3abf to 87cff7e Compare October 29, 2021 19:04
@@ -15,5 +15,5 @@

my_check = checksumAPI.evaluate_checksum(
'background_mcc', 'Python_background_mcc_plt00050',
do_particles=True, rtol=2.5e-3
do_particles=True, rtol=3.7e-3
Copy link
Member Author

@RevathiJambunathan RevathiJambunathan Jan 6, 2022

Choose a reason for hiding this comment

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

@roelof-groenewald I changed this temporarily to 3.7e-3 as that was the relative difference for particle_momentum_z for electrons. All other quantities in the checksum are within this tolerance. Was 2.5e-3 chosen specifically or was this driven by the maximum difference in the checksum?
This PR changes when time get updated, and as a result, background_mcc benchmarks are updated since the potential hi uses the updated time

Copy link
Member

Choose a reason for hiding this comment

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

That sounds fine. The 2.5e-3 tolerance was not intelligently chosen, but by the needed tolerance for the test to pass so increasing it to 3.7e-3 is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks a lot!

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

We have a couple of known issues:

  • openPMD: ADIOS2 particle resize/output seems to be not working yet
  • plotfiles: reading back pure particle output does not work yet

but we can address them in follow-ups.

@ax3l ax3l merged commit b673c59 into ECP-WarpX:development Jan 7, 2022
@ax3l ax3l mentioned this pull request Mar 17, 2022
4 tasks
Comment on lines +665 to +669
m_doParticleSetUp = false;
if (counter.GetTotalNumParticles() > 0 and ParticleFlushOffset == 0) {
// This will trigger meta-data flush for particles the first-time non-zero number of particles are flushed.
m_doParticleSetUp = true;
}
Copy link
Member

@ax3l ax3l Mar 17, 2022

Choose a reason for hiding this comment

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

Improvements incoming via #2980 (related to #2900)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: boosted frame boosted frame components & logic component: diagnostics all types of outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for particle visualization in BTD with plotfiles/openpmd
5 participants