aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGravatar Weiqun Zhang <weiqunzhang@lbl.gov> 2017-01-20 12:20:01 -0800
committerGravatar Weiqun Zhang <weiqunzhang@lbl.gov> 2017-01-20 12:20:01 -0800
commitd8c6df0c676531e6276116c9d15f9ee5fa952c4c (patch)
tree6b2d5b1f88e71dcb0f77e62cdf4917253790765d /Python
parent212909301726315972c95b100dce2c1677c54738 (diff)
downloadWarpX-d8c6df0c676531e6276116c9d15f9ee5fa952c4c.tar.gz
WarpX-d8c6df0c676531e6276116c9d15f9ee5fa952c4c.tar.zst
WarpX-d8c6df0c676531e6276116c9d15f9ee5fa952c4c.zip
add a polymorphic class WarpXParticleContainer to eith physical or laser particles
Diffstat (limited to 'Python')
-rw-r--r--Python/ParticleProb.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/ParticleProb.cpp b/Python/ParticleProb.cpp
index 4cb39046d..7349bff9a 100644
--- a/Python/ParticleProb.cpp
+++ b/Python/ParticleProb.cpp
@@ -1,7 +1,7 @@
//
-// Each problem must have its own version of SingleSpeciesContainer::InitData()
-// to initialize the particle data on this level
+// Each problem must have its own version of PhysicalParticleContainer::InitData()
+// to initialize the particle data. It must also initialize charge and mass.
//
#include <cmath>
@@ -12,18 +12,18 @@
#include <WarpXConst.H>
void
-SingleSpeciesContainer::InitData()
+PhysicalParticleContainer::InitData()
{
- BL_PROFILE("SPC::InitData()");
+ BL_PROFILE("PPC::InitData()");
charge = -PhysConst::q_e;
mass = PhysConst::m_e;
- m_particles.resize(m_gdb->finestLevel()+1);
+ m_particles.resize(GDB().finestLevel()+1);
const int lev = 0;
- const Geometry& geom = m_gdb->Geom(lev);
+ const Geometry& geom = GDB().Geom(lev);
const Real* dx = geom.CellSize();
Real weight, ux, uy, uz;
@@ -57,8 +57,8 @@ SingleSpeciesContainer::InitData()
uz *= PhysConst::c*gamma;
}
- const BoxArray& ba = m_gdb->ParticleBoxArray(lev);
- const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev);
+ const BoxArray& ba = GDB().ParticleBoxArray(lev);
+ const DistributionMapping& dm = GDB().ParticleDistributionMap(lev);
MultiFab dummy_mf(ba, 1, 0, dm, Fab_noallocate);
@@ -113,7 +113,7 @@ SingleSpeciesContainer::InitData()
BoxLib::Abort("invalid particle");
}
- BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel());
+ BL_ASSERT(p.m_lev >= 0 && p.m_lev <= GDB().finestLevel());
//
// Add it to the appropriate PBox at the appropriate level.
//