aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2022-08-22 16:30:44 -0700
committerGravatar GitHub <noreply@github.com> 2022-08-22 16:30:44 -0700
commita8f985ac5f43a89bfd359118e2996b3cb21f93cb (patch)
treee795c45b57bdadfa1b89d7f3f6f203c5ac18444b /Source/Particles/MultiParticleContainer.cpp
parent15579dbdb1c69babd0b4c5d7216a927443346741 (diff)
downloadWarpX-a8f985ac5f43a89bfd359118e2996b3cb21f93cb.tar.gz
WarpX-a8f985ac5f43a89bfd359118e2996b3cb21f93cb.tar.zst
WarpX-a8f985ac5f43a89bfd359118e2996b3cb21f93cb.zip
MultiParticleContainer: Prevent Bugs in Some `setVal` Calls (#3266)
- Call `setVal` with default arguments (number of components and ghost cells) - Affects only functions used with multi-J time stepping: - `MultiParticleContainer::DepositCurrent` - `MultiParticleContainer::DepositCharge`
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r--Source/Particles/MultiParticleContainer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index a0b80877d..c6cb9032e 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -511,9 +511,9 @@ MultiParticleContainer::DepositCurrent (
// Reset the J arrays
for (int lev = 0; lev < J.size(); ++lev)
{
- J[lev][0]->setVal(0.0, J[lev][0]->nGrowVect());
- J[lev][1]->setVal(0.0, J[lev][1]->nGrowVect());
- J[lev][2]->setVal(0.0, J[lev][2]->nGrowVect());
+ J[lev][0]->setVal(0.0_rt);
+ J[lev][1]->setVal(0.0_rt);
+ J[lev][2]->setVal(0.0_rt);
}
// Call the deposition kernel for each species
@@ -538,7 +538,7 @@ MultiParticleContainer::DepositCharge (
// Reset the rho array
for (int lev = 0; lev < rho.size(); ++lev)
{
- rho[lev]->setVal(0.0, 0, WarpX::ncomps, rho[lev]->nGrowVect());
+ rho[lev]->setVal(0.0_rt);
}
// Push the particles in time, if needed