Skip to content

Commit

Permalink
Apply suggestion from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Phil Miller <phil.miller@intensecomputing.com>
  • Loading branch information
roelof-groenewald and PhilMiller authored Dec 23, 2021
1 parent d4f65fb commit f843293
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Python/WarpXWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,19 +660,19 @@ namespace
const auto & mypc = warpx.GetPartContainer();
const std::string species_name(char_species_name);
auto & myspc = mypc.GetParticleContainerFromName(species_name);
auto rho_fp = warpx.get_pointer_rho_fp(lev);

// reset rho before depositing
warpx.get_pointer_rho_fp(lev)->setVal(0.);
rho_fp->setVal(0.);

for (WarpXParIter pti(myspc, lev); pti.isValid(); ++pti)
{
const long np = pti.numParticles();
auto& wp = pti.GetAttribs(PIdx::w);
myspc.DepositCharge(pti, wp, nullptr, warpx.get_pointer_rho_fp(lev),
0, 0, np, 0, lev, lev);
myspc.DepositCharge(pti, wp, nullptr, rho_fp, 0, 0, np, 0, lev, lev);
}
#ifdef WARPX_DIM_RZ
warpx.ApplyInverseVolumeScalingToChargeDensity(warpx.get_pointer_rho_fp(lev), lev);
warpx.ApplyInverseVolumeScalingToChargeDensity(rho_fp, lev);
#endif
}

Expand Down

0 comments on commit f843293

Please sign in to comment.