aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.H
diff options
context:
space:
mode:
authorGravatar Andrew Myers <atmyers2@gmail.com> 2019-04-29 10:18:34 -0700
committerGravatar Andrew Myers <atmyers2@gmail.com> 2019-04-29 10:18:34 -0700
commitc38f60ee1fe22ae21f9bc38a7d4ff5b1be2d2d5a (patch)
treea559e93eda8494ec1c106197d56f20067bde08ed /Source/Particles/WarpXParticleContainer.H
parentd6d9c796040e14dc0fe50e96bc2b1231d953a01e (diff)
downloadWarpX-c38f60ee1fe22ae21f9bc38a7d4ff5b1be2d2d5a.tar.gz
WarpX-c38f60ee1fe22ae21f9bc38a7d4ff5b1be2d2d5a.tar.zst
WarpX-c38f60ee1fe22ae21f9bc38a7d4ff5b1be2d2d5a.zip
add the xold, uxold, etc particle components at runtime if doing boosted frame diagnostics for the particles
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.H')
-rw-r--r--Source/Particles/WarpXParticleContainer.H30
1 files changed, 18 insertions, 12 deletions
diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H
index 050060b47..275554cd8 100644
--- a/Source/Particles/WarpXParticleContainer.H
+++ b/Source/Particles/WarpXParticleContainer.H
@@ -14,9 +14,6 @@ struct PIdx
#ifdef WARPX_RZ
theta, // RZ needs all three position components
#endif
-#ifdef WARPX_STORE_OLD_PARTICLE_ATTRIBS
- xold, yold, zold, uxold, uyold, uzold,
-#endif
nattribs
};
};
@@ -42,15 +39,7 @@ namespace ParticleStringNames
{"Ez", PIdx::Ez },
{"Bx", PIdx::Bx },
{"By", PIdx::By },
- {"Bz", PIdx::Bz },
-#ifdef WARPX_STORE_OLD_PARTICLE_ATTRIBS
- {"xold", PIdx::xold },
- {"yold", PIdx::yold },
- {"zold", PIdx::zold },
- {"uxold", PIdx::uxold},
- {"uyold", PIdx::uyold},
- {"uzold", PIdx::uzold},
-#endif
+ {"Bz", PIdx::Bz }
};
}
@@ -231,8 +220,25 @@ public:
// split along axes (0) or diagonals (1)
int split_type = 0;
+ using amrex::ParticleContainer<0, 0, PIdx::nattribs>::AddRealComp;
+ using amrex::ParticleContainer<0, 0, PIdx::nattribs>::AddIntComp;
+
+ void AddRealComp (const std::string& name, bool comm=true)
+ {
+ particle_comps[name] = NumRealComps();
+ AddRealComp(comm);
+ }
+
+ void AddIntComp (const std::string& name, bool comm=true)
+ {
+ particle_comps[name] = NumIntComps();
+ AddIntComp(comm);
+ }
+
protected:
+ std::map<std::string, int> particle_comps;
+
int species_id;
amrex::Real charge;