aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/Tests/Langmuir/inputs.multi.rz.rt2
-rw-r--r--Source/Evolve/WarpXEvolveEM.cpp7
-rw-r--r--Source/FieldSolver/WarpXPushFieldsEM.cpp97
-rw-r--r--Source/FortranInterface/WarpX_picsar.F9050
-rw-r--r--Source/Particles/Deposition/CurrentDeposition.H52
-rw-r--r--Source/Particles/Gather/FieldGather.H18
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp13
-rw-r--r--Source/WarpX.H7
-rw-r--r--Source/WarpX.cpp2
9 files changed, 168 insertions, 80 deletions
diff --git a/Examples/Tests/Langmuir/inputs.multi.rz.rt b/Examples/Tests/Langmuir/inputs.multi.rz.rt
index e4099f9c5..1838f06f5 100644
--- a/Examples/Tests/Langmuir/inputs.multi.rz.rt
+++ b/Examples/Tests/Langmuir/inputs.multi.rz.rt
@@ -26,6 +26,8 @@ warpx.verbose = 1
# Algorithms
algo.field_gathering = standard
+algo.current_deposition = esirkepov
+algo.use_picsar_deposition = 0
# Interpolation
interpolation.nox = 1
diff --git a/Source/Evolve/WarpXEvolveEM.cpp b/Source/Evolve/WarpXEvolveEM.cpp
index 32a4747db..57a0c44c0 100644
--- a/Source/Evolve/WarpXEvolveEM.cpp
+++ b/Source/Evolve/WarpXEvolveEM.cpp
@@ -481,6 +481,13 @@ WarpX::PushParticlesandDepose (int lev, Real cur_time)
Efield_cax[lev][0].get(), Efield_cax[lev][1].get(), Efield_cax[lev][2].get(),
Bfield_cax[lev][0].get(), Bfield_cax[lev][1].get(), Bfield_cax[lev][2].get(),
cur_time, dt[lev]);
+#ifdef WARPX_DIM_RZ
+ // This is called after all particles have deposited their current.
+ ApplyInverseVolumeScalingToCurrentDensity(current_fp[lev][0].get(), current_fp[lev][1].get(), current_fp[lev][2].get(), lev);
+ if (current_buf[lev][0].get()) {
+ ApplyInverseVolumeScalingToCurrentDensity(current_buf[lev][0].get(), current_buf[lev][1].get(), current_buf[lev][2].get(), lev-1);
+ }
+#endif
}
void
diff --git a/Source/FieldSolver/WarpXPushFieldsEM.cpp b/Source/FieldSolver/WarpXPushFieldsEM.cpp
index 475f7a1dd..787e61f11 100644
--- a/Source/FieldSolver/WarpXPushFieldsEM.cpp
+++ b/Source/FieldSolver/WarpXPushFieldsEM.cpp
@@ -575,3 +575,100 @@ WarpX::EvolveF (int lev, PatchType patch_type, Real a_dt, DtType a_dt_type)
}
}
}
+
+#ifdef WARPX_DIM_RZ
+// This scales the current by the inverse volume and wraps around the depostion at negative radius.
+// It is faster to apply this on the grid than to do it particle by particle.
+// It is put here since there isn't another nice place for it.
+void
+WarpX::ApplyInverseVolumeScalingToCurrentDensity (MultiFab* Jx, MultiFab* Jy, MultiFab* Jz, int lev)
+{
+ const long ngJ = Jx->nGrow();
+ const std::array<Real,3>& dx = WarpX::CellSize(lev);
+ const Real dr = dx[0];
+
+ Box tilebox;
+
+ for ( MFIter mfi(*Jx, TilingIfNotGPU()); mfi.isValid(); ++mfi )
+ {
+
+ Array4<Real> const& Jr_arr = Jx->array(mfi);
+ Array4<Real> const& Jt_arr = Jy->array(mfi);
+ Array4<Real> const& Jz_arr = Jz->array(mfi);
+
+ tilebox = mfi.tilebox();
+ Box tbr = convert(tilebox, WarpX::jx_nodal_flag);
+ Box tbt = convert(tilebox, WarpX::jy_nodal_flag);
+ Box tbz = convert(tilebox, WarpX::jz_nodal_flag);
+
+ // Lower corner of tile box physical domain
+ // Note that this is done before the tilebox.grow so that
+ // these do not include the guard cells.
+ const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(tilebox, lev);
+ const Dim3 lo = lbound(tilebox);
+ const Real rmin = xyzmin[0];
+ const int irmin = lo.x;
+
+ tilebox.grow(ngJ);
+
+ // Rescale current in r-z mode since the inverse volume factor was not
+ // included in the current deposition.
+ amrex::ParallelFor(tbr,
+ [=] AMREX_GPU_DEVICE (int i, int j, int k)
+ {
+ // Wrap the current density deposited in the guard cells around
+ // to the cells above the axis.
+ // Note that Jr(i==0) is at 1/2 dr.
+ if (rmin == 0. && 0 <= i && i < ngJ) {
+ Jr_arr(i,j,0) -= Jr_arr(-1-i,j,0);
+ }
+ // Apply the inverse volume scaling
+ // Since Jr is not cell centered in r, no need for distinction
+ // between on axis and off-axis factors
+ const amrex::Real r = std::abs(rmin + (i - irmin + 0.5)*dr);
+ Jr_arr(i,j,0) /= (2.*MathConst::pi*r);
+ });
+ amrex::ParallelFor(tbt,
+ [=] AMREX_GPU_DEVICE (int i, int j, int k)
+ {
+ // Wrap the current density deposited in the guard cells around
+ // to the cells above the axis.
+ // Jt is located on the boundary
+ if (rmin == 0. && 0 < i && i <= ngJ) {
+ Jt_arr(i,j,0) += Jt_arr(-i,j,0);
+ }
+
+ // Apply the inverse volume scaling
+ // Jt is forced to zero on axis.
+ const amrex::Real r = std::abs(rmin + (i - irmin)*dr);
+ if (r == 0.) {
+ Jt_arr(i,j,0) = 0.;
+ } else {
+ Jt_arr(i,j,0) /= (2.*MathConst::pi*r);
+ }
+ });
+ amrex::ParallelFor(tbz,
+ [=] AMREX_GPU_DEVICE (int i, int j, int k)
+ {
+ /* if (j == 5) std::cout << "Jz " << i << " " << Jz_arr(i,j,0) << "\n"; */
+ // Wrap the current density deposited in the guard cells around
+ // to the cells above the axis.
+ // Jz is located on the boundary
+ if (rmin == 0. && 0 < i && i <= ngJ) {
+ Jz_arr(i,j,0) += Jz_arr(-i,j,0);
+ }
+
+ // Apply the inverse volume scaling
+ const amrex::Real r = std::abs(rmin + (i - irmin)*dr);
+ if (r == 0.) {
+ // Verboncoeur JCP 164, 421-427 (2001) : corrected volume on axis
+ Jz_arr(i,j,0) /= (MathConst::pi*dr/3.);
+ // Alternative (when order in r is limited one, which is not implemented)
+ // Jz_arr(i,j,0) /= (MathConst::pi*dr/4.);
+ } else {
+ Jz_arr(i,j,0) /= (2.*MathConst::pi*r);
+ }
+ });
+ }
+}
+#endif
diff --git a/Source/FortranInterface/WarpX_picsar.F90 b/Source/FortranInterface/WarpX_picsar.F90
index 3b2fc97a7..14bd79ad4 100644
--- a/Source/FortranInterface/WarpX_picsar.F90
+++ b/Source/FortranInterface/WarpX_picsar.F90
@@ -10,7 +10,6 @@
#define WRPX_PXR_GETEB_ENERGY_CONSERVING geteb2drz_energy_conserving_generic
#define WRPX_PXR_CURRENT_DEPOSITION depose_jrjtjz_generic_rz
#define WRPX_PXR_RZ_VOLUME_SCALING_RHO apply_rz_volume_scaling_rho
-#define WRPX_PXR_RZ_VOLUME_SCALING_J apply_rz_volume_scaling_j
#else
@@ -355,53 +354,4 @@ subroutine warpx_charge_deposition(rho,np,xp,yp,zp,w,q,xmin,ymin,zmin,dx,dy,dz,n
end subroutine warpx_current_deposition
- ! _________________________________________________________________
- !>
- !> @brief
- !> Applies the inverse volume scaling for RZ current deposition
- !>
- !> @details
- !> The scaling is done for single mode only
- !
- !> @param[inout] jx,jy,jz current arrays
- !> @param[in] jx_ntot,jy_ntot,jz_ntot vectors with total number of
- !> cells (including guard cells) along each axis for each current
- !> @param[in] jx_ng,jy_ng,jz_ng vectors with number of guard cells along each
- !> axis for each current
- !> @param[in] rmin tile grid minimum radius
- !> @param[in] dr radial space discretization steps
- !>
- subroutine warpx_current_deposition_rz_volume_scaling( &
- jx,jx_ng,jx_ntot,jy,jy_ng,jy_ntot,jz,jz_ng,jz_ntot, &
- rmin,dr) &
- bind(C, name="warpx_current_deposition_rz_volume_scaling")
-
- integer, intent(in) :: jx_ntot(AMREX_SPACEDIM), jy_ntot(AMREX_SPACEDIM), jz_ntot(AMREX_SPACEDIM)
- integer(c_long), intent(in) :: jx_ng, jy_ng, jz_ng
- real(amrex_real), intent(IN OUT):: jx(*), jy(*), jz(*)
- real(amrex_real), intent(IN) :: rmin, dr
-
-#ifdef WARPX_RZ
- integer(c_long) :: type_rz_depose = 1
-#endif
- ! Compute the number of valid cells and guard cells
- integer(c_long) :: jx_nvalid(AMREX_SPACEDIM), jy_nvalid(AMREX_SPACEDIM), jz_nvalid(AMREX_SPACEDIM), &
- jx_nguards(AMREX_SPACEDIM), jy_nguards(AMREX_SPACEDIM), jz_nguards(AMREX_SPACEDIM)
- jx_nvalid = jx_ntot - 2*jx_ng
- jy_nvalid = jy_ntot - 2*jy_ng
- jz_nvalid = jz_ntot - 2*jz_ng
- jx_nguards = jx_ng
- jy_nguards = jy_ng
- jz_nguards = jz_ng
-
-#ifdef WARPX_RZ
- CALL WRPX_PXR_RZ_VOLUME_SCALING_J( &
- jx,jx_nguards,jx_nvalid, &
- jy,jy_nguards,jy_nvalid, &
- jz,jz_nguards,jz_nvalid, &
- rmin,dr,type_rz_depose)
-#endif
-
- end subroutine warpx_current_deposition_rz_volume_scaling
-
end module warpx_to_pxr_module
diff --git a/Source/Particles/Deposition/CurrentDeposition.H b/Source/Particles/Deposition/CurrentDeposition.H
index 9b9853902..7acece58b 100644
--- a/Source/Particles/Deposition/CurrentDeposition.H
+++ b/Source/Particles/Deposition/CurrentDeposition.H
@@ -42,7 +42,7 @@ void doDepositionShapeN(const amrex::Real * const xp,
const amrex::Real dts2dz = 0.5*dt*dzi;
#if (AMREX_SPACEDIM == 2)
const amrex::Real invvol = dxi*dzi;
-#else // (AMREX_SPACEDIM == 3)
+#elif (defined WARPX_DIM_3D)
const amrex::Real dyi = 1.0/dx[1];
const amrex::Real dts2dy = 0.5*dt*dyi;
const amrex::Real invvol = dxi*dyi*dzi;
@@ -83,7 +83,7 @@ void doDepositionShapeN(const amrex::Real * const xp,
// j0: leftmost grid point (cell-centered) that the particle touches
const int j0 = compute_shape_factor<depos_order>(sx0, xmid-stagger_shift);
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
// y direction
const amrex::Real ymid= (yp[ip]-ymin)*dyi-dts2dy*vy;
amrex::Real AMREX_RESTRICT sy [depos_order + 1];
@@ -99,7 +99,7 @@ void doDepositionShapeN(const amrex::Real * const xp,
const int l0 = compute_shape_factor<depos_order>(sz0, zmid-stagger_shift);
// Deposit current into jx_arr, jy_arr and jz_arr
-#if (AMREX_SPACEDIM == 2)
+#if (defined WARPX_DIM_2D)
for (int iz=0; iz<=depos_order; iz++){
for (int ix=0; ix<=depos_order; ix++){
amrex::Gpu::Atomic::Add(
@@ -113,7 +113,7 @@ void doDepositionShapeN(const amrex::Real * const xp,
sx [ix]*sz0[iz]*wqz);
}
}
-#else // (AMREX_SPACEDIM == 3)
+#elif (defined WARPX_DIM_3D)
for (int iz=0; iz<=depos_order; iz++){
for (int iy=0; iy<=depos_order; iy++){
for (int ix=0; ix<=depos_order; ix++){
@@ -169,7 +169,7 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
const amrex::Real dxi = 1.0/dx[0];
const amrex::Real dtsdx0 = dt*dxi;
const amrex::Real xmin = xyzmin[0];
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
const amrex::Real dyi = 1.0/dx[1];
const amrex::Real dtsdy0 = dt*dyi;
const amrex::Real ymin = xyzmin[1];
@@ -178,11 +178,11 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
const amrex::Real dtsdz0 = dt*dzi;
const amrex::Real zmin = xyzmin[2];
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
const amrex::Real invdtdx = 1.0/(dt*dx[1]*dx[2]);
const amrex::Real invdtdy = 1.0/(dt*dx[0]*dx[2]);
const amrex::Real invdtdz = 1.0/(dt*dx[0]*dx[1]);
-#elif (AMREX_SPACEDIM == 2)
+#elif (defined WARPX_DIM_2D) || (defined WARPX_DIM_RZ)
const amrex::Real invdtdx = 1.0/(dt*dx[2]);
const amrex::Real invdtdz = 1.0/(dt*dx[0]);
const amrex::Real invvol = 1.0/(dx[0]*dx[2]);
@@ -197,34 +197,49 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
// --- Get particle quantities
const amrex::Real gaminv = 1.0/std::sqrt(1.0 + uxp[ip]*uxp[ip]*clightsq
- + uyp[ip]*uyp[ip]*clightsq
- + uzp[ip]*uzp[ip]*clightsq);
+ + uyp[ip]*uyp[ip]*clightsq
+ + uzp[ip]*uzp[ip]*clightsq);
// wqx, wqy wqz are particle current in each direction
const amrex::Real wq = q*wp[ip];
const amrex::Real wqx = wq*invdtdx;
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
const amrex::Real wqy = wq*invdtdy;
#endif
const amrex::Real wqz = wq*invdtdz;
// computes current and old position in grid units
+#if (defined WARPX_DIM_RZ)
+ const amrex::Real r_new = std::sqrt(xp[ip]*xp[ip] + yp[ip]*yp[ip]);
+ const amrex::Real r_old = std::sqrt((xp[ip] - dt*uxp[ip]*gaminv)*(xp[ip] - dt*uxp[ip]*gaminv) +
+ (yp[ip] - dt*uyp[ip]*gaminv)*(yp[ip] - dt*uyp[ip]*gaminv));
+ const amrex::Real x_new = (r_new - xmin)*dxi;
+ const amrex::Real x_old = (r_old - xmin)*dxi;
+#else
const amrex::Real x_new = (xp[ip] - xmin)*dxi;
const amrex::Real x_old = x_new - dtsdx0*uxp[ip]*gaminv;
-#if (AMREX_SPACEDIM == 3)
+#endif
+#if (defined WARPX_DIM_3D)
const amrex::Real y_new = (yp[ip] - ymin)*dyi;
const amrex::Real y_old = y_new - dtsdy0*uyp[ip]*gaminv;
#endif
const amrex::Real z_new = (zp[ip] - zmin)*dzi;
const amrex::Real z_old = z_new - dtsdz0*uzp[ip]*gaminv;
+#if (defined WARPX_DIM_RZ)
+ const amrex::Real theta = std::atan2(yp[ip], xp[ip]);
+ const amrex::Real vy = (-uxp[ip]*std::sin(theta) + uyp[ip]*std::cos(theta))*gaminv;
+#elif (defined WARPX_DIM_2D)
+ const amrex::Real vy = uyp[ip]*gaminv;
+#endif
+
// Shape factor arrays
// Note that there are extra values above and below
// to possibly hold the factor for the old particle
// which can be at a different grid location.
amrex::Real AMREX_RESTRICT sx_new[depos_order + 3] = {0.};
amrex::Real AMREX_RESTRICT sx_old[depos_order + 3] = {0.};
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
amrex::Real AMREX_RESTRICT sy_new[depos_order + 3] = {0.};
amrex::Real AMREX_RESTRICT sy_old[depos_order + 3] = {0.};
#endif
@@ -236,7 +251,7 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
// [ijk]_new: leftmost grid point that the particle touches
const int i_new = compute_shape_factor<depos_order>(sx_new+1, x_new);
const int i_old = compute_shifted_shape_factor<depos_order>(sx_old, x_old, i_new);
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
const int j_new = compute_shape_factor<depos_order>(sy_new+1, y_new);
const int j_old = compute_shifted_shape_factor<depos_order>(sy_old, y_old, j_new);
#endif
@@ -247,7 +262,7 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
int dil = 1, diu = 1;
if (i_old < i_new) dil = 0;
if (i_old > i_new) diu = 0;
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
int djl = 1, dju = 1;
if (j_old < j_new) djl = 0;
if (j_old > j_new) dju = 0;
@@ -256,7 +271,7 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
if (k_old < k_new) dkl = 0;
if (k_old > k_new) dku = 0;
-#if (AMREX_SPACEDIM == 3)
+#if (defined WARPX_DIM_3D)
for (int k=dkl; k<=depos_order+2-dku; k++) {
for (int j=djl; j<=depos_order+2-dju; j++) {
@@ -289,7 +304,7 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
}
}
-#elif (AMREX_SPACEDIM == 2)
+#elif (defined WARPX_DIM_2D) || (defined WARPX_DIM_RZ)
for (int k=dkl; k<=depos_order+2-dku; k++) {
amrex::Real sdxi = 0.;
@@ -300,8 +315,8 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
}
for (int k=dkl; k<=depos_order+2-dku; k++) {
for (int i=dil; i<=depos_order+2-diu; i++) {
- const amrex::Real sdyj = wq*uyp[ip]*gaminv*invvol*((sz_new[k] + 0.5*(sz_old[k] - sz_new[k]))*sx_new[i] +
- (0.5*sz_new[k] + 1./3.*(sz_old[k] - sz_new[k]))*(sx_old[i] - sx_new[i]));
+ const amrex::Real sdyj = wq*vy*invvol*((sz_new[k] + 0.5*(sz_old[k] - sz_new[k]))*sx_new[i] +
+ (0.5*sz_new[k] + 1./3.*(sz_old[k] - sz_new[k]))*(sx_old[i] - sx_new[i]));
amrex::Gpu::Atomic::Add( &Jy_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0), sdyj);
}
}
@@ -313,6 +328,7 @@ void doEsirkepovDepositionShapeN (const amrex::Real * const xp,
}
}
+
#endif
}
);
diff --git a/Source/Particles/Gather/FieldGather.H b/Source/Particles/Gather/FieldGather.H
index be96dd393..5c1786d86 100644
--- a/Source/Particles/Gather/FieldGather.H
+++ b/Source/Particles/Gather/FieldGather.H
@@ -42,7 +42,9 @@ void doGatherShapeN(const amrex::Real * const xp,
#endif
const amrex::Real xmin = xyzmin[0];
+#if (AMREX_SPACEDIM == 3)
const amrex::Real ymin = xyzmin[1];
+#endif
const amrex::Real zmin = xyzmin[2];
// Loop over particles and gather fields from
@@ -53,7 +55,11 @@ void doGatherShapeN(const amrex::Real * const xp,
// --- Compute shape factors
// x direction
// Get particle position
+#ifdef WARPX_DIM_RZ
+ const amrex::Real x = (std::sqrt(xp[ip]*xp[ip] + yp[ip]*yp[ip]) - xmin)*dxi;
+#else
const amrex::Real x = (xp[ip]-xmin)*dxi;
+#endif
// Compute shape factors for node-centered quantities
amrex::Real AMREX_RESTRICT sx [depos_order + 1];
// j: leftmost grid point (node-centered) that particle touches
@@ -126,6 +132,18 @@ void doGatherShapeN(const amrex::Real * const xp,
by_arr(lo.x+j0+ix, lo.y+l0+iz, 0);
}
}
+
+#ifdef WARPX_DIM_RZ
+ // Convert Exp and Eyp (which are actually Erp and Ethetap) to Ex and Ey
+ const amrex::Real theta = std::atan2(yp[ip], xp[ip]);
+ const amrex::Real Exp_save = Exp[ip];
+ Exp[ip] = std::cos(theta)*Exp[ip] - std::sin(theta)*Eyp[ip];
+ Eyp[ip] = std::cos(theta)*Eyp[ip] + std::sin(theta)*Exp_save;
+ const amrex::Real Bxp_save = Bxp[ip];
+ Bxp[ip] = std::cos(theta)*Bxp[ip] - std::sin(theta)*Byp[ip];
+ Byp[ip] = std::cos(theta)*Byp[ip] + std::sin(theta)*Bxp_save;
+#endif
+
#else // (AMREX_SPACEDIM == 3)
// Gather field on particle Exp[i] from field on grid ex_arr
for (int iz=0; iz<=depos_order; iz++){
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp
index 89f233b2c..f6c7afed5 100644
--- a/Source/Particles/WarpXParticleContainer.cpp
+++ b/Source/Particles/WarpXParticleContainer.cpp
@@ -47,7 +47,7 @@ WarpXParIter::SetPosition (const Cuda::ManagedDeviceVector<Real>& x, const Cuda:
#ifdef WARPX_RZ
auto& attribs = GetAttribs();
auto& theta = attribs[PIdx::theta];
- Cuda::DeviceVector<Real> r(x.size());
+ Cuda::ManagedDeviceVector<Real> r(x.size());
for (unsigned int i=0 ; i < x.size() ; i++) {
theta[i] = std::atan2(y[i], x[i]);
r[i] = std::sqrt(x[i]*x[i] + y[i]*y[i]);
@@ -394,14 +394,6 @@ WarpXParticleContainer::DepositCurrentFortran(WarpXParIter& pti,
&WarpX::nox,&WarpX::noy,&WarpX::noz, &j_is_nodal,
&lvect,&WarpX::current_deposition_algo);
-#ifdef WARPX_RZ
- // Rescale current in r-z mode
- warpx_current_deposition_rz_volume_scaling(
- jx_ptr, &ngJ, jxntot.getVect(),
- jy_ptr, &ngJ, jyntot.getVect(),
- jz_ptr, &ngJ, jzntot.getVect(),
- &xyzmin[0], &dx[0]);
-#endif
BL_PROFILE_VAR_STOP(blp_pxr_cd);
#ifndef AMREX_USE_GPU
@@ -503,7 +495,8 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti,
Real* AMREX_RESTRICT yp = m_yp[thread_num].dataPtr() + offset;
// Lower corner of tile box physical domain
- const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(tilebox, depos_lev);;
+ // Note that this includes guard cells since it is after tilebox.ngrow
+ const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(tilebox, depos_lev);
// xyzmin is built on pti.tilebox(), so it does
// not include staggering, so the stagger_shift has to be done by hand.
// Alternatively, we could define xyzminx from tbx (and the same for 3
diff --git a/Source/WarpX.H b/Source/WarpX.H
index a25eef9e4..dde2278d7 100644
--- a/Source/WarpX.H
+++ b/Source/WarpX.H
@@ -178,6 +178,13 @@ public:
void EvolveE (int lev, PatchType patch_type, amrex::Real dt);
void EvolveF (int lev, PatchType patch_type, amrex::Real dt, DtType dt_type);
+#ifdef WARPX_DIM_RZ
+ void ApplyInverseVolumeScalingToCurrentDensity(amrex::MultiFab* Jx,
+ amrex::MultiFab* Jy,
+ amrex::MultiFab* Jz,
+ int lev);
+#endif
+
void DampPML ();
void DampPML (int lev);
void DampPML (int lev, PatchType patch_type);
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 1f5ade13a..18252cb64 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -499,9 +499,7 @@ WarpX::ReadParameters ()
// If not in RZ mode, read use_picsar_deposition
// In RZ mode, use_picsar_deposition is on, as the C++ version
// of the deposition does not support RZ
-#ifndef WARPX_RZ
pp.query("use_picsar_deposition", use_picsar_deposition);
-#endif
current_deposition_algo = GetAlgorithmInteger(pp, "current_deposition");
charge_deposition_algo = GetAlgorithmInteger(pp, "charge_deposition");
field_gathering_algo = GetAlgorithmInteger(pp, "field_gathering");