diff options
author | 2019-05-09 21:18:05 -0700 | |
---|---|---|
committer | 2019-05-09 21:18:05 -0700 | |
commit | 1bedcc5de542f0ec6eeaff7dde369a12c2913f93 (patch) | |
tree | 7b8c3a621a16c4a07fd9dfddcc9e097c70d63ad9 /Source/Particles/PhysicalParticleContainer.cpp | |
parent | c7126b7855d4206a5f78555c1ed7978f68769968 (diff) | |
parent | e25f80f2f4317a6126cdd47609c454dcd124646d (diff) | |
download | WarpX-1bedcc5de542f0ec6eeaff7dde369a12c2913f93.tar.gz WarpX-1bedcc5de542f0ec6eeaff7dde369a12c2913f93.tar.zst WarpX-1bedcc5de542f0ec6eeaff7dde369a12c2913f93.zip |
Merge pull request #137 from ECP-WarpX/select_output
Add options to select quantities dumped to plot files
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 2fa39d87d..b3c598c22 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -82,6 +82,37 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp pp.query("do_splitting", do_splitting); pp.query("split_type", split_type); pp.query("do_continuous_injection", do_continuous_injection); + + pp.query("plot_species", plot_species); + int do_user_plot_vars; + do_user_plot_vars = pp.queryarr("plot_vars", plot_vars); + if (not do_user_plot_vars){ + // By default, all particle variables are dumped to plotfiles, + // including {x,y,z,ux,uy,uz}old variables when running in a + // boosted frame + if (WarpX::do_boosted_frame_diagnostic && WarpX::do_boosted_frame_particles){ + plot_flags.resize(PIdx::nattribs + 6, 1); + } else { + plot_flags.resize(PIdx::nattribs, 1); + } + } else { + // Set plot_flag to 0 for all attribs + if (WarpX::do_boosted_frame_diagnostic && WarpX::do_boosted_frame_particles){ + plot_flags.resize(PIdx::nattribs + 6, 0); + } else { + plot_flags.resize(PIdx::nattribs, 0); + } + // If not none, set plot_flags values to 1 for elements in plot_vars. + if (plot_vars[0] != "none"){ + for (const auto& var : plot_vars){ + // Return error if var not in PIdx. + AMREX_ALWAYS_ASSERT_WITH_MESSAGE( + ParticleStringNames::to_index.count(var), + "plot_vars argument not in ParticleStringNames"); + plot_flags[ParticleStringNames::to_index.at(var)] = 1; + } + } + } } PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core) |