aboutsummaryrefslogtreecommitdiff
path: root/Source/Laser/LaserParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-09-04 14:59:39 -0700
committerGravatar MaxThevenet <mthevenet@lbl.gov> 2019-09-04 14:59:39 -0700
commit424588663931d457289f89ced2a2d38c7705b2f4 (patch)
tree5e88c6463ce6832389b6a95786d243f4a02cb94c /Source/Laser/LaserParticleContainer.cpp
parentaffd4ed397c6537d713f3380c8299502d9b8444d (diff)
downloadWarpX-424588663931d457289f89ced2a2d38c7705b2f4.tar.gz
WarpX-424588663931d457289f89ced2a2d38c7705b2f4.tar.zst
WarpX-424588663931d457289f89ced2a2d38c7705b2f4.zip
add laser particles on level 0 instead of max level
Diffstat (limited to 'Source/Laser/LaserParticleContainer.cpp')
-rw-r--r--Source/Laser/LaserParticleContainer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp
index d4abb40db..f6ed12fed 100644
--- a/Source/Laser/LaserParticleContainer.cpp
+++ b/Source/Laser/LaserParticleContainer.cpp
@@ -244,6 +244,8 @@ LaserParticleContainer::UpdateContinuousInjectionPosition(Real dt)
void
LaserParticleContainer::InitData ()
{
+ // Call InitData on max level to inject one laser particle per
+ // finest cell.
InitData(maxLevel());
}
@@ -379,7 +381,8 @@ LaserParticleContainer::InitData (int lev)
RealVector particle_uz(np, 0.0);
if (Verbose()) amrex::Print() << "Adding laser particles\n";
- AddNParticles(lev,
+ // Add particles on level 0. They will be redistributed afterwards
+ AddNParticles(0,
np, particle_x.dataPtr(), particle_y.dataPtr(), particle_z.dataPtr(),
particle_ux.dataPtr(), particle_uy.dataPtr(), particle_uz.dataPtr(),
1, particle_w.dataPtr(), 1);