aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Evolve/WarpXEvolveEM.cpp8
-rw-r--r--Source/FieldSolver/WarpXPushFieldsEM.cpp6
-rw-r--r--Source/WarpX.H1
3 files changed, 6 insertions, 9 deletions
diff --git a/Source/Evolve/WarpXEvolveEM.cpp b/Source/Evolve/WarpXEvolveEM.cpp
index e05fde03e..170a8f604 100644
--- a/Source/Evolve/WarpXEvolveEM.cpp
+++ b/Source/Evolve/WarpXEvolveEM.cpp
@@ -489,11 +489,9 @@ WarpX::PushParticlesandDepose (int lev, Real cur_time)
ApplyInverseVolumeScalingToCurrentDensity(current_buf[lev][0].get(), current_buf[lev][1].get(), current_buf[lev][2].get(), lev-1);
}
if (rho_fp[lev].get()) {
- for (int icomp = 0 ; icomp < rho_fp[lev].get()->nComp() ; icomp++) {
- ApplyInverseVolumeScalingToChargeDensity(rho_fp[lev].get(), icomp, lev);
- if (charge_buf[lev].get()) {
- ApplyInverseVolumeScalingToChargeDensity(charge_buf[lev].get(), icomp, lev-1);
- }
+ ApplyInverseVolumeScalingToChargeDensity(rho_fp[lev].get(), lev);
+ if (charge_buf[lev].get()) {
+ ApplyInverseVolumeScalingToChargeDensity(charge_buf[lev].get(), lev-1);
}
}
#endif
diff --git a/Source/FieldSolver/WarpXPushFieldsEM.cpp b/Source/FieldSolver/WarpXPushFieldsEM.cpp
index f199e0660..1df05bc0f 100644
--- a/Source/FieldSolver/WarpXPushFieldsEM.cpp
+++ b/Source/FieldSolver/WarpXPushFieldsEM.cpp
@@ -673,7 +673,7 @@ WarpX::ApplyInverseVolumeScalingToCurrentDensity (MultiFab* Jx, MultiFab* Jy, Mu
}
void
-WarpX::ApplyInverseVolumeScalingToChargeDensity (MultiFab* Rho, int icomp, int lev)
+WarpX::ApplyInverseVolumeScalingToChargeDensity (MultiFab* Rho, int lev)
{
const long ngRho = Rho->nGrow();
const std::array<Real,3>& dx = WarpX::CellSize(lev);
@@ -699,8 +699,8 @@ WarpX::ApplyInverseVolumeScalingToChargeDensity (MultiFab* Rho, int icomp, int l
// Rescale charge in r-z mode since the inverse volume factor was not
// included in the charge deposition.
- amrex::ParallelFor(tb,
- [=] AMREX_GPU_DEVICE (int i, int j, int k)
+ amrex::ParallelFor(tb, Rho->nComp(),
+ [=] AMREX_GPU_DEVICE (int i, int j, int k, int icomp)
{
// Wrap the charge density deposited in the guard cells around
// to the cells above the axis.
diff --git a/Source/WarpX.H b/Source/WarpX.H
index 67d2366d4..8d910dd4a 100644
--- a/Source/WarpX.H
+++ b/Source/WarpX.H
@@ -185,7 +185,6 @@ public:
int lev);
void ApplyInverseVolumeScalingToChargeDensity(amrex::MultiFab* Rho,
- int icomp,
int lev);
#endif