aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Particles/Deposition/CurrentDeposition.H88
-rw-r--r--Source/Particles/LaserParticleContainer.cpp19
-rw-r--r--Source/Particles/MultiParticleContainer.H28
-rw-r--r--Source/Particles/MultiParticleContainer.cpp10
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp16
-rw-r--r--Source/Particles/WarpXParticleContainer.H17
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp39
7 files changed, 111 insertions, 106 deletions
diff --git a/Source/Particles/Deposition/CurrentDeposition.H b/Source/Particles/Deposition/CurrentDeposition.H
index 6867666a6..f508871c6 100644
--- a/Source/Particles/Deposition/CurrentDeposition.H
+++ b/Source/Particles/Deposition/CurrentDeposition.H
@@ -35,11 +35,11 @@ using namespace amrex::literals;
ion_lev is a null pointer.
* \param jx_fab,jy_fab,jz_fab FArrayBox of current density, either full array or tile.
* \param np_to_depose Number of particles for which current is deposited.
- * \param relative_t Time at which to deposit J, relative to the time of
- * the current positions of the particles (expressed in
- * physical units). When different than 0, the particle
- * position will be temporarily modified to match the
- * time of the deposition.
+ * \param dt Time step for particle level
+ * \param relative_time Time at which to deposit J, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
* \param dx 3D cell size
* \param xyzmin Physical lower bounds of domain.
* \param lo Index lower bounds of domain.
@@ -59,7 +59,7 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
amrex::FArrayBox& jy_fab,
amrex::FArrayBox& jz_fab,
const long np_to_depose,
- const amrex::Real relative_t,
+ const amrex::Real relative_time,
const std::array<amrex::Real,3>& dx,
const std::array<amrex::Real,3>& xyzmin,
const amrex::Dim3 lo,
@@ -148,8 +148,8 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
#if defined(WARPX_DIM_RZ)
// In RZ, wqx is actually wqr, and wqy is wqtheta
// Convert to cylinderical at the mid point
- const amrex::Real xpmid = xp + relative_t*vx;
- const amrex::Real ypmid = yp + relative_t*vy;
+ const amrex::Real xpmid = xp + relative_time*vx;
+ const amrex::Real ypmid = yp + relative_time*vy;
const amrex::Real rpmid = std::sqrt(xpmid*xpmid + ypmid*ypmid);
amrex::Real costheta;
amrex::Real sintheta;
@@ -178,7 +178,7 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
// Keep these double to avoid bug in single precision
const double xmid = (rpmid - xmin)*dxi;
#else
- const double xmid = ((xp - xmin) + relative_t*vx)*dxi;
+ const double xmid = ((xp - xmin) + relative_time*vx)*dxi;
#endif
// j_j[xyz] leftmost grid point in x that the particle touches for the centering of each current
// sx_j[xyz] shape factor along x for the centering of each current
@@ -214,7 +214,7 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
#if defined(WARPX_DIM_3D)
// y direction
// Keep these double to avoid bug in single precision
- const double ymid = ( (yp - ymin) + relative_t*vy )*dyi;
+ const double ymid = ((yp - ymin) + relative_time*vy)*dyi;
double sy_node[depos_order + 1] = {0.};
double sy_cell[depos_order + 1] = {0.};
int k_node = 0;
@@ -241,7 +241,7 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
// z direction
// Keep these double to avoid bug in single precision
- const double zmid = ((zp - zmin) + relative_t*vz)*dzi;
+ const double zmid = ((zp - zmin) + relative_time*vz)*dzi;
double sz_node[depos_order + 1] = {0.};
double sz_cell[depos_order + 1] = {0.};
int l_node = 0;
@@ -348,6 +348,10 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
* \param Jx_arr,Jy_arr,Jz_arr Array4 of current density, either full array or tile.
* \param np_to_depose Number of particles for which current is deposited.
* \param dt Time step for particle level
+ * \param[in] relative_time Time at which to deposit J, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
* \param dx 3D cell size
* \param xyzmin Physical lower bounds of domain.
* \param lo Index lower bounds of domain.
@@ -368,6 +372,7 @@ void doEsirkepovDepositionShapeN (const GetParticlePosition& GetPosition,
const amrex::Array4<amrex::Real>& Jz_arr,
const long np_to_depose,
const amrex::Real dt,
+ const amrex::Real relative_time,
const std::array<amrex::Real,3>& dx,
const std::array<amrex::Real, 3> xyzmin,
const amrex::Dim3 lo,
@@ -391,19 +396,14 @@ void doEsirkepovDepositionShapeN (const GetParticlePosition& GetPosition,
#if !defined(WARPX_DIM_1D_Z)
Real const dxi = 1.0_rt / dx[0];
#endif
-#if !(defined WARPX_DIM_RZ || defined WARPX_DIM_1D_Z)
- Real const dtsdx0 = dt*dxi;
-#endif
#if !defined(WARPX_DIM_1D_Z)
Real const xmin = xyzmin[0];
#endif
#if defined(WARPX_DIM_3D)
Real const dyi = 1.0_rt / dx[1];
- Real const dtsdy0 = dt*dyi;
Real const ymin = xyzmin[1];
#endif
Real const dzi = 1.0_rt / dx[2];
- Real const dtsdz0 = dt*dzi;
Real const zmin = xyzmin[2];
#if defined(WARPX_DIM_3D)
@@ -469,17 +469,19 @@ void doEsirkepovDepositionShapeN (const GetParticlePosition& GetPosition,
// computes current and old position in grid units
#if defined(WARPX_DIM_RZ)
- Real const xp_mid = xp - 0.5_rt * dt*uxp[ip]*gaminv;
- Real const yp_mid = yp - 0.5_rt * dt*uyp[ip]*gaminv;
- Real const xp_old = xp - dt*uxp[ip]*gaminv;
- Real const yp_old = yp - dt*uyp[ip]*gaminv;
- Real const rp_new = std::sqrt(xp*xp + yp*yp);
+ Real const xp_new = xp + (relative_time + 0.5_rt*dt)*uxp[ip]*gaminv;
+ Real const yp_new = yp + (relative_time + 0.5_rt*dt)*uyp[ip]*gaminv;
+ Real const xp_mid = xp_new - 0.5_rt*dt*uxp[ip]*gaminv;
+ Real const yp_mid = yp_new - 0.5_rt*dt*uyp[ip]*gaminv;
+ Real const xp_old = xp_new - dt*uxp[ip]*gaminv;
+ Real const yp_old = yp_new - dt*uyp[ip]*gaminv;
+ Real const rp_new = std::sqrt(xp_new*xp_new + yp_new*yp_new);
Real const rp_mid = std::sqrt(xp_mid*xp_mid + yp_mid*yp_mid);
Real const rp_old = std::sqrt(xp_old*xp_old + yp_old*yp_old);
Real costheta_new, sintheta_new;
if (rp_new > 0._rt) {
- costheta_new = xp/rp_new;
- sintheta_new = yp/rp_new;
+ costheta_new = xp_new/rp_new;
+ sintheta_new = yp_new/rp_new;
} else {
costheta_new = 1._rt;
sintheta_new = 0._rt;
@@ -507,20 +509,20 @@ void doEsirkepovDepositionShapeN (const GetParticlePosition& GetPosition,
double const x_new = (rp_new - xmin)*dxi;
double const x_old = (rp_old - xmin)*dxi;
#else
- // Keep these double to avoid bug in single precision
#if !defined(WARPX_DIM_1D_Z)
- double const x_new = (xp - xmin)*dxi;
- double const x_old = x_new - dtsdx0*uxp[ip]*gaminv;
+ // Keep these double to avoid bug in single precision
+ double const x_new = (xp - xmin + (relative_time + 0.5_rt*dt)*uxp[ip]*gaminv)*dxi;
+ double const x_old = x_new - dt*dxi*uxp[ip]*gaminv;
#endif
#endif
#if defined(WARPX_DIM_3D)
// Keep these double to avoid bug in single precision
- double const y_new = (yp - ymin)*dyi;
- double const y_old = y_new - dtsdy0*uyp[ip]*gaminv;
+ double const y_new = (yp - ymin + (relative_time + 0.5_rt*dt)*uyp[ip]*gaminv)*dyi;
+ double const y_old = y_new - dt*dyi*uyp[ip]*gaminv;
#endif
// Keep these double to avoid bug in single precision
- double const z_new = (zp - zmin)*dzi;
- double const z_old = z_new - dtsdz0*uzp[ip]*gaminv;
+ double const z_new = (zp - zmin + (relative_time + 0.5_rt*dt)*uzp[ip]*gaminv)*dzi;
+ double const z_old = z_new - dt*dzi*uzp[ip]*gaminv;
#if defined(WARPX_DIM_RZ)
Real const vy = (-uxp[ip]*sintheta_mid + uyp[ip]*costheta_mid)*gaminv;
@@ -724,6 +726,10 @@ void doEsirkepovDepositionShapeN (const GetParticlePosition& GetPosition,
* \param[in,out] jx_fab,jy_fab,jz_fab FArrayBox of current density, either full array or tile
* \param[in] np_to_depose Number of particles for which current is deposited
* \param[in] dt Time step for particle level
+ * \param[in] relative_time Time at which to deposit J, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
* \param[in] dx 3D cell size
* \param[in] xyzmin 3D lower bounds of physical domain
* \param[in] lo Dimension-agnostic lower bounds of index domain
@@ -745,6 +751,7 @@ void doVayDepositionShapeN (const GetParticlePosition& GetPosition,
amrex::FArrayBox& jz_fab,
const long np_to_depose,
const amrex::Real dt,
+ const amrex::Real relative_time,
const std::array<amrex::Real,3>& dx,
const std::array<amrex::Real,3>& xyzmin,
const amrex::Dim3 lo,
@@ -756,14 +763,14 @@ void doVayDepositionShapeN (const GetParticlePosition& GetPosition,
#if defined(WARPX_DIM_RZ)
amrex::ignore_unused(GetPosition,
wp, uxp, uyp, uzp, ion_lev, jx_fab, jy_fab, jz_fab,
- np_to_depose, dt, dx, xyzmin, lo, q, n_rz_azimuthal_modes);
+ np_to_depose, dt, relative_time, dx, xyzmin, lo, q, n_rz_azimuthal_modes);
amrex::Abort("Vay deposition not implemented in RZ geometry");
#endif
#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(GetPosition,
wp, uxp, uyp, uzp, ion_lev, jx_fab, jy_fab, jz_fab,
- np_to_depose, dt, dx, xyzmin, lo, q, n_rz_azimuthal_modes);
+ np_to_depose, dt, relative_time, dx, xyzmin, lo, q, n_rz_azimuthal_modes);
amrex::Abort("Vay deposition not implemented in cartesian 1D geometry");
#endif
@@ -847,6 +854,11 @@ void doVayDepositionShapeN (const GetParticlePosition& GetPosition,
const amrex::Real vy = uyp[ip] * invgam;
const amrex::Real vz = uzp[ip] * invgam;
+ // Modify the particle position to match the time of the deposition
+ xp += relative_time * vx;
+ yp += relative_time * vy;
+ zp += relative_time * vz;
+
// Particle current densities
#if defined(WARPX_DIM_XZ)
const amrex::Real wqy = wq * vy * invvol;
@@ -854,16 +866,16 @@ void doVayDepositionShapeN (const GetParticlePosition& GetPosition,
// Current and old particle positions in grid units
// Keep these double to avoid bug in single precision.
- double const x_new = (xp - xmin) * dxi;
- double const x_old = x_new - vx * dt * dxi;
+ double const x_new = (xp - xmin + 0.5_rt*dt*vx) * dxi;
+ double const x_old = (xp - xmin - 0.5_rt*dt*vx) * dxi;
#if defined(WARPX_DIM_3D)
// Keep these double to avoid bug in single precision.
- double const y_new = (yp - ymin) * dyi;
- double const y_old = y_new - vy * dt * dyi;
+ double const y_new = (yp - ymin + 0.5_rt*dt*vy) * dyi;
+ double const y_old = (yp - ymin - 0.5_rt*dt*vy) * dyi;
#endif
// Keep these double to avoid bug in single precision.
- double const z_new = (zp - zmin) * dzi;
- double const z_old = z_new - vz * dt * dzi;
+ double const z_new = (zp - zmin + 0.5_rt*dt*vz) * dzi;
+ double const z_old = (zp - zmin - 0.5_rt*dt*vz) * dzi;
// Shape factor arrays for current and old positions (nodal)
// Keep these double to avoid bug in single precision.
diff --git a/Source/Particles/LaserParticleContainer.cpp b/Source/Particles/LaserParticleContainer.cpp
index e29a401d0..22ffb2a5f 100644
--- a/Source/Particles/LaserParticleContainer.cpp
+++ b/Source/Particles/LaserParticleContainer.cpp
@@ -601,22 +601,25 @@ LaserParticleContainer::Evolve (int lev,
amplitude_E.dataPtr(), dt);
WARPX_PROFILE_VAR_STOP(blp_pp);
- //
// Current Deposition
- //
- // Deposit inside domains
- if (! skip_deposition ) {
+ if (skip_deposition == false)
+ {
+ // Deposit at t_{n+1/2}
+ amrex::Real relative_time = -0.5_rt * dt;
+
int* ion_lev = nullptr;
+ // Deposit inside domains
DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, &jx, &jy, &jz,
0, np_current, thread_num,
- lev, lev, dt, -0.5_rt); // Deposit current at t_{n+1/2}
+ lev, lev, dt, relative_time);
- bool has_buffer = cjx;
- if (has_buffer){
+ const 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, -0.5_rt); // Deposit current at t_{n+1/2}
+ lev, lev-1, dt, relative_time);
}
}
diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H
index 56f1b42ff..a05cde60b 100644
--- a/Source/Particles/MultiParticleContainer.H
+++ b/Source/Particles/MultiParticleContainer.H
@@ -137,38 +137,34 @@ public:
* \brief Deposit charge density.
*
* \param[in,out] rho vector of charge densities (one pointer to MultiFab per mesh refinement level)
- * \param[in] relative_t Time at which to deposit rho, relative to the time
- * of the current positions of the particles (expressed as
- * a fraction of dt). When different than 0, the particle
- * position will be temporarily modified to match the time
- * of the deposition.
+ * \param[in] relative_time Time at which to deposit rho, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
*/
void
DepositCharge (amrex::Vector<std::unique_ptr<amrex::MultiFab> >& rho,
- const amrex::Real relative_t);
+ const amrex::Real relative_time);
/**
* \brief Deposit current density.
*
* \param[in,out] J vector of current densities (one three-dimensional array of pointers
* to MultiFabs per mesh refinement level)
- * \param[in] dt: Time step for particle level (is used when temporarily
- * modifying the particle positions, either within the
- * Esirkepov or when `relative_t` is different than 0
- * \param[in] relative_t: Time at which to deposit J, relative to the time of
- * the current positions of the particles (expressed as
- * a fraction of dt). When different than 0, the particle
- * position will be temporarily modified to match the
- * time of the deposition.
+ * \param[in] dt Time step for particle level
+ * \param[in] relative_time Time at which to deposit J, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
*/
void
DepositCurrent (amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > >& J,
- const amrex::Real dt, const amrex::Real relative_t);
+ const amrex::Real dt, const amrex::Real relative_time);
///
/// This deposits the particle charge onto a node-centered MultiFab and returns a unique ptr
/// to it. The charge density is accumulated over all the particles in the MultiParticleContainer
- ///
+
std::unique_ptr<amrex::MultiFab> GetChargeDensity(int lev, bool local = false);
void doFieldIonization (int lev,
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index 78d6c7179..da1c692ba 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -475,7 +475,7 @@ MultiParticleContainer::GetZeroChargeDensity (const int lev)
void
MultiParticleContainer::DepositCurrent (
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > >& J,
- const amrex::Real dt, const amrex::Real relative_t)
+ const amrex::Real dt, const amrex::Real relative_time)
{
// Reset the J arrays
for (int lev = 0; lev < J.size(); ++lev)
@@ -488,7 +488,7 @@ MultiParticleContainer::DepositCurrent (
// Call the deposition kernel for each species
for (auto& pc : allcontainers)
{
- pc->DepositCurrent(J, dt, relative_t);
+ pc->DepositCurrent(J, dt, relative_time);
}
#ifdef WARPX_DIM_RZ
@@ -502,7 +502,7 @@ MultiParticleContainer::DepositCurrent (
void
MultiParticleContainer::DepositCharge (
amrex::Vector<std::unique_ptr<amrex::MultiFab> >& rho,
- const amrex::Real relative_t)
+ const amrex::Real relative_time)
{
// Reset the rho array
for (int lev = 0; lev < rho.size(); ++lev)
@@ -511,7 +511,7 @@ MultiParticleContainer::DepositCharge (
}
// Push the particles in time, if needed
- if (relative_t != 0.) PushX(relative_t);
+ if (relative_time != 0.) PushX(relative_time);
// Call the deposition kernel for each species
for (auto& pc : allcontainers)
@@ -525,7 +525,7 @@ MultiParticleContainer::DepositCharge (
}
// Push the particles back in time
- if (relative_t != 0.) PushX(-relative_t);
+ if (relative_time != 0.) PushX(-relative_time);
#ifdef WARPX_DIM_RZ
for (int lev = 0; lev < rho.size(); ++lev)
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index cd22465df..ccd5edf6c 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -1852,10 +1852,12 @@ PhysicalParticleContainer::Evolve (int lev,
WARPX_PROFILE_VAR_STOP(blp_fg);
- //
// Current Deposition
- //
- if (! skip_deposition) {
+ if (skip_deposition == false)
+ {
+ // Deposit at t_{n+1/2}
+ amrex::Real relative_time = -0.5_rt * dt;
+
int* AMREX_RESTRICT ion_lev;
if (do_field_ionization){
ion_lev = pti.GetiAttribs(particle_icomps["ionizationLevel"]).dataPtr();
@@ -1865,12 +1867,14 @@ PhysicalParticleContainer::Evolve (int lev,
// Deposit inside domains
DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, &jx, &jy, &jz,
0, np_current, thread_num,
- lev, lev, dt, -0.5_rt); // Deposit current at t_{n+1/2}
- if (has_buffer){
+ lev, lev, dt, relative_time);
+
+ 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, -0.5_rt); // Deposit current at t_{n+1/2}
+ lev, lev-1, dt, relative_time);
}
} // end of "if do_electrostatic == ElectrostaticSolverAlgo::None"
} // end of "if do_not_push"
diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H
index 9ec893fc2..be0a20658 100644
--- a/Source/Particles/WarpXParticleContainer.H
+++ b/Source/Particles/WarpXParticleContainer.H
@@ -43,6 +43,8 @@
#include <string>
#include <utility>
+using namespace amrex::literals;
+
namespace ParticleStringNames
{
const std::map<std::string, int> to_index = {
@@ -176,17 +178,14 @@ public:
*
* \param[in,out] J vector of current densities (one three-dimensional array of pointers
* to MultiFabs per mesh refinement level)
- * \param[in] dt: Time step for particle level (is used when temporarily
- * modifying the particle positions, either within the
- * Esirkepov or when `relative_t` is different than 0
- * \param[in] relative_t: Time at which to deposit J, relative to the time
- * of the current positions of the particles (expressed as
- * a fraction of dt). When different than 0, the particle
- * position will be temporarily modified to match the
- * time of the deposition.
+ * \param[in] dt Time step for particle level
+ * \param[in] relative_time Time at which to deposit J, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
*/
void DepositCurrent (amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > >& J,
- const amrex::Real dt, const amrex::Real relative_t);
+ const amrex::Real dt, const amrex::Real relative_time);
/**
* \brief Deposit charge density.
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp
index 6ca49aaf3..1d057f5a2 100644
--- a/Source/Particles/WarpXParticleContainer.cpp
+++ b/Source/Particles/WarpXParticleContainer.cpp
@@ -290,11 +290,10 @@ WarpXParticleContainer::AddNParticles (int /*lev*/,
* \param lev : Level of box that contains particles
* \param depos_lev : Level on which particles deposit (if buffers are used)
* \param dt : Time step for particle level
- * \param relative_time: Time at which to deposit J, relative to the time of
- * the current positions of the particles (expressed as
- * a fraction of dt). When different than 0, the particle
- * position will be temporarily modified to match the
- * time of the deposition.
+ * \param relative_time: Time at which to deposit J, relative to the time of the
+ * current positions of the particles. When different than 0,
+ * the particle position will be temporarily modified to match
+ * the time of the deposition.
*/
void
WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
@@ -421,14 +420,6 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
if (WarpX::do_nodal==1) {
amrex::Abort("The Esirkepov algorithm cannot be used with a nodal grid.");
}
- if ( relative_time != -0.5_rt ) {
- amrex::Abort("The Esirkepov deposition cannot be performed at another time then -0.5 dt.");
- }
- }
- if (WarpX::current_deposition_algo == CurrentDepositionAlgo::Vay) {
- if ( relative_time != -0.5_rt ) {
- amrex::Abort("The Esirkepov deposition cannot be performed at another time then -0.5 dt.");
- }
}
WARPX_PROFILE_VAR_START(blp_deposit);
@@ -440,21 +431,21 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
doEsirkepovDepositionShapeN<1>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_arr, jy_arr, jz_arr, np_to_depose, dt, dx, xyzmin, lo, q,
+ jx_arr, jy_arr, jz_arr, np_to_depose, dt, relative_time, dx, xyzmin, lo, q,
WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
} else if (WarpX::nox == 2){
doEsirkepovDepositionShapeN<2>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_arr, jy_arr, jz_arr, np_to_depose, dt, dx, xyzmin, lo, q,
+ jx_arr, jy_arr, jz_arr, np_to_depose, dt, relative_time, dx, xyzmin, lo, q,
WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
} else if (WarpX::nox == 3){
doEsirkepovDepositionShapeN<3>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_arr, jy_arr, jz_arr, np_to_depose, dt, dx, xyzmin, lo, q,
+ jx_arr, jy_arr, jz_arr, np_to_depose, dt, relative_time, dx, xyzmin, lo, q,
WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
}
@@ -463,21 +454,21 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
doVayDepositionShapeN<1>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_fab, jy_fab, jz_fab, np_to_depose, dt, dx, xyzmin, lo, q,
+ jx_fab, jy_fab, jz_fab, np_to_depose, dt, relative_time, dx, xyzmin, lo, q,
WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
} else if (WarpX::nox == 2){
doVayDepositionShapeN<2>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_fab, jy_fab, jz_fab, np_to_depose, dt, dx, xyzmin, lo, q,
+ jx_fab, jy_fab, jz_fab, np_to_depose, dt, relative_time, dx, xyzmin, lo, q,
WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
} else if (WarpX::nox == 3){
doVayDepositionShapeN<3>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_fab, jy_fab, jz_fab, np_to_depose, dt, dx, xyzmin, lo, q,
+ jx_fab, jy_fab, jz_fab, np_to_depose, dt, relative_time, dx, xyzmin, lo, q,
WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
}
@@ -486,21 +477,21 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
doDepositionShapeN<1>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_fab, jy_fab, jz_fab, np_to_depose, dt*relative_time, dx,
+ jx_fab, jy_fab, jz_fab, np_to_depose, relative_time, dx,
xyzmin, lo, q, WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
} else if (WarpX::nox == 2){
doDepositionShapeN<2>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_fab, jy_fab, jz_fab, np_to_depose, dt*relative_time, dx,
+ jx_fab, jy_fab, jz_fab, np_to_depose, relative_time, dx,
xyzmin, lo, q, WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
} else if (WarpX::nox == 3){
doDepositionShapeN<3>(
GetPosition, wp.dataPtr() + offset, uxp.dataPtr() + offset,
uyp.dataPtr() + offset, uzp.dataPtr() + offset, ion_lev,
- jx_fab, jy_fab, jz_fab, np_to_depose, dt*relative_time, dx,
+ jx_fab, jy_fab, jz_fab, np_to_depose, relative_time, dx,
xyzmin, lo, q, WarpX::n_rz_azimuthal_modes, cost,
WarpX::load_balance_costs_update_algo);
}
@@ -520,7 +511,7 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
void
WarpXParticleContainer::DepositCurrent (
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > >& J,
- const amrex::Real dt, const amrex::Real relative_t)
+ const amrex::Real dt, const amrex::Real relative_time)
{
// Loop over the refinement levels
int const finest_level = J.size() - 1;
@@ -550,7 +541,7 @@ WarpXParticleContainer::DepositCurrent (
DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev,
J[lev][0].get(), J[lev][1].get(), J[lev][2].get(),
- 0, np, thread_num, lev, lev, dt, relative_t/dt);
+ 0, np, thread_num, lev, lev, dt, relative_time);
}
#ifdef AMREX_USE_OMP
}