1#ifndef OPAL_GLOBALPROCESS_DECAY_H
2#define OPAL_GLOBALPROCESS_DECAY_H
8#include <Kokkos_Core.hpp>
9#include <Kokkos_Random.hpp>
30 Decay(
double restLifetimeSeconds, std::size_t containerIndex,
double parentMassGeV,
31 int parentChargeSign);
48 size_t containerIdx)
override;
59 std::size_t localDestroyNum, std::size_t oldDaughterLocal,
60 const Kokkos::View<ippl::Vector<double, 3>*>& parentR,
61 const Kokkos::View<ippl::Vector<double, 3>*>& parentP,
62 const Kokkos::View<double*>& parentDt,
63 const Kokkos::View<ippl::Vector<float, 3>*>& parentPol) = 0;
68 Kokkos::View<ippl::Vector<double, 3>*>
R;
69 Kokkos::View<ippl::Vector<double, 3>*>
P;
70 Kokkos::View<double*>
dt;
71 Kokkos::View<ippl::Vector<float, 3>*>
Pol;
81 ippl::detail::size_type nLocal,
double dt, Kokkos::View<ippl::Vector<double, 3>*> Pview,
82 Kokkos::View<bool*> decayed);
91 ippl::detail::size_type nLocal, ippl::detail::size_type localDestroyNum,
92 Kokkos::View<bool*> decayed, Kokkos::View<ippl::Vector<double, 3>*> Rview,
93 Kokkos::View<ippl::Vector<double, 3>*> Pview, Kokkos::View<double*> dtView,
94 Kokkos::View<ippl::Vector<float, 3>*> PolView);
Abstract base class for particle decay processes.
DecayedParentViews collectDecayedParents(ippl::detail::size_type nLocal, ippl::detail::size_type localDestroyNum, Kokkos::View< bool * > decayed, Kokkos::View< ippl::Vector< double, 3 > * > Rview, Kokkos::View< ippl::Vector< double, 3 > * > Pview, Kokkos::View< double * > dtView, Kokkos::View< ippl::Vector< float, 3 > * > PolView)
Gather R/P/dt of parents marked for decay into compact views.
ippl::detail::size_type markDecayedParticles(ippl::detail::size_type nLocal, double dt, Kokkos::View< ippl::Vector< double, 3 > * > Pview, Kokkos::View< bool * > decayed)
Mark particles for decay using the relativistic exponential law.
Kokkos::View< ippl::Vector< double, 3 > * > R
double tau0_m
Mean lifetime at rest [s].
Kokkos::Random_XorShift64_Pool randPool_m
Random pool for decay sampling.
virtual void createDaughterParticles(std::size_t localDestroyNum, std::size_t oldDaughterLocal, const Kokkos::View< ippl::Vector< double, 3 > * > &parentR, const Kokkos::View< ippl::Vector< double, 3 > * > &parentP, const Kokkos::View< double * > &parentDt, const Kokkos::View< ippl::Vector< float, 3 > * > &parentPol)=0
Create daughter particles from collected parent data.
double parentMassGeV_m
Rest mass of the parent particle [GeV].
Kokkos::View< ippl::Vector< double, 3 > * > P
Kokkos::View< double * > dt
size_t apply(ParticleContainer< double, 3 > &pc, double dt, long long globalTrackStep, size_t containerIdx) override
~Decay() override=default
Kokkos::View< ippl::Vector< float, 3 > * > Pol
std::shared_ptr< ParticleContainer< double, 3 > > daughterPC_m
Daughter container for decay products (nullptr = destroy-only mode).
short allowedDaughterSpecies_m
void setDaughterContainer(std::shared_ptr< ParticleContainer< double, 3 > > daughterPC, double daughterMassGeV)
Set the daughter particle container and its rest mass.
double daughterMassGeV_m
Rest mass of the daughter particle [GeV].
Container for all per-particle (and per-simulation) fields tracked during OPALX tracking.