aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp96
1 files changed, 47 insertions, 49 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp
index 3421fb9f5..3f0e0bcba 100644
--- a/Source/Particles/WarpXParticleContainer.cpp
+++ b/Source/Particles/WarpXParticleContainer.cpp
@@ -575,7 +575,7 @@ WarpXParticleContainer::DepositCurrent (
1: new value (after particle push).
* \param offset : Index of first particle for which charge is deposited
* \param np_to_depose: Number of particles for which charge is deposited.
- Particles [offset,offset+np_tp_depose] deposit charge
+ Particles [offset,offset+np_tp_depose) deposit charge
* \param thread_num : Thread number (if tiling)
* \param lev : Level of box that contains particles
* \param depos_lev : Level on which particles deposit (if buffers are used)
@@ -587,57 +587,55 @@ WarpXParticleContainer::DepositCharge (WarpXParIter& pti, RealVector const& wp,
const long offset, const long np_to_depose,
int thread_num, int lev, int depos_lev)
{
- if (!do_not_deposit) {
- WarpX& warpx = WarpX::GetInstance();
+ WarpX& warpx = WarpX::GetInstance();
- // deposition guards
- // note: this is smaller than rho->nGrowVect() for PSATD
- const amrex::IntVect& ng_rho = warpx.get_ng_depos_rho();
+ // deposition guards
+ // note: this is smaller than rho->nGrowVect() for PSATD
+ const amrex::IntVect& ng_rho = warpx.get_ng_depos_rho();
- const std::array<amrex::Real,3>& dx = WarpX::CellSize(std::max(depos_lev,0));
- amrex::IntVect ref_ratio;
- if (lev == depos_lev) {
- ref_ratio = IntVect(AMREX_D_DECL(1, 1, 1 ));
- } else {
- ref_ratio = WarpX::RefRatio(depos_lev);
- }
- const int nc = WarpX::ncomps;
-
- // Get tile box where charge is deposited.
- // The tile box is different when depositing in the buffers (depos_lev<lev)
- // or when depositing inside the level (depos_lev=lev)
- amrex::Box tilebox;
- if (lev == depos_lev) {
- tilebox = pti.tilebox();
- } else {
- tilebox = amrex::coarsen(pti.tilebox(), ref_ratio);
- }
- tilebox.grow(ng_rho);
-
- // Lower corner of tile box physical domain
- // Note that this includes guard cells since it is after tilebox.ngrow
- // Take into account Galilean shift
- const amrex::Real dt = warpx.getdt(lev);
- const amrex::Real time_shift_delta = (icomp == 0 ? 0.0_rt : dt);
- const std::array<amrex::Real,3>& xyzmin = WarpX::LowerCorner(tilebox, depos_lev, time_shift_delta);
-
- // pointer to costs data
- amrex::LayoutData<amrex::Real>* costs = WarpX::getCosts(lev);
- amrex::Real* cost = costs ? &((*costs)[pti.index()]) : nullptr;
-
- AMREX_ALWAYS_ASSERT(WarpX::nox == WarpX::noy);
- AMREX_ALWAYS_ASSERT(WarpX::nox == WarpX::noz);
-
- ablastr::particles::deposit_charge<WarpXParticleContainer>(
- pti, wp, this->charge, ion_lev,
- rho, local_rho[thread_num],
- WarpX::noz, dx, xyzmin, WarpX::n_rz_azimuthal_modes,
- ng_rho, depos_lev, ref_ratio,
- offset, np_to_depose,
- icomp, nc,
- cost, WarpX::load_balance_costs_update_algo, WarpX::do_device_synchronize
- );
+ const std::array<amrex::Real,3>& dx = WarpX::CellSize(std::max(depos_lev,0));
+ amrex::IntVect ref_ratio;
+ if (lev == depos_lev) {
+ ref_ratio = IntVect(AMREX_D_DECL(1, 1, 1 ));
+ } else {
+ ref_ratio = WarpX::RefRatio(depos_lev);
}
+ const int nc = WarpX::ncomps;
+
+ // Get tile box where charge is deposited.
+ // The tile box is different when depositing in the buffers (depos_lev<lev)
+ // or when depositing inside the level (depos_lev=lev)
+ amrex::Box tilebox;
+ if (lev == depos_lev) {
+ tilebox = pti.tilebox();
+ } else {
+ tilebox = amrex::coarsen(pti.tilebox(), ref_ratio);
+ }
+ tilebox.grow(ng_rho);
+
+ // Lower corner of tile box physical domain
+ // Note that this includes guard cells since it is after tilebox.ngrow
+ // Take into account Galilean shift
+ const amrex::Real dt = warpx.getdt(lev);
+ const amrex::Real time_shift_delta = (icomp == 0 ? 0.0_rt : dt);
+ const std::array<amrex::Real,3>& xyzmin = WarpX::LowerCorner(tilebox, depos_lev, time_shift_delta);
+
+ // pointer to costs data
+ amrex::LayoutData<amrex::Real>* costs = WarpX::getCosts(lev);
+ amrex::Real* cost = costs ? &((*costs)[pti.index()]) : nullptr;
+
+ AMREX_ALWAYS_ASSERT(WarpX::nox == WarpX::noy);
+ AMREX_ALWAYS_ASSERT(WarpX::nox == WarpX::noz);
+
+ ablastr::particles::deposit_charge<WarpXParticleContainer>(
+ pti, wp, this->charge, ion_lev,
+ rho, local_rho[thread_num],
+ WarpX::noz, dx, xyzmin, WarpX::n_rz_azimuthal_modes,
+ ng_rho, depos_lev, ref_ratio,
+ offset, np_to_depose,
+ icomp, nc,
+ cost, WarpX::load_balance_costs_update_algo, WarpX::do_device_synchronize
+ );
}
void