11#include <Kokkos_Random.hpp>
44 FlatTop(std::shared_ptr<ParticleContainer_t> &pc,
45 std::shared_ptr<FieldContainer_t> &fc,
46 std::shared_ptr<Distribution_t> &opalDist);
60 FlatTop(std::shared_ptr<ParticleContainer_t> &pc,
61 std::shared_ptr<FieldContainer_t> &fc,
66 double tPulseLengthFWHM,
80 FlatTop(std::shared_ptr<ParticleContainer_t> &pc,
85 double tPulseLengthFWHM,
159 void setParameters(
const std::shared_ptr<Distribution_t> &opalDist);
237 double tPulseLengthFWHM,
typename Kokkos::Random_XorShift64_Pool<> GeneratorPool
Implements the sampling method for the flat-top distribution.
void setNr(Vector_t< double, 3 > nr)
Sets the number of grid points per direction.
void setDistArea(double distArea)
Sets the total area of the distribution.
void testEmitParticles(size_type nsteps, double dt) override
Tests particle emission over a given number of steps.
double distArea_m
Total area of the flattop distribution.
Vector_t< double, 3 > sigmaR_m
double FlatTopProfile(double t)
Computes the flat-top profile value at a given time.
bool emitting_m
Flag for particle emission status.
Vector_t< double, 3 > nr_m
Number of grid points per direction.
static size_t determineRandInit()
Determines the random seed initialization.
void allocateParticles(size_t numberOfParticles)
Allocates memory for a given number of particles.
double emissionTime_m
Total emission time.
double sigmaTRise_m
Standard deviation for rise time profile.
size_type totalN_m
Total number of particles.
GeneratorPool rand_pool_m
Random number generator pool.
double sigmaTFall_m
Standard deviation for fall time profile.
bool withDomainDecomp_m
Flag for domain decomposition.
void initDomainDecomp(double BoxIncr) override
Initializes the domain decomposition.
Vector_t< double, 3 > hr_m
Grid spacing.
double integrateTrapezoidal(double x1, double x2, double y1, double y2)
Integrates using the trapezoidal rule.
double fallTime_m
Time duration for the fall phase.
size_t computeNlocalUniformly(size_t nglobal)
Computes the local number of particles uniformly distributed among ranks.
double normalizedFlankArea_m
Normalized area of the distribution flanks.
void setWithDomainDecomp(bool withDomainDecomp) override
Sets whether to use domain decomposition.
double getEmissionTime()
Returns the total emission time.
void emitParticles(double t, double dt) override
Emits new particles within a given time interval.
void setInternalVariables(bool emitting, double sigmaTFall, double sigmaTRise, Vector_t< double, 3 > cutoff, double tPulseLengthFWHM, Vector_t< double, 3 > sigmaR)
double riseTime_m
Time duration for the rise phase.
void generateParticles(size_t &numberOfParticles, Vector_t< double, 3 > nr) override
Generates particles with a given number and grid configuration.
double countEnteringParticlesPerRank(double t0, double tf)
Counts the number of particles entering per rank in a given time interval.
void generateUniformDisk(size_type nlocal, size_t nNew)
Generates particles (x,y) uniformly on a disk distribution.
void testNumEmitParticles(size_type nsteps, double dt) override
Tests the number of emitted particles over a given number of steps.
Vector_t< double, 3 > cutoffR_m
Cutoff radius.
double flattopTime_m
Time duration of when the time profile is flat.
FlatTop(std::shared_ptr< ParticleContainer_t > &pc, std::shared_ptr< FieldContainer_t > &fc, std::shared_ptr< Distribution_t > &opalDist)
Constructor for FlatTop.
ippl::detail::size_type size_type
void setParameters(const std::shared_ptr< Distribution_t > &opalDist)
Sets distribution parameters.
double getDistArea()
Returns the total area of the distribution.