aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-05-09 19:46:35 -0700
committerGravatar MaxThevenet <mthevenet@lbl.gov> 2019-05-09 19:46:35 -0700
commit886d49c55cd179c34197fef2880d9623ce37ce22 (patch)
treefe612495d3bc4db47661c71d01e7e2828bd3c5cd /Source/Particles/PhysicalParticleContainer.cpp
parent768093cffd18a2c37d90be1033ae94c3ff38776a (diff)
downloadWarpX-886d49c55cd179c34197fef2880d9623ce37ce22.tar.gz
WarpX-886d49c55cd179c34197fef2880d9623ce37ce22.tar.zst
WarpX-886d49c55cd179c34197fef2880d9623ce37ce22.zip
Can select particle quantities to dump
Diffstat (limited to '')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp41
1 files changed, 27 insertions, 14 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index c6bc92ff6..1bf41816e 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -82,22 +82,35 @@ 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.queryarr("plot_vars", plot_vars);
- if (plot_vars.size() == 0){
- 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 {
- 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);
- }
+ 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 {
+ // Set plot_flags to 1 for data in plot_vars
+ plot_flags.resize(PIdx::nattribs, 0);
+ Print()<<"here2"<<std::endl;
+ }
+ // 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),
+ "<species>.plot_vars argument not in ParticleStringNames");
plot_flags[ParticleStringNames::to_index.at(var)] = 1;
}
}