|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
Orchestrates primary and image-charge scatter deposition. More...
#include <ImageChargeScatterController.h>

Public Types | |
| using | ParticleCtr_t = ParticleContainer< T, Dim > |
| using | PositionAttr_t = typename ippl::ParticleBase< ippl::ParticleSpatialLayout< T, Dim >, Kokkos::DefaultExecutionSpace::memory_space >::particle_position_type |
| using | RhoField_t = Field_t< Dim > |
| using | BinPolicy_t = Kokkos::RangePolicy<> |
| using | Hash_t = typename ParticleBinning::AdaptBinsBase< ParticleCtr_t >::hash_type |
Public Member Functions | |
| ImageChargeScatterController ()=default | |
Construct disabled controller at zPlane=0. | |
| ImageChargeScatterController (bool enabled, double zPlane) | |
| Construct controller with explicit image-charge settings. | |
| void | configure (bool enabled, double zPlane) |
| Update runtime settings. | |
| bool | isEnabled () const |
| Returns whether image-charge scatter is enabled. | |
| double | getZPlane () const |
| Returns the mirror plane position in z. | |
| void | scatterPrimaryAndImage (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho) const |
| Scatter all local particles with optional image pass. | |
| void | scatterPrimaryAndImage (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho, const BinPolicy_t &policy, const Hash_t &hash) const |
| Scatter a bin-restricted particle subset with optional image pass. | |
| void | scatterPrimaryOnly (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho) const |
| Scatter only the primary (real) charges for all local particles. | |
| void | scatterPrimaryOnly (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho, const BinPolicy_t &policy, const Hash_t &hash) const |
| Scatter only the primary (real) charges for a bin-restricted subset. | |
| void | scatterImageOnly (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho) const |
| Scatter only the image (mirrored) charges for all local particles. | |
| void | scatterImageOnly (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho, const BinPolicy_t &policy, const Hash_t &hash) const |
| Scatter only the image (mirrored) charges for a bin-restricted subset. | |
| void | scatterScaledDtAll (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho) const |
Scatter all local particles using the standard dt*Q workflow. | |
| void | scatterScaledDtSubset (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, RhoField_t &rho, const BinPolicy_t &policy, const Hash_t &hash) const |
Scatter a hashed particle subset using the standard dt*Q workflow. | |
| void | accumulateScalarHaloHostStaged (RhoField_t &rho) const |
| Accumulate scalar field halo contributions through host-staged MPI buffers. | |
| void | applyMirrorTransformAll (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions) const |
| Apply z-mirror and charge sign flip for all local particles. | |
| void | restoreMirrorTransformAll (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions) const |
| Restore z-mirror and charge sign flip for all local particles. | |
| void | applyMirrorTransformSubset (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, const BinPolicy_t &policy, const Hash_t &hash) const |
| Apply z-mirror and charge sign flip for a hashed particle subset. | |
| void | restoreMirrorTransformSubset (std::shared_ptr< ParticleCtr_t > pc, PositionAttr_t &positions, const BinPolicy_t &policy, const Hash_t &hash) const |
| Restore z-mirror and charge sign flip for a hashed particle subset. | |
| void | flipChargeSignAll (std::shared_ptr< ParticleCtr_t > pc) const |
| Flip charge sign for all local particles. | |
| void | flipChargeSignSubset (std::shared_ptr< ParticleCtr_t > pc, const BinPolicy_t &policy, const Hash_t &hash) const |
| Flip charge sign for a hashed particle subset. | |
Private Attributes | |
| bool | enabled_m = false |
| double | zPlane_m = 0.0 |
Orchestrates primary and image-charge scatter deposition.
The controller performs: 1) primary scatter using the existing dt * Q deposition workflow, and 2) optional image scatter by reflecting particle z positions around an xy plane and flipping the sign of charge Q.
The particle state is restored after the image deposition pass.
| T | Scalar type (typically double). |
| Dim | Spatial dimension (currently constrained to 3). |
Definition at line 26 of file ImageChargeScatterController.h.
| using ImageChargeScatterController< T, Dim >::BinPolicy_t = Kokkos::RangePolicy<> |
Definition at line 35 of file ImageChargeScatterController.h.
| using ImageChargeScatterController< T, Dim >::Hash_t = typename ParticleBinning::AdaptBinsBase<ParticleCtr_t>::hash_type |
Definition at line 36 of file ImageChargeScatterController.h.
| using ImageChargeScatterController< T, Dim >::ParticleCtr_t = ParticleContainer<T, Dim> |
Definition at line 30 of file ImageChargeScatterController.h.
| using ImageChargeScatterController< T, Dim >::PositionAttr_t = typename ippl::ParticleBase< ippl::ParticleSpatialLayout<T, Dim>, Kokkos::DefaultExecutionSpace::memory_space>::particle_position_type |
Definition at line 31 of file ImageChargeScatterController.h.
| using ImageChargeScatterController< T, Dim >::RhoField_t = Field_t<Dim> |
Definition at line 34 of file ImageChargeScatterController.h.
|
default |
Construct disabled controller at zPlane=0.
|
inline |
Construct controller with explicit image-charge settings.
| enabled | Enable image scatter pass when true. |
| zPlane | Mirror plane location in z (meters). |
Definition at line 49 of file ImageChargeScatterController.h.
| void ImageChargeScatterController< T, Dim >::accumulateScalarHaloHostStaged | ( | RhoField_t & | rho | ) | const |
Accumulate scalar field halo contributions through host-staged MPI buffers.
This mirrors rho.accumulateHalo() for scalar rho fields, but avoids the device-buffer MPI path used by IPPL HaloCells. It is used by the all-local binned scatter workaround on GH200/Daint.
| void ImageChargeScatterController< T, Dim >::applyMirrorTransformAll | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions | ||
| ) | const |
Apply z-mirror and charge sign flip for all local particles.
| pc | Shared particle container. |
| positions | Particle positions attribute. |
| void ImageChargeScatterController< T, Dim >::applyMirrorTransformSubset | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Apply z-mirror and charge sign flip for a hashed particle subset.
| pc | Shared particle container. |
| positions | Particle positions attribute. |
| policy | Bin iteration policy. |
| hash | Mapping from policy index to particle index. |
|
inline |
Update runtime settings.
| enabled | Enable image scatter pass when true. |
| zPlane | Mirror plane location in z (meters). |
Definition at line 57 of file ImageChargeScatterController.h.
References ImageChargeScatterController< T, Dim >::enabled_m, and ImageChargeScatterController< T, Dim >::zPlane_m.
| void ImageChargeScatterController< T, Dim >::flipChargeSignAll | ( | std::shared_ptr< ParticleCtr_t > | pc | ) | const |
Flip charge sign for all local particles.
In single-value Q mode, only the shared scalar is flipped.
| pc | Shared particle container. |
| void ImageChargeScatterController< T, Dim >::flipChargeSignSubset | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Flip charge sign for a hashed particle subset.
In single-value Q mode, only the shared scalar is flipped.
| pc | Shared particle container. |
| policy | Bin iteration policy. |
| hash | Mapping from policy index to particle index. |
|
inline |
Returns the mirror plane position in z.
Definition at line 65 of file ImageChargeScatterController.h.
References ImageChargeScatterController< T, Dim >::zPlane_m.
|
inline |
Returns whether image-charge scatter is enabled.
Definition at line 63 of file ImageChargeScatterController.h.
References ImageChargeScatterController< T, Dim >::enabled_m.
| void ImageChargeScatterController< T, Dim >::restoreMirrorTransformAll | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions | ||
| ) | const |
Restore z-mirror and charge sign flip for all local particles.
The operation is its own inverse.
| pc | Shared particle container. |
| positions | Particle positions attribute. |
| void ImageChargeScatterController< T, Dim >::restoreMirrorTransformSubset | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Restore z-mirror and charge sign flip for a hashed particle subset.
The operation is its own inverse.
| pc | Shared particle container. |
| positions | Particle positions attribute. |
| policy | Bin iteration policy. |
| hash | Mapping from policy index to particle index. |
| void ImageChargeScatterController< T, Dim >::scatterImageOnly | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho | ||
| ) | const |
Scatter only the image (mirrored) charges for all local particles.
Applies the mirror transform, scatters, and restores. Does nothing if image charges are disabled.
| void ImageChargeScatterController< T, Dim >::scatterImageOnly | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho, | ||
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Scatter only the image (mirrored) charges for a bin-restricted subset.
Applies the mirror transform, scatters, and restores. Does nothing if image charges are disabled.
| void ImageChargeScatterController< T, Dim >::scatterPrimaryAndImage | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho | ||
| ) | const |
Scatter all local particles with optional image pass.
Primary pass deposits with the nominal charge. If enabled, image pass deposits mirrored particles with flipped charge sign.
| pc | Shared particle container. |
| positions | Particle positions attribute (typically pc->R). |
| rho | Target charge-density mesh field. |
| void ImageChargeScatterController< T, Dim >::scatterPrimaryAndImage | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho, | ||
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Scatter a bin-restricted particle subset with optional image pass.
| pc | Shared particle container. |
| positions | Particle positions attribute (typically pc->R). |
| rho | Target charge-density mesh field. |
| policy | Bin iteration policy (index-space for hash access). |
| hash | Mapping from policy index to particle index. |
| void ImageChargeScatterController< T, Dim >::scatterPrimaryOnly | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho | ||
| ) | const |
Scatter only the primary (real) charges for all local particles.
| void ImageChargeScatterController< T, Dim >::scatterPrimaryOnly | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho, | ||
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Scatter only the primary (real) charges for a bin-restricted subset.
| void ImageChargeScatterController< T, Dim >::scatterScaledDtAll | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho | ||
| ) | const |
Scatter all local particles using the standard dt*Q workflow.
This helper applies scaleDtByCharge(), scatters dt, and restores dt.
| pc | Shared particle container. |
| positions | Particle positions attribute. |
| rho | Target charge-density field. |
| void ImageChargeScatterController< T, Dim >::scatterScaledDtSubset | ( | std::shared_ptr< ParticleCtr_t > | pc, |
| PositionAttr_t & | positions, | ||
| RhoField_t & | rho, | ||
| const BinPolicy_t & | policy, | ||
| const Hash_t & | hash | ||
| ) | const |
Scatter a hashed particle subset using the standard dt*Q workflow.
| pc | Shared particle container. |
| positions | Particle positions attribute. |
| rho | Target charge-density field. |
| policy | Bin iteration policy. |
| hash | Mapping from policy index to particle index. |
|
private |
Definition at line 228 of file ImageChargeScatterController.h.
Referenced by ImageChargeScatterController< T, Dim >::configure(), and ImageChargeScatterController< T, Dim >::isEnabled().
|
private |
Definition at line 229 of file ImageChargeScatterController.h.
Referenced by ImageChargeScatterController< T, Dim >::configure(), and ImageChargeScatterController< T, Dim >::getZPlane().