From dbcf9a1ad0f4e134a7512bf751ad0d535bdb0057 Mon Sep 17 00:00:00 2001 From: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Date: Thu, 23 Dec 2021 11:10:30 -0800 Subject: [PATCH] Apply suggestion from code review Co-authored-by: Phil Miller --- Source/Python/WarpXWrappers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index f4f4d83e2e6..1fc080447d5 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -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 }