|
116 | 116 |
|
117 | 117 | using namespace amrex; |
118 | 118 |
|
119 | | -PhysicalParticleContainer::PhysicalParticleContainer ( |
120 | | - AmrCore* amr_core, |
121 | | - int ispecies, |
122 | | - const std::string& name, |
123 | | - bool const collisions_split_position_push |
124 | | -) : WarpXParticleContainer(amr_core, ispecies), |
125 | | - species_name(name), |
126 | | - m_collisions_split_position_push(collisions_split_position_push) |
| 119 | +PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int ispecies, |
| 120 | + const std::string& name) |
| 121 | + : WarpXParticleContainer(amr_core, ispecies), |
| 122 | + species_name(name) |
127 | 123 | { |
128 | 124 | BackwardCompatibility(); |
129 | 125 |
|
@@ -341,13 +337,11 @@ PhysicalParticleContainer::PhysicalParticleContainer ( |
341 | 337 | m_boundary_conditions.SetThermalVelocity(boundary_uth); |
342 | 338 | } |
343 | 339 |
|
344 | | - // If the position push is split to perform collisions, add the |
345 | | - // average momentum components to deposit the current correctly |
346 | | - if (m_collisions_split_position_push) { |
347 | | - this->AddRealComp("ux_avg", /*communicate=*/0); |
348 | | - this->AddRealComp("uy_avg", /*communicate=*/0); |
349 | | - this->AddRealComp("uz_avg", /*communicate=*/0); |
350 | | - } |
| 340 | + // Add the average momentum components to deposit the current correctly |
| 341 | + // if the position push is split to perform collisions |
| 342 | + this->AddRealComp("ux_avg", /*communicate=*/0); |
| 343 | + this->AddRealComp("uy_avg", /*communicate=*/0); |
| 344 | + this->AddRealComp("uz_avg", /*communicate=*/0); |
351 | 345 | } |
352 | 346 |
|
353 | 347 | void |
@@ -477,7 +471,6 @@ PhysicalParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields, |
477 | 471 | !do_not_deposit && |
478 | 472 | (position_push_type == PositionPushType::Full || position_push_type == PositionPushType::FirstHalf) |
479 | 473 | ); |
480 | | - // FIXME Check the logic here |
481 | 474 | bool const deposit_current = ( |
482 | 475 | !skip_deposition && |
483 | 476 | !do_not_deposit && |
@@ -516,9 +509,9 @@ PhysicalParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields, |
516 | 509 | // Extract particle data |
517 | 510 | auto& attribs = pti.GetAttribs(); |
518 | 511 | auto& wp = attribs[PIdx::w]; |
519 | | - auto& uxp = (m_collisions_split_position_push) ? pti.GetAttribs("ux_avg") : attribs[PIdx::ux]; |
520 | | - auto& uyp = (m_collisions_split_position_push) ? pti.GetAttribs("uy_avg") : attribs[PIdx::uy]; |
521 | | - auto& uzp = (m_collisions_split_position_push) ? pti.GetAttribs("uz_avg") : attribs[PIdx::uz]; |
| 512 | + auto& uxp = pti.GetAttribs("ux_avg"); |
| 513 | + auto& uyp = pti.GetAttribs("uy_avg"); |
| 514 | + auto& uzp = pti.GetAttribs("uz_avg"); |
522 | 515 |
|
523 | 516 | const long np = pti.numParticles(); |
524 | 517 |
|
@@ -1347,9 +1340,9 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti, |
1347 | 1340 | ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr() + offset; |
1348 | 1341 |
|
1349 | 1342 | // Average momentum |
1350 | | - amrex::ParticleReal* const AMREX_RESTRICT ux_avg = pti.GetAttribs("ux_avg").dataPtr() + offset; |
1351 | | - amrex::ParticleReal* const AMREX_RESTRICT uy_avg = pti.GetAttribs("uy_avg").dataPtr() + offset; |
1352 | | - amrex::ParticleReal* const AMREX_RESTRICT uz_avg = pti.GetAttribs("uz_avg").dataPtr() + offset; |
| 1343 | + amrex::ParticleReal* AMREX_RESTRICT ux_avg = pti.GetAttribs("ux_avg").dataPtr() + offset; |
| 1344 | + amrex::ParticleReal* AMREX_RESTRICT uy_avg = pti.GetAttribs("uy_avg").dataPtr() + offset; |
| 1345 | + amrex::ParticleReal* AMREX_RESTRICT uz_avg = pti.GetAttribs("uz_avg").dataPtr() + offset; |
1353 | 1346 |
|
1354 | 1347 | CopyParticleAttribs copyAttribs; |
1355 | 1348 | if (copy_particle_attribs) { |
@@ -1491,6 +1484,7 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti, |
1491 | 1484 | } |
1492 | 1485 | #endif |
1493 | 1486 | // Update average momentum |
| 1487 | + // FIXME Improve the logic here |
1494 | 1488 | if (momentum_push_type != MomentumPushType::None) { |
1495 | 1489 | ux_avg[ip] = ux[ip]; |
1496 | 1490 | uy_avg[ip] = uy[ip]; |
|
0 commit comments