aboutsummaryrefslogtreecommitdiff
path: root/Source/Laser/LaserParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Laser/LaserParticleContainer.cpp')
-rw-r--r--Source/Laser/LaserParticleContainer.cpp39
1 files changed, 26 insertions, 13 deletions
diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp
index a330200cc..de192e65e 100644
--- a/Source/Laser/LaserParticleContainer.cpp
+++ b/Source/Laser/LaserParticleContainer.cpp
@@ -1,3 +1,11 @@
+/* Copyright 2019-2020 Andrew Myers, Axel Huebl, David Grote
+ * Luca Fedeli, Maxence Thevenet, Remi Lehe
+ * Revathi Jambunathan, Weiqun Zhang
+ *
+ * This file is part of WarpX.
+ *
+ * License: BSD-3-Clause-LBNL
+ */
#include <limits>
#include <cmath>
#include <algorithm>
@@ -249,8 +257,8 @@ LaserParticleContainer::InitData (int lev)
{
auto compute_min_max = [&](Real x, Real y, Real z){
const Vector<Real>& pos_plane = InverseTransform({x, y, z});
- int i = pos_plane[0]/S_X;
- int j = pos_plane[1]/S_Y;
+ auto i = static_cast<int>(pos_plane[0]/S_X);
+ auto j = static_cast<int>(pos_plane[1]/S_Y);
plane_lo[0] = std::min(plane_lo[0], i);
plane_lo[1] = std::min(plane_lo[1], j);
plane_hi[0] = std::max(plane_hi[0], i);
@@ -386,6 +394,9 @@ LaserParticleContainer::Evolve (int lev,
t_lab = 1./WarpX::gamma_boost*t + WarpX::beta_boost*Z0_lab/PhysConst::c;
}
+ // Update laser profile
+ m_up_laser_profile->update(t);
+
BL_ASSERT(OnSameGrids(lev,jx));
MultiFab* cost = WarpX::getCosts(lev);
@@ -463,17 +474,19 @@ LaserParticleContainer::Evolve (int lev,
// Current Deposition
//
// Deposit inside domains
- int* ion_lev = nullptr;
- DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, &jx, &jy, &jz,
- 0, np_current, thread_num,
- lev, lev, dt);
-
- bool has_buffer = cjx;
- if (has_buffer){
- // Deposit in buffers
- DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, cjx, cjy, cjz,
- np_current, np-np_current, thread_num,
- lev, lev-1, dt);
+ {
+ int* ion_lev = nullptr;
+ DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, &jx, &jy, &jz,
+ 0, np_current, thread_num,
+ lev, lev, dt);
+
+ bool has_buffer = cjx;
+ if (has_buffer){
+ // Deposit in buffers
+ DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, cjx, cjy, cjz,
+ np_current, np-np_current, thread_num,
+ lev, lev-1, dt);
+ }
}
//