diff options
author | 2017-01-20 12:20:01 -0800 | |
---|---|---|
committer | 2017-01-20 12:20:01 -0800 | |
commit | d8c6df0c676531e6276116c9d15f9ee5fa952c4c (patch) | |
tree | 6b2d5b1f88e71dcb0f77e62cdf4917253790765d /Python | |
parent | 212909301726315972c95b100dce2c1677c54738 (diff) | |
download | WarpX-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.cpp | 18 |
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. // |