Skip to content

Commit 677639b

Browse files
authored
Rename skip_current variable for more clarity (#6303)
I noticed in #6275 that the input `skip_current` of `PushParticlesandDeposit` was passed as the value of the input `skip_deposition` of `Evolve`, which uses that to control both charge and current deposition - not just current deposition. I think using a sinlge name, `skip_deposition` instead of `skip_current`, is less misleading. This is along the same lines of what I did in #6008.
1 parent d5ee9f0 commit 677639b

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

Source/Evolve/WarpXEvolve.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ void WarpX::OneStep (
402402
// push particles (half position and full momentum)
403403
PushParticlesandDeposit(
404404
a_cur_time,
405-
/*skip_current=*/true,
405+
/*skip_deposition=*/true,
406406
PositionPushType::FirstHalf,
407407
MomentumPushType::Full
408408
);
@@ -418,7 +418,7 @@ void WarpX::OneStep (
418418
// push particles (half position)
419419
PushParticlesandDeposit(
420420
a_cur_time,
421-
/*skip_current=*/true,
421+
/*skip_deposition=*/true,
422422
PositionPushType::SecondHalf,
423423
MomentumPushType::None
424424
);
@@ -433,7 +433,7 @@ void WarpX::OneStep (
433433
// push particles (half position)
434434
PushParticlesandDeposit(
435435
a_cur_time,
436-
/*skip_current=*/true,
436+
/*skip_deposition=*/true,
437437
PositionPushType::Full,
438438
MomentumPushType::Full
439439
);
@@ -1250,7 +1250,7 @@ WarpX::doQEDEvents ()
12501250
void
12511251
WarpX::PushParticlesandDeposit (
12521252
amrex::Real cur_time,
1253-
bool skip_current,
1253+
bool skip_deposition,
12541254
PositionPushType position_push_type,
12551255
MomentumPushType momentum_push_type,
12561256
ImplicitOptions const * implicit_options
@@ -1263,7 +1263,7 @@ WarpX::PushParticlesandDeposit (
12631263
lev,
12641264
cur_time,
12651265
SubcyclingHalf::None,
1266-
skip_current,
1266+
skip_deposition,
12671267
position_push_type,
12681268
momentum_push_type,
12691269
implicit_options
@@ -1276,7 +1276,7 @@ WarpX::PushParticlesandDeposit (
12761276
int lev,
12771277
amrex::Real cur_time,
12781278
SubcyclingHalf subcycling_half,
1279-
bool skip_current,
1279+
bool skip_deposition,
12801280
PositionPushType position_push_type,
12811281
MomentumPushType momentum_push_type,
12821282
ImplicitOptions const * implicit_options
@@ -1307,13 +1307,13 @@ WarpX::PushParticlesandDeposit (
13071307
cur_time,
13081308
dt[lev],
13091309
subcycling_half,
1310-
skip_current,
1310+
skip_deposition,
13111311
position_push_type,
13121312
momentum_push_type,
13131313
implicit_options
13141314
);
13151315

1316-
if (! skip_current) {
1316+
if (!skip_deposition) {
13171317
#if defined(WARPX_DIM_RZ) || defined(WARPX_DIM_RCYLINDER) || defined(WARPX_DIM_RSPHERE)
13181318
// This is called after all particles have deposited their current and charge.
13191319
ApplyInverseVolumeScalingToCurrentDensity(
@@ -1347,7 +1347,7 @@ WarpX::PushParticlesandDeposit (
13471347
lev,
13481348
current_fp_string,
13491349
cur_time,
1350-
skip_current
1350+
skip_deposition
13511351
);
13521352
}
13531353
}

Source/FieldSolver/ImplicitSolvers/ImplicitSolver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ void ImplicitSolver::PreRHSOp ( const amrex::Real a_cur_time,
733733
// particle velocities by dt, then take average of old and new v,
734734
// deposit currents, giving J at n+1/2
735735
// This uses Efield_fp and Bfield_fp, the field at n+1/2 from the previous iteration.
736-
const bool skip_current = false;
736+
const bool skip_deposition = false;
737737

738738
// Set the implict solver options for particles and setting the current density
739739
ImplicitOptions options;
@@ -754,7 +754,7 @@ void ImplicitSolver::PreRHSOp ( const amrex::Real a_cur_time,
754754

755755
if (m_use_mass_matrices && !a_from_jacobian) { // Called from non-linear stage of JFNK and using mass matrices
756756
options.deposit_mass_matrices = true;
757-
m_WarpX->PushParticlesandDeposit(a_cur_time, skip_current, PositionPushType::Full, MomentumPushType::Full, &options);
757+
m_WarpX->PushParticlesandDeposit(a_cur_time, skip_deposition, PositionPushType::Full, MomentumPushType::Full, &options);
758758
CumulateJ();
759759
if (m_use_mass_matrices_jacobian) { SaveE(); }
760760
if (m_use_mass_matrices_pc) {
@@ -767,14 +767,14 @@ void ImplicitSolver::PreRHSOp ( const amrex::Real a_cur_time,
767767
if (m_particle_suborbits) {
768768
options.deposit_mass_matrices = false;
769769
options.evolve_suborbit_particles_only = true;
770-
m_WarpX->PushParticlesandDeposit(a_cur_time, skip_current, PositionPushType::Full, MomentumPushType::Full, &options);
770+
m_WarpX->PushParticlesandDeposit(a_cur_time, skip_deposition, PositionPushType::Full, MomentumPushType::Full, &options);
771771
}
772772
const bool J_from_MM_only = !options.evolve_suborbit_particles_only;
773773
ComputeJfromMassMatrices( J_from_MM_only );
774774
}
775775
else { // Conventional particle-suppressed JFNK
776776
options.deposit_mass_matrices = false;
777-
m_WarpX->PushParticlesandDeposit(a_cur_time, skip_current, PositionPushType::Full, MomentumPushType::Full, &options);
777+
m_WarpX->PushParticlesandDeposit(a_cur_time, skip_deposition, PositionPushType::Full, MomentumPushType::Full, &options);
778778
}
779779

780780
// Apply BCs to J and communicate

Source/WarpX.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,12 @@ public:
630630
void doQEDEvents ();
631631
#endif
632632

633-
void PushParticlesandDeposit (int lev, amrex::Real cur_time, SubcyclingHalf subcycling_half=SubcyclingHalf::None, bool skip_current=false,
633+
void PushParticlesandDeposit (int lev, amrex::Real cur_time, SubcyclingHalf subcycling_half=SubcyclingHalf::None, bool skip_deposition=false,
634634
PositionPushType position_push_type=PositionPushType::Full,
635635
MomentumPushType momentum_push_type=MomentumPushType::Full,
636636
ImplicitOptions const * implicit_options = nullptr);
637637

638-
void PushParticlesandDeposit (amrex::Real cur_time, bool skip_current=false,
638+
void PushParticlesandDeposit (amrex::Real cur_time, bool skip_deposition=false,
639639
PositionPushType position_push_type=PositionPushType::Full,
640640
MomentumPushType momentum_push_type=MomentumPushType::Full,
641641
ImplicitOptions const * implicit_options = nullptr);

0 commit comments

Comments
 (0)