|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <PartBunch.h>
Inherits ippl::PicManager< T, Dim, ParticleContainer< T, Dim >, FieldContainer< T, Dim >, LoadBalancer< T, Dim > >.

Public Types | |
| using | ParticleContainer_t = ParticleContainer< T, Dim > |
| using | FieldContainer_t = FieldContainer< T, Dim > |
| using | BinnedFieldSolver_t = BinnedFieldSolver< T, Dim > |
| using | LoadBalancer_t = LoadBalancer< T, Dim > |
| using | Base = ippl::ParticleBase< ippl::ParticleSpatialLayout< T, Dim >, Kokkos::DefaultExecutionSpace::memory_space > |
| using | CoordinateSelector_t = typename ParticleBinning::CoordinateSelector< ParticleContainer_t > |
| using | GammaSelector_t = typename ParticleBinning::GammaSelector< ParticleContainer_t > |
| using | AdaptBins_t = typename ParticleBinning::AdaptBinsBase< ParticleContainer_t > |
| using | binIndex_t = typename ParticleContainer_t::bin_index_type |
| using | BCHandler_t = BCHandler< Dim > |
Public Member Functions | |
| PartBunch (std::vector< double > qi, std::vector< double > mi, const std::vector< Beam * > &beams, std::vector< size_t > totalParticlesPerBeam, double lbt, std::string integration_method, FieldSolverCmd *OPALFieldSolver, DataSink *dataSink) | |
| Construct a multi-beam bunch: mesh, solver, containers, and capacity. | |
| void | bunchUpdate () |
| Refresh mesh from particle extents, update layouts, and recompute moments. | |
| void | computeBoundsForFieldSolve (Vector_t< double, Dim > &lower, Vector_t< double, Dim > &upper) |
| Computes the spatial bounds for the field solver based on the current particle distribution. | |
| void | applyGridUpdate (const Vector_t< double, Dim > &lower, const Vector_t< double, Dim > &upper) |
| Updates the mesh/grid and internal data structures to match the given spatial bounds. | |
| void | reinitializeGridZ (int nrZ) |
Reinitialize the z dimension of the field grid to nrZ cells. | |
| void | setImageChargeConfiguration (bool enabled, double zPlane) |
| Set the image-charge configuration for the field solver. | |
| void | setShiftedGreensConfiguration (bool enabled, double zPlane) |
| Set the shifted Green's function Dirichlet-correction configuration. | |
| void | setZeroFacePlaneDumpFrequency (int frequency) |
| Configure diagnostic dump frequency for the ZEROFACE plane potential. | |
| void | setZerofaceMaxSteps (int maxSteps) |
| Set the maximum number of timesteps for which image charges are active (0 = unlimited). | |
| size_t | getTotalNumAllContainers () const |
Sum of getTotalNum() over all particle containers. | |
| void | setSolver () |
Build field solver and load balancer from OPALFieldSolver_m. | |
| void | setBins () |
| Create adaptive bins from the binning command (VELOCITYZ / GAMMAZ). | |
| void | pre_run () override |
| Warm-up: zero rho and run the field solver once (skip full dumps). | |
| void | performBunchSanityChecks () const |
| Validate BC handler, solver wiring, field pointers, and layout extents. | |
| void | resetPcActive () |
| At segment start: active if container is non-empty; inactive if empty. | |
| bool | isPcActive (size_t i) const |
| void | setPcActive (size_t i) |
Force container i active (e.g. for containers with pending emission). | |
| bool | pcAtZStop (size_t i) const |
| void | setPcAtZStop (size_t i) |
Deactivate container i until the next step-size segment (z-stop reached). | |
| void | refreshPcActiveAfterEmit () |
| After emission: reactivate non-empty containers not marked at z-stop. | |
| bool | anyPcActive () const |
| void | advance () override |
| PicManager hook; throws (tracking does not use this path). | |
| void | par2grid () override |
| PicManager hook; throws (scatter handled elsewhere). | |
| void | grid2par () override |
| PicManager hook; throws (gather handled elsewhere). | |
| std::shared_ptr< VField_t< T, Dim > > | getTempEField () |
| Scratch E field used by the binned solver path. | |
| void | setTempEField (std::shared_ptr< VField_t< T, Dim > > Etmp) |
| std::shared_ptr< VField_t< T, Dim > > | getTempBField () |
| Scratch B field used by the binned solver path. | |
| void | setTempBField (std::shared_ptr< VField_t< T, Dim > > Btmp) |
| std::shared_ptr< AdaptBins_t > | getBins () |
| Non-const access to adaptive binning state. | |
| std::shared_ptr< AdaptBins_t > | getBins () const |
| Const access to adaptive binning state. | |
| void | setBins (std::shared_ptr< AdaptBins_t > bins) |
| void | setBCHandler (std::shared_ptr< BCHandler_t > bcHandler) |
| std::shared_ptr< BCHandler_t > | getBCHandler () const |
| Current boundary-condition handler. | |
| DataSink * | getDataSink () const |
| std::shared_ptr< BunchStateHandler > | getBunchStateHandler () |
| std::shared_ptr< const BunchStateHandler > | getBunchStateHandler () const |
| void | updateMoments () |
| void | calcBeamParameters () |
Update moments and set rmin_m / rmax_m from the primary (first) container. | |
| void | setCharge () |
| Set the per-particle charge for each particle container. | |
| void | setMass () |
| Set the per-particle mass for each particle container. | |
| double | getCharge (size_t containerIndex=0) const |
| Get the total charge for a given particle container. | |
| double | getChargePerParticle (size_t containerIndex=0) const |
| Get the charge per particle for a given particle container. | |
| double | getMassPerParticle (size_t containerIndex=0) const |
| Get the mass per particle for a given particle container. | |
| double | getQ (size_t containerIndex=0) const |
Alias for getCharge(containerIndex). | |
| double | getM (size_t containerIndex=0) const |
| Get the total mass for a given particle container. | |
| double | getTotalCharge () const |
| Get the total charge across all particle containers. | |
| double | getTotalMass () const |
| Get the total mass across all particle containers. | |
| double | getdE () |
| const PartData * | getReference () const |
| void | setReference (const PartData *ref) |
| Set inside TrackRun::execute. | |
| void | gatherLoadBalanceStatistics () |
| size_t | getLoadBalance (int p) |
| size_t | calcNumPartsOutside (Vector_t< double, Dim >) |
| Stub; logs and returns 0. | |
| void | calcLineDensity (unsigned int, std::vector< double > &, std::pair< double, double > &) |
| Stub; logs only. | |
| Vector_t< double, Dim > | getEExtrema () |
| Stub; logs and returns zero vector. | |
| void | computeSelfFields () |
| Compute the bunch self-fields (binned when available). | |
| void | dumpBinConfig (bool preMerge) |
| Write bin edges/counts to the data sink when configured. | |
| Inform & | print (Inform &os) |
Human-readable dump of each container to os. | |
| bool | hasFieldSolver () const |
| BinnedFieldSolver_t * | getFieldSolver () |
| Non-const pointer to the concrete BinnedFieldSolver. | |
| const BinnedFieldSolver_t * | getFieldSolver () const |
| Const overload of getFieldSolver(). | |
| std::string | getFieldSolverType () |
| Backend type string (e.g. FFT, OPEN, CG, NONE). | |
| bool | hasBinning () const |
| int | getCurrentNBins () const |
| Effective bin count for diagnostics (1 if binning inactive or still at max bins). | |
| double | calcMeanPhi () |
| Compatibility stub; logs and returns 0. | |
| std::string | getParticleName (size_t i) const |
Particle species name for container i (from BEAM PARTICLE input). | |
| Vector_t< double, Dim > | R (size_t) |
Do not use; throws (access positions via ParticleContainer::R). | |
| Vector_t< double, Dim > | P (size_t) |
Do not use; throws (access momenta via ParticleContainer::P). | |
| void | get_bounds (Vector_t< double, Dim > &rmin, Vector_t< double, Dim > &rmax) |
Copy cached bunch extent (rmin_m, rmax_m) from calcBeamParameters. | |
| void | setdT (double dt) |
| Set the global time step. | |
| double | getdT () const |
| Get the global time step. | |
| void | setT (double t) |
| Set the current simulation time. | |
| void | incrementT () |
| Advance time by one global time step. | |
| double | getT () const |
| Get the current simulation time. | |
| Vector_t< double, Dim > | get_origin () const |
Cached minimum extent (rmin_m); prefer per-container min/max for multi-beam detail. | |
| Vector_t< double, Dim > | get_maxExtent () const |
Cached maximum extent (rmax_m). | |
| Vector_t< double, Dim > | get_halo () const |
| Stub; logs and returns zero vector. | |
| Vector_t< double, Dim > | get_hr () const |
| Get mesh spacing. | |
| void | setGlobalTrackStep (long long n) |
| long long | getGlobalTrackStep () const |
| Current global tracking step. | |
| void | incTrackSteps () |
Increment globalTrackStep_m by one. | |
| void | do_binaryRepart () |
| ORB/binary repartition when the load balancer requests it (primary container). | |
| double | get_rmsDensity () const |
| Legacy RMS density field (may be unused). | |
Public Attributes | |
| double | dt_m |
| Global time step \(\Delta t\) (s). | |
| int | it_m |
| Iteration counter (legacy / diagnostics). | |
| std::string | integration_method_m |
| Integrator name (e.g. leapfrog). | |
| std::string | solver_m |
| Field solver type string from input. | |
| Vector_t< int, Dim > | nr_m |
| Mesh cell count per dimension. | |
| int | nrZBase_m = 0 |
| Base z grid count before any image-charge doubling; used to reset nr_m. | |
| Vector_t< double, Dim > | origin_m |
| Mesh origin (lab coordinates). | |
| Vector_t< double, Dim > | rmin_m |
| Vector_t< double, Dim > | rmax_m |
| Current bunch spatial maximum (from primary container stats). | |
| Vector_t< double, Dim > | hr_m |
| Mesh spacing (m). | |
| double | lbt_m |
| Load-balancer timescale parameter. | |
| bool | isFirstRepartition_m |
| True until the first ORB-style repartition completes. | |
| ippl::NDIndex< Dim > | domain_m |
| Global mesh index extent per dimension. | |
| std::array< bool, Dim > | decomp_m |
| Domain decomposition flags (per axis). | |
Private Attributes | |
| std::vector< bool > | pcActive_m |
| Per-container: participate in this track segment. | |
| std::vector< bool > | pcAtZStop_m |
| Per-container: frozen at current z-stop until next segment. | |
| std::vector< std::string > | particleNames_m |
| Per-container beam particle names. | |
| std::vector< double > | qi_m |
| Charge per macroparticle [C], one entry per container. | |
| std::vector< double > | mi_m |
| Mass per macroparticle [GeV], one entry per container. | |
| const PartData * | reference_m = nullptr |
| Reference particle data (set by TrackRun::execute). | |
| std::shared_ptr< BunchStateHandler > | bunchState_m |
| Bunch state: unitless flag, repartition flag, etc. | |
| std::shared_ptr< BCHandler_t > | bcHandler_m |
| Field boundary conditions. | |
| std::shared_ptr< AdaptBins_t > | bins_m |
| Adaptive velocity/gamma binning (optional). | |
| FieldSolverCmd * | OPALFieldSolver_m |
| Borrowed parsed FIELD_SOLVER command. | |
| DataSink * | dataSink_m |
| Borrowed diagnostics and dump output sink. | |
| double | t_m |
| Current simulation time (s). | |
| std::shared_ptr< VField_t< T, Dim > > | Etmp_m |
| std::shared_ptr< VField_t< T, Dim > > | Btmp_m |
| long long | globalTrackStep_m |
| Global integration step counter. | |
| std::unique_ptr< size_t[]> | globalPartPerNode_m |
| Per-rank particle counts for load-balance stats. | |
| double | rmsDensity_m |
| Legacy RMS density placeholder (may still appear in stats). | |
Definition at line 52 of file PartBunch.h.
| using PartBunch< T, Dim >::AdaptBins_t = typename ParticleBinning::AdaptBinsBase<ParticleContainer_t> |
Definition at line 65 of file PartBunch.h.
| using PartBunch< T, Dim >::Base = ippl::ParticleBase< ippl::ParticleSpatialLayout<T, Dim>, Kokkos::DefaultExecutionSpace::memory_space> |
Definition at line 60 of file PartBunch.h.
Definition at line 68 of file PartBunch.h.
| using PartBunch< T, Dim >::binIndex_t = typename ParticleContainer_t::bin_index_type |
Definition at line 66 of file PartBunch.h.
| using PartBunch< T, Dim >::BinnedFieldSolver_t = BinnedFieldSolver<T, Dim> |
Definition at line 58 of file PartBunch.h.
| using PartBunch< T, Dim >::CoordinateSelector_t = typename ParticleBinning::CoordinateSelector<ParticleContainer_t> |
Definition at line 63 of file PartBunch.h.
| using PartBunch< T, Dim >::FieldContainer_t = FieldContainer<T, Dim> |
Definition at line 57 of file PartBunch.h.
| using PartBunch< T, Dim >::GammaSelector_t = typename ParticleBinning::GammaSelector<ParticleContainer_t> |
Definition at line 64 of file PartBunch.h.
| using PartBunch< T, Dim >::LoadBalancer_t = LoadBalancer<T, Dim> |
Definition at line 59 of file PartBunch.h.
| using PartBunch< T, Dim >::ParticleContainer_t = ParticleContainer<T, Dim> |
Definition at line 56 of file PartBunch.h.
| PartBunch< T, Dim >::PartBunch | ( | std::vector< double > | qi, |
| std::vector< double > | mi, | ||
| const std::vector< Beam * > & | beams, | ||
| std::vector< size_t > | totalParticlesPerBeam, | ||
| double | lbt, | ||
| std::string | integration_method, | ||
| FieldSolverCmd * | OPALFieldSolver, | ||
| DataSink * | dataSink | ||
| ) |
Construct a multi-beam bunch: mesh, solver, containers, and capacity.
Construct a multi-beam bunch: mesh, solver, containers, and capacity.
| qi | Macrocharge per container (C). |
| mi | Macromass per container (GeV/c²). |
| beams | One Beam per container (reference particle, species). |
| totalParticlesPerBeam | Target macroparticle count per beam (for local allocation). |
| lbt | Load-balancer timescale. |
| integration_method | Integrator label (e.g. leapfrog). |
| OPALFieldSolver | Borrowed field solver command (mesh, BCs, optional binning). |
| dataSink | Borrowed non-null diagnostics output sink. |
Definition at line 22 of file PartBunch.cpp.
References PartBunch< T, Dim >::bunchState_m, FieldSolverCmd::constructBCHandler(), PartBunch< T, Dim >::dataSink_m, PartBunch< T, Dim >::decomp_m, Dim, PartBunch< T, Dim >::domain_m, PartBunch< T, Dim >::dt_m, PartBunch< T, Dim >::getBCHandler(), FieldSolverCmd::getDomDec(), FieldSolverCmd::getNX(), FieldSolverCmd::getNY(), FieldSolverCmd::getNZ(), PartBunch< T, Dim >::getParticleName(), ParticleProperties::getParticleType(), PartBunch< T, Dim >::getReference(), PartBunch< T, Dim >::getTempBField(), PartBunch< T, Dim >::getTempEField(), PartBunch< T, Dim >::globalPartPerNode_m, gmsg, PartBunch< T, Dim >::hr_m, PartBunch< T, Dim >::mi_m, PartBunch< T, Dim >::nr_m, PartBunch< T, Dim >::nrZBase_m, PartBunch< T, Dim >::OPALFieldSolver_m, PartBunch< T, Dim >::origin_m, PartBunch< T, Dim >::particleNames_m, BCHandler< Dim >::PERIODIC, PartBunch< T, Dim >::pre_run(), PartBunch< T, Dim >::qi_m, PartBunch< T, Dim >::resetPcActive(), PartBunch< T, Dim >::rmax_m, PartBunch< T, Dim >::rmin_m, PartBunch< T, Dim >::setBCHandler(), PartBunch< T, Dim >::setSolver(), PartBunch< T, Dim >::setT(), PartBunch< T, Dim >::setTempBField(), and PartBunch< T, Dim >::setTempEField().

PicManager hook; throws (tracking does not use this path).
Definition at line 286 of file PartBunch.h.
Definition at line 276 of file PartBunch.h.
References PartBunch< T, Dim >::pcActive_m.
Referenced by ParallelTracker::execute().
| void PartBunch< T, Dim >::applyGridUpdate | ( | const Vector_t< double, Dim > & | lower, |
| const Vector_t< double, Dim > & | upper | ||
| ) |
Updates the mesh/grid and internal data structures to match the given spatial bounds.
Sets the mesh spacing and origin for the field container based on the difference between lower and upper, updates references to domain boundaries, and applies these updates to the underlying mesh and field layout. Triggers a reevaluation of particle container layouts to ensure the grid matches the computed domain.
| [in] | lower | The minimum coordinates (origin) for the domain in all dimensions. |
| [in] | upper | The maximum coordinates for the domain in all dimensions. |
Definition at line 658 of file PartBunch.cpp.
Refresh mesh from particle extents, update layouts, and recompute moments.
Track/TrackRun.cpp (initial layout)PartBunch.cpp (space-charge path; review if still appropriate)ParallelTracker.cpp (after position push / frame changes) Definition at line 560 of file PartBunch.cpp.
References BinnedFieldSolver< T, Dim >::isImageChargeActiveForStep().
Referenced by ParallelTracker::computeSpaceChargeFields(), and ParallelTracker::execute().

Update moments and set rmin_m / rmax_m from the primary (first) container.
Update moments and set rmin_m / rmax_m from the primary (first) container.
Definition at line 338 of file PartBunch.cpp.
References Dim.
Referenced by ParallelTracker::computeSpaceChargeFields(), and DataSink::dumpSDDS().
Compatibility stub; logs and returns 0.
Definition at line 596 of file PartBunch.h.
References gmsg.
|
inline |
Stub; logs and returns 0.
Definition at line 512 of file PartBunch.h.
References gmsg.
Referenced by DataSink::dumpSDDS().
| void PartBunch< T, Dim >::computeBoundsForFieldSolve | ( | Vector_t< double, Dim > & | lower, |
| Vector_t< double, Dim > & | upper | ||
| ) |
Computes the spatial bounds for the field solver based on the current particle distribution.
Determines the minimum and maximum coordinates (lower, upper) in each dimension that encompass all particles in the current container. Adjusts these bounds if image-charge boundary conditions are enabled to ensure the domain includes both the real and mirrored charge distributions. Guarantees a minimal span (e.g., 1e-6) in each dimension for validity and applies an additional extension based on the field solver's box increment percentage.
| [out] | lower | The lowest coordinate per dimension after considering all particles and any boundary extensions. |
| [out] | upper | The highest coordinate per dimension after considering all particles and any boundary extensions. |
Definition at line 593 of file PartBunch.cpp.
References Dim, BinnedFieldSolver< T, Dim >::getImageChargePlaneZ(), and BinnedFieldSolver< T, Dim >::isImageChargeActiveForStep().

Compute the bunch self-fields (binned when available).
Compute the bunch self-fields (binned when available).
The actual implementation lives in the solver object (see BinnedFieldSolver). ParallelTracker only orchestrates reference/beam-frame transforms and calls this delegator once per step.
Definition at line 719 of file PartBunch.cpp.
References BinnedFieldSolver< T, Dim >::computeSelfFields().
Referenced by ParallelTracker::computeSpaceChargeFields().

ORB/binary repartition when the load balancer requests it (primary container).
ORB/binary repartition when the load balancer requests it (primary container).
Definition at line 219 of file PartBunch.cpp.
Write bin edges/counts to the data sink when configured.
Write bin edges/counts to the data sink when configured.
| preMerge | True if called before a bin-merge step. |
Definition at line 729 of file PartBunch.cpp.
References BinningCmd::dumpBinsToFile(), BinningCmd::getDumpBinsFileName(), and BinningCmd::getDumpBinsFrequency().

Definition at line 231 of file PartBunch.cpp.
Referenced by DataSink::dumpSDDS().
|
inline |
Copy cached bunch extent (rmin_m, rmax_m) from calcBeamParameters.
| [out] | rmin | Lower corner. |
| [out] | rmax | Upper corner. |
Definition at line 633 of file PartBunch.h.
References PartBunch< T, Dim >::rmax_m, and PartBunch< T, Dim >::rmin_m.
Referenced by Probe::doPreCheck(), and ParallelTracker::writePhaseSpace().
|
inline |
Stub; logs and returns zero vector.
Definition at line 660 of file PartBunch.h.
References gmsg.
Referenced by StatWriter::write().
|
inline |
Cached maximum extent (rmax_m).
Definition at line 657 of file PartBunch.h.
References PartBunch< T, Dim >::rmax_m.
Referenced by H5PartWrapperForPT::writeStepHeader().
|
inline |
Cached minimum extent (rmin_m); prefer per-container min/max for multi-beam detail.
Definition at line 655 of file PartBunch.h.
References PartBunch< T, Dim >::rmin_m.
Referenced by H5PartWrapperForPT::writeStepHeader().
Legacy RMS density field (may be unused).
Definition at line 682 of file PartBunch.h.
References PartBunch< T, Dim >::rmsDensity_m.
Referenced by StatWriter::write().
|
inline |
Current boundary-condition handler.
Definition at line 331 of file PartBunch.h.
References PartBunch< T, Dim >::bcHandler_m.
Referenced by PartBunch< T, Dim >::PartBunch().
|
inline |
Non-const access to adaptive binning state.
Definition at line 319 of file PartBunch.h.
References PartBunch< T, Dim >::bins_m.
Referenced by PartBunch< T, Dim >::getCurrentNBins().
|
inline |
Const access to adaptive binning state.
Definition at line 322 of file PartBunch.h.
References PartBunch< T, Dim >::bins_m.
|
inline |
Definition at line 335 of file PartBunch.h.
References PartBunch< T, Dim >::bunchState_m.
|
inline |
Definition at line 336 of file PartBunch.h.
References PartBunch< T, Dim >::bunchState_m.
|
inline |
Get the total charge for a given particle container.
| containerIndex | Index of the particle container. |
qi_m[containerIndex] * getParticleContainers()[containerIndex]->getTotalNum(). qi_m entries do not match, or if containerIndex is out of range. Definition at line 387 of file PartBunch.h.
References PartBunch< T, Dim >::qi_m.
Referenced by PartBunch< T, Dim >::getQ().
|
inline |
Get the charge per particle for a given particle container.
| containerIndex | Index of the particle container. |
qi_m[containerIndex]. containerIndex is out of range. Definition at line 406 of file PartBunch.h.
References PartBunch< T, Dim >::qi_m.
Referenced by Multipole::isFocusing().
Effective bin count for diagnostics (1 if binning inactive or still at max bins).
Definition at line 574 of file PartBunch.h.
References PartBunch< T, Dim >::bins_m, PartBunch< T, Dim >::getBins(), and PartBunch< T, Dim >::hasBinning().
Referenced by StatWriter::write().

Definition at line 333 of file PartBunch.h.
References PartBunch< T, Dim >::dataSink_m.
Definition at line 490 of file PartBunch.h.
Get the global time step.
Definition at line 642 of file PartBunch.h.
References PartBunch< T, Dim >::dt_m.
Referenced by Monitor::apply(), RFCavity::apply(), TravelingWave::apply(), Corrector::apply(), Monitor::applyToReferenceParticle(), ParallelTracker::autophaseCavities(), ParallelTracker::changeDT(), Monitor::driftToCorrectPositionAndSave(), ParallelTracker::execute(), ParallelTracker::findStartPositions(), Corrector::goOnline(), ParallelTracker::setTime(), ParallelTracker::timeIntegration2(), ParallelTracker::updateReferenceParticles(), ParallelTracker::updateRefToLabCSTrafo(), StatWriter::write(), and ParallelTracker::writePhaseSpace().
| PartBunch< T, Dim >::BinnedFieldSolver_t * PartBunch< T, Dim >::getFieldSolver | ( | ) |
Non-const pointer to the concrete BinnedFieldSolver.
Create adaptive bins from the binning command (VELOCITYZ / GAMMAZ).
Definition at line 277 of file PartBunch.cpp.
Referenced by ParallelTracker::execute(), and ParallelTracker::markBackwardParticlesAtSourcePlane().
| const PartBunch< T, Dim >::BinnedFieldSolver_t * PartBunch< T, Dim >::getFieldSolver | ( | ) | const |
Const overload of getFieldSolver().
Definition at line 282 of file PartBunch.cpp.
Backend type string (e.g. FFT, OPEN, CG, NONE).
Definition at line 287 of file PartBunch.cpp.
|
inline |
Current global tracking step.
Definition at line 673 of file PartBunch.h.
References PartBunch< T, Dim >::globalTrackStep_m.
Referenced by Monitor::apply(), ParallelTracker::applyGlobalProcesses(), Monitor::applyToReferenceParticle(), ParallelTracker::dumpStats(), ParallelTracker::execute(), and H5PartWrapperForPT::writeStepHeader().
Definition at line 509 of file PartBunch.h.
References PartBunch< T, Dim >::globalPartPerNode_m.
|
inline |
Get the total mass for a given particle container.
| containerIndex | Index of the particle container. |
mi_m[containerIndex] * getParticleContainers()[containerIndex]->getTotalNum(). mi_m entries do not match, or if containerIndex is out of range. Definition at line 440 of file PartBunch.h.
References PartBunch< T, Dim >::mi_m.
|
inline |
Get the mass per particle for a given particle container.
| containerIndex | Index of the particle container. |
mi_m[containerIndex]. containerIndex is out of range. Definition at line 419 of file PartBunch.h.
References PartBunch< T, Dim >::mi_m.
|
inline |
Particle species name for container i (from BEAM PARTICLE input).
Definition at line 603 of file PartBunch.h.
References PartBunch< T, Dim >::particleNames_m.
Referenced by PartBunch< T, Dim >::PartBunch(), and StatWriter::write().
|
inline |
Alias for getCharge(containerIndex).
| containerIndex | Index of the particle container. |
getCharge(containerIndex). Definition at line 431 of file PartBunch.h.
References PartBunch< T, Dim >::getCharge().

|
inline |
Definition at line 494 of file PartBunch.h.
References PartBunch< T, Dim >::reference_m.
Referenced by ParallelTracker::autophaseCavities(), BendBase::calcDesignRadius(), BendBase::calcFieldAmplitude(), BendBase::calcGamma(), ParallelTracker::execute(), PartBunch< T, Dim >::PartBunch(), RFCavity::trackOnAxisParticle(), and Tracker::visitComponent().
Get the current simulation time.
Definition at line 651 of file PartBunch.h.
References PartBunch< T, Dim >::t_m.
Referenced by Monitor::apply(), MultipoleT::apply(), RFCavity::apply(), TravelingWave::apply(), VariableRFCavity::apply(), ParallelTracker::autophaseCavities(), Monitor::driftToCorrectPositionAndSave(), ParallelTracker::dumpStats(), ParallelTracker::execute(), ParallelTracker::findStartPositions(), ParallelTracker::selectDT(), ParallelTracker::updateReferenceParticles(), LBalWriter::write(), MemoryProfiler::write(), StatWriter::write(), DataSink::writeImpactStatistics(), ParallelTracker::writePhaseSpace(), and H5PartWrapperForPT::writeStepHeader().
|
inline |
Scratch B field used by the binned solver path.
Definition at line 313 of file PartBunch.h.
References PartBunch< T, Dim >::Btmp_m.
Referenced by PartBunch< T, Dim >::PartBunch().
|
inline |
Scratch E field used by the binned solver path.
Definition at line 307 of file PartBunch.h.
References PartBunch< T, Dim >::Etmp_m.
Referenced by PartBunch< T, Dim >::PartBunch().
Get the total charge across all particle containers.
sum_i(qi_m[i] * containers[i]->getTotalNum()). qi_m entries do not match. Definition at line 457 of file PartBunch.h.
References PartBunch< T, Dim >::qi_m.
Referenced by RFCavity::initialise(), and DataSink::writeImpactStatistics().
Get the total mass across all particle containers.
sum_i(mi_m[i] * containers[i]->getTotalNum()). mi_m entries do not match. Definition at line 476 of file PartBunch.h.
References PartBunch< T, Dim >::mi_m.
|
inline |
Sum of getTotalNum() over all particle containers.
Definition at line 226 of file PartBunch.h.
Referenced by ParallelTracker::dumpStats(), ParallelTracker::execute(), ParallelTracker::printInitialContainerRefs(), and ParallelTracker::writePhaseSpace().
PicManager hook; throws (gather handled elsewhere).
Definition at line 300 of file PartBunch.h.
Definition at line 569 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getCurrentNBins().
Definition at line 554 of file PartBunch.h.
Referenced by ParallelTracker::computeSpaceChargeFields(), and ParallelTracker::execute().
Advance time by one global time step.
Definition at line 648 of file PartBunch.h.
References PartBunch< T, Dim >::dt_m, and PartBunch< T, Dim >::t_m.
Referenced by ParallelTracker::execute().
Increment globalTrackStep_m by one.
Definition at line 676 of file PartBunch.h.
References PartBunch< T, Dim >::globalTrackStep_m.
Referenced by ParallelTracker::execute().
| i | Container index. |
i participates in the current segment. Definition at line 256 of file PartBunch.h.
References PartBunch< T, Dim >::pcActive_m.
Referenced by ParallelTracker::computeExternalFields(), ParallelTracker::deleteInvalidParticles(), ParallelTracker::evolveSpinTBMT(), ParallelTracker::execute(), ParallelTracker::markBackwardParticlesAtSourcePlane(), ParallelTracker::resetFields(), ParallelTracker::timeIntegration1(), ParallelTracker::timeIntegration2(), ParallelTracker::updateReferenceParticles(), and ParallelTracker::updateRefToLabCSTrafo().
|
inline |
Do not use; throws (access momenta via ParticleContainer::P).
Definition at line 620 of file PartBunch.h.
Referenced by Corrector::apply(), PluginElement::changeWidth(), LF2< FieldFunction, Arguments >::doAdvance_m(), and Probe::doCheck().
PicManager hook; throws (scatter handled elsewhere).
Definition at line 293 of file PartBunch.h.
| i | Container index. |
i is frozen at the current z-stop. Definition at line 267 of file PartBunch.h.
References PartBunch< T, Dim >::pcAtZStop_m.
Referenced by ParallelTracker::emitFromEmissionSources().
Validate BC handler, solver wiring, field pointers, and layout extents.
Validate BC handler, solver wiring, field pointers, and layout extents.
| OpalException | if initialization is inconsistent. |
Definition at line 780 of file PartBunch.cpp.
Referenced by ParallelTracker::execute().
Warm-up: zero rho and run the field solver once (skip full dumps).
Warm-up: zero rho and run the field solver once (skip full dumps).
Definition at line 439 of file PartBunch.cpp.
Referenced by PartBunch< T, Dim >::PartBunch().
Human-readable dump of each container to os.
Human-readable dump of each container to os.
| os | Output stream wrapper. |
os. Definition at line 460 of file PartBunch.cpp.
References ParticleContainer< T, Dim >::Attributes, Dim, Util::getEnergyString(), and Util::getLengthString().

|
inline |
Do not use; throws (access positions via ParticleContainer::R).
Definition at line 611 of file PartBunch.h.
Referenced by Corrector::apply(), VerticalFFAMagnet::apply(), BendBase::apply(), ConstantEFieldCavity::apply(), Monitor::apply(), Multipole::apply(), RFCavity::apply(), ScalingFFAMagnet::apply(), Solenoid::apply(), TravelingWave::apply(), Ring::apply(), ParallelTracker::computeSpaceChargeFields(), LF2< FieldFunction, Arguments >::doAdvance_m(), Probe::doCheck(), ParallelTracker::emitFromEmissionSources(), and H5PartWrapperForPT::writeStepData().
After emission: reactivate non-empty containers not marked at z-stop.
After emission: reactivate non-empty containers not marked at z-stop.
Definition at line 198 of file PartBunch.cpp.
Referenced by ParallelTracker::emitFromEmissionSources().
Reinitialize the z dimension of the field grid to nrZ cells.
Refresh mesh from particle extents, update layouts, and recompute moments.
Rebuilds the FieldLayout, all field arrays, the accumulation buffers, and the IPPL Poisson solver to match the new z extent. A no-op if nrZ equals the current z cell count. Called from bunchUpdate to double the z resolution while image charges are active.
| nrZ | Target number of z grid cells. |
Definition at line 528 of file PartBunch.cpp.
References Dim.
At segment start: active if container is non-empty; inactive if empty.
At segment start: active if container is non-empty; inactive if empty.
Definition at line 166 of file PartBunch.cpp.
Referenced by ParallelTracker::execute(), and PartBunch< T, Dim >::PartBunch().
|
inline |
| bcHandler | Boundary-condition handler for the mesh. |
Definition at line 328 of file PartBunch.h.
References PartBunch< T, Dim >::bcHandler_m.
Referenced by PartBunch< T, Dim >::PartBunch().
Create adaptive bins from the binning command (VELOCITYZ / GAMMAZ).
Definition at line 292 of file PartBunch.cpp.
References GAMMAZ, BinningCmd::getBinningAlpha(), BinningCmd::getBinningBeta(), BinningCmd::getDesiredWidth(), BinningCmd::getMaxBins(), Object::getOpalName(), BinningCmd::getParameter(), BinningCmd::getParameterType(), and VELOCITYZ.

|
inline |
| bins | Adaptive binning object (or nullptr to clear). |
Definition at line 325 of file PartBunch.h.
References PartBunch< T, Dim >::bins_m.
Set the per-particle charge for each particle container.
qi_m into each particle container via setQ. qi_m entries do not match. Definition at line 351 of file PartBunch.h.
References PartBunch< T, Dim >::qi_m.
Set the global time step.
Definition at line 639 of file PartBunch.h.
References PartBunch< T, Dim >::dt_m.
Referenced by ParallelTracker::execute(), and ParallelTracker::selectDT().
|
inline |
| n | Global step counter to store. |
Definition at line 670 of file PartBunch.h.
References PartBunch< T, Dim >::globalTrackStep_m.
Referenced by H5PartWrapperForPT::readStepHeader().
| void PartBunch< T, Dim >::setImageChargeConfiguration | ( | bool | enabled, |
| double | zPlane | ||
| ) |
Set the image-charge configuration for the field solver.
| enabled | Enable image-charge scatter mirror when true. |
| zPlane | Mirror plane position in z [m]. |
Definition at line 696 of file PartBunch.cpp.
Set the per-particle mass for each particle container.
mi_m into each particle container via setM. mi_m entries do not match. Definition at line 368 of file PartBunch.h.
References PartBunch< T, Dim >::mi_m.
Force container i active (e.g. for containers with pending emission).
Definition at line 259 of file PartBunch.h.
References PartBunch< T, Dim >::pcActive_m.
Referenced by ParallelTracker::activateEmittingContainers().
Deactivate container i until the next step-size segment (z-stop reached).
Deactivate container i until the next step-size segment (z-stop reached).
Definition at line 186 of file PartBunch.cpp.
Referenced by ParallelTracker::execute().
|
inline |
Set inside TrackRun::execute.
Definition at line 497 of file PartBunch.h.
References Units::eV2GeV, PartData::getM(), and PartBunch< T, Dim >::reference_m.

| void PartBunch< T, Dim >::setShiftedGreensConfiguration | ( | bool | enabled, |
| double | zPlane | ||
| ) |
Set the shifted Green's function Dirichlet-correction configuration.
Alternative to setImageChargeConfiguration. Mutually exclusive with it. Requires the OPEN field solver (checked at runtime in the correction pass).
| enabled | Enable the shifted-Green's-function correction when true. |
| zPlane | Dirichlet plane position in z [m]. |
Definition at line 701 of file PartBunch.cpp.
Build field solver and load balancer from OPALFieldSolver_m.
Build field solver and load balancer from OPALFieldSolver_m.
Definition at line 241 of file PartBunch.cpp.
References BinningCmd::getAdaptiveBinning(), and BinningCmd::getTablePrintFrequency().
Referenced by PartBunch< T, Dim >::PartBunch().

Set the current simulation time.
Definition at line 645 of file PartBunch.h.
References PartBunch< T, Dim >::t_m.
Referenced by ParallelTracker::execute(), ParallelTracker::findStartPositions(), PartBunch< T, Dim >::PartBunch(), and H5PartWrapperForPT::readStepHeader().
|
inline |
| Btmp | Scratch B field matching the mesh layout. |
Definition at line 316 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
|
inline |
| Etmp | Scratch E field matching the mesh layout. |
Definition at line 310 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
Set the maximum number of timesteps for which image charges are active (0 = unlimited).
Definition at line 711 of file PartBunch.cpp.
| void PartBunch< T, Dim >::setZeroFacePlaneDumpFrequency | ( | int | frequency | ) |
Configure diagnostic dump frequency for the ZEROFACE plane potential.
| frequency | Dump every n-th global timestep. 0 disables dumping. |
Definition at line 706 of file PartBunch.cpp.
Definition at line 338 of file PartBunch.h.
Referenced by DataSink::dumpSDDS(), and ParallelTracker::dumpStats().
|
private |
Field boundary conditions.
Definition at line 104 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getBCHandler(), and PartBunch< T, Dim >::setBCHandler().
|
private |
Adaptive velocity/gamma binning (optional).
Definition at line 105 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getBins(), PartBunch< T, Dim >::getBins(), PartBunch< T, Dim >::getCurrentNBins(), and PartBunch< T, Dim >::setBins().
|
private |
Scratch B field for binned accumulation (same layout as mesh B).
Definition at line 114 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getTempBField().
|
private |
Bunch state: unitless flag, repartition flag, etc.
Definition at line 102 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getBunchStateHandler(), PartBunch< T, Dim >::getBunchStateHandler(), and PartBunch< T, Dim >::PartBunch().
Borrowed diagnostics and dump output sink.
Definition at line 107 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getDataSink(), and PartBunch< T, Dim >::PartBunch().
Domain decomposition flags (per axis).
Definition at line 89 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
Global mesh index extent per dimension.
Definition at line 88 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
Global time step \(\Delta t\) (s).
Definition at line 73 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getdT(), PartBunch< T, Dim >::incrementT(), PartBunch< T, Dim >::PartBunch(), and PartBunch< T, Dim >::setdT().
|
private |
Scratch E field for binned accumulation (same layout as mesh E).
Definition at line 112 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getTempEField().
|
private |
Per-rank particle counts for load-balance stats.
Definition at line 119 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getLoadBalance(), and PartBunch< T, Dim >::PartBunch().
Global integration step counter.
Definition at line 116 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getGlobalTrackStep(), PartBunch< T, Dim >::incTrackSteps(), and PartBunch< T, Dim >::setGlobalTrackStep().
Mesh spacing (m).
Definition at line 84 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::get_hr(), and PartBunch< T, Dim >::PartBunch().
Integrator name (e.g. leapfrog).
Definition at line 75 of file PartBunch.h.
True until the first ORB-style repartition completes.
Definition at line 87 of file PartBunch.h.
Iteration counter (legacy / diagnostics).
Definition at line 74 of file PartBunch.h.
Load-balancer timescale parameter.
Definition at line 86 of file PartBunch.h.
Mass per macroparticle [GeV], one entry per container.
Definition at line 97 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getM(), PartBunch< T, Dim >::getMassPerParticle(), PartBunch< T, Dim >::getTotalMass(), PartBunch< T, Dim >::PartBunch(), and PartBunch< T, Dim >::setMass().
Mesh cell count per dimension.
Definition at line 77 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
Base z grid count before any image-charge doubling; used to reset nr_m.
Definition at line 78 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
|
private |
Borrowed parsed FIELD_SOLVER command.
Definition at line 106 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
Mesh origin (lab coordinates).
Definition at line 79 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::PartBunch().
|
private |
Per-container beam particle names.
Definition at line 94 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getParticleName(), and PartBunch< T, Dim >::PartBunch().
Per-container: participate in this track segment.
Definition at line 92 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::anyPcActive(), PartBunch< T, Dim >::isPcActive(), and PartBunch< T, Dim >::setPcActive().
Per-container: frozen at current z-stop until next segment.
Definition at line 93 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::pcAtZStop().
Charge per macroparticle [C], one entry per container.
Definition at line 96 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getCharge(), PartBunch< T, Dim >::getChargePerParticle(), PartBunch< T, Dim >::getTotalCharge(), PartBunch< T, Dim >::PartBunch(), and PartBunch< T, Dim >::setCharge().
|
private |
Reference particle data (set by TrackRun::execute).
Definition at line 99 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getReference(), and PartBunch< T, Dim >::setReference().
Current bunch spatial maximum (from primary container stats).
Definition at line 83 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::get_bounds(), PartBunch< T, Dim >::get_maxExtent(), and PartBunch< T, Dim >::PartBunch().
Current bunch spatial minimum (from primary container stats; see calcBeamParameters).
Definition at line 80 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::get_bounds(), PartBunch< T, Dim >::get_origin(), and PartBunch< T, Dim >::PartBunch().
Legacy RMS density placeholder (may still appear in stats).
Definition at line 121 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::get_rmsDensity().
Field solver type string from input.
Definition at line 76 of file PartBunch.h.
Current simulation time (s).
Definition at line 109 of file PartBunch.h.
Referenced by PartBunch< T, Dim >::getT(), PartBunch< T, Dim >::incrementT(), and PartBunch< T, Dim >::setT().