|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
|
Generating particles following a Gaussian distribution. More...
#include <Gaussian.h>
Public Member Functions | |
| Gaussian (std::shared_ptr< ParticleContainer_t > &pc, std::shared_ptr< FieldContainer_t > &fc, std::shared_ptr< Distribution_t > &opalDist) | |
| Constructor for the Gaussian sampler. | |
| Gaussian (std::shared_ptr< ParticleContainer_t > pc, const Vector_t< double, 3 > &sigmaR, const Vector_t< double, 3 > &sigmaP, double avrgpz, const Vector_t< double, 3 > &cutoffR, bool fix_meanR=true) | |
| Constructor for the Gaussian sampler without field container and distribution object. | |
| void | generateParticles (size_t &numberOfParticles, Vector_t< double, 3 > nr) override |
| Generates particles with a Gaussian distribution. | |
| void | setSigmaR (const Vector_t< double, 3 > &sigmaR) |
| void | setSigmaP (const Vector_t< double, 3 > &sigmaP) |
| void | setAvrgpz (double avrgpz) |
| void | setCutoffR (const Vector_t< double, 3 > &cutoffR) |
| void | getParameters (Vector_t< double, 3 > &sigmaR, Vector_t< double, 3 > &sigmaP, double &avrgpz, Vector_t< double, 3 > &cutoffR) const |
| void | setFixMeanR (bool fixMeanR) |
| void | getFixMeanR (bool &fixMeanR) const |
| virtual void | emitParticles (double t, double dt) |
| virtual void | testNumEmitParticles (size_t nsteps, double dt) |
| virtual void | testEmitParticles (size_t nsteps, double dt) |
| virtual void | initDomainDecomp (double BoxIncr) |
| virtual void | setWithDomainDecomp (bool withDomainDecomp) |
Public Attributes | |
| IpplTimings::TimerRef | samperTimer_m |
| Timer for performance profiling. | |
Protected Attributes | |
| std::shared_ptr< ParticleContainer_t > | pc_m |
| std::shared_ptr< FieldContainer_t > | fc_m |
| std::shared_ptr< Distribution_t > | opalDist_m |
| std::string | samplingMethod_m |
Private Member Functions | |
| void | initRandomPool () |
| Initializes the random number generator pool. | |
Private Attributes | |
| GeneratorPool | randPool_m |
| Pool of random number generators for parallel sampling. | |
| Vector_t< double, 3 > | sigmaR_m |
| Standard deviations for position and momentum distributions. | |
| Vector_t< double, 3 > | sigmaP_m |
| double | avrgpz_m |
| Average momentum in the z-direction. | |
| Vector_t< double, 3 > | cutoffR_m |
| Cutoff multiplier for position distribution. | |
| bool | fixMeanR_m = true |
| Flag to exactly fix the mean position of particles after sampling. | |
Generating particles following a Gaussian distribution.
This function samples particle positions R and momenta P given following normal distributions a normal distribution R ~ N ( [0, 0, 0 ], sdR) P ~ N ( [0, 0, avrgpz], sdP) where sdR = [SigmaR[0] 0 0 0 SigmaR[1] 0 0 0 SigmaR[2]]
and sdP = [SigmaP[0] 0 0 0 SigmaP[1] 0 0 0 SigmaP[2]].
Here, R is sampled in a bounded domains R \in [-CutoffR*SigmaR, CutoffR*SigmaR]^3 and corrected by translation to ensure mean = [0,0,0].
| numberOfParticles | The total number of particles to generate. |
| nr | The number of grid points in each dimension (not used here). |
Definition at line 41 of file Gaussian.h.
| Gaussian::Gaussian | ( | std::shared_ptr< ParticleContainer_t > & | pc, |
| std::shared_ptr< FieldContainer_t > & | fc, | ||
| std::shared_ptr< Distribution_t > & | opalDist ) |
Constructor for the Gaussian sampler.
Constructs a Gaussian sampler.
| pc | Shared pointer to the particle container. |
| fc | Shared pointer to the field container. |
| opalDist | Shared pointer to the distribution object. |
Definition at line 14 of file Gaussian.cpp.
References initRandomPool(), samperTimer_m, SamplingBase::SamplingBase(), setAvrgpz(), setCutoffR(), setSigmaP(), and setSigmaR().
| Gaussian::Gaussian | ( | std::shared_ptr< ParticleContainer_t > | pc, |
| const Vector_t< double, 3 > & | sigmaR, | ||
| const Vector_t< double, 3 > & | sigmaP, | ||
| double | avrgpz, | ||
| const Vector_t< double, 3 > & | cutoffR, | ||
| bool | fix_meanR = true ) |
Constructor for the Gaussian sampler without field container and distribution object.
| pc | Shared pointer to the particle container. |
| sigmaR | Standard deviation for position distribution. |
| sigmaP | Standard deviation for momentum distribution. |
| avrgpz | Average momentum in the z-direction. |
| cutoffR | Cutoff multiplier for position distribution. |
| fix_meanR | Flag to exactly fix the mean position of particles after sampling. |
Definition at line 26 of file Gaussian.cpp.
References initRandomPool(), samperTimer_m, SamplingBase::SamplingBase(), setAvrgpz(), setCutoffR(), setFixMeanR(), setSigmaP(), and setSigmaR().
|
inlinevirtualinherited |
Reimplemented in FlatTop.
Definition at line 31 of file SamplingBase.hpp.
|
overridevirtual |
Generates particles with a Gaussian distribution.
Generates particles following a Gaussian distribution.
| numberOfParticles | The total number of particles to generate. |
| nr | the number of grid cells in R (used in domain decomposition). |
| numberOfParticles | The total number of particles to generate. |
| nr | The number of grid points in each dimension (not used here). |
Reimplemented from SamplingBase.
Definition at line 64 of file Gaussian.cpp.
References avrgpz_m, cutoffR_m, fixMeanR_m, gmsg, nr, SamplingBase::pc_m, randPool_m, samperTimer_m, sigmaP_m, and sigmaR_m.
|
inline |
Definition at line 111 of file Gaussian.h.
References fixMeanR_m.
|
inlinevirtualinherited |
Reimplemented in FlatTop.
Definition at line 39 of file SamplingBase.hpp.
|
private |
Initializes the random number generator pool.
Definition at line 42 of file Gaussian.cpp.
References gmsg, randPool_m, and Options::seed.
Referenced by Gaussian(), and Gaussian().
|
inline |
Definition at line 89 of file Gaussian.h.
References avrgpz_m.
Referenced by Gaussian(), and Gaussian().
|
inline |
Definition at line 93 of file Gaussian.h.
References cutoffR_m.
Referenced by Gaussian(), and Gaussian().
|
inline |
Definition at line 107 of file Gaussian.h.
References fixMeanR_m.
Referenced by Gaussian().
|
inline |
Definition at line 85 of file Gaussian.h.
References sigmaP_m.
Referenced by Gaussian(), and Gaussian().
|
inline |
Definition at line 81 of file Gaussian.h.
References sigmaR_m.
Referenced by Gaussian(), and Gaussian().
|
inlinevirtualinherited |
Reimplemented in FlatTop.
Definition at line 41 of file SamplingBase.hpp.
|
inlinevirtualinherited |
Definition at line 37 of file SamplingBase.hpp.
|
inlinevirtualinherited |
Definition at line 34 of file SamplingBase.hpp.
|
private |
Average momentum in the z-direction.
Definition at line 135 of file Gaussian.h.
Referenced by generateParticles(), getParameters(), and setAvrgpz().
|
private |
Cutoff multiplier for position distribution.
Definition at line 140 of file Gaussian.h.
Referenced by generateParticles(), getParameters(), and setCutoffR().
|
protectedinherited |
Definition at line 14 of file SamplingBase.hpp.
Referenced by FlatTop::initDomainDecomp(), SamplingBase(), and FlatTop::setParameters().
|
private |
Flag to exactly fix the mean position of particles after sampling.
Definition at line 145 of file Gaussian.h.
Referenced by generateParticles(), getFixMeanR(), and setFixMeanR().
|
protectedinherited |
Definition at line 15 of file SamplingBase.hpp.
Referenced by FlatTop::countEnteringParticlesPerRank(), FlatTop::generateUniformDisk(), FlatTop::initDomainDecomp(), MultiVariateGaussian::MultiVariateGaussian(), SamplingBase(), and FlatTop::setParameters().
|
protectedinherited |
Definition at line 13 of file SamplingBase.hpp.
Referenced by FlatTop::allocateParticles(), FlatTop::countEnteringParticlesPerRank(), FlatTop::emitParticles(), FlatTop::generateParticles(), Gaussian::generateParticles(), MultiVariateGaussian::generateParticles(), FlatTop::generateUniformDisk(), FlatTop::initDomainDecomp(), SamplingBase(), SamplingBase(), and FlatTop::testNumEmitParticles().
|
private |
Pool of random number generators for parallel sampling.
Definition at line 124 of file Gaussian.h.
Referenced by generateParticles(), and initRandomPool().
| IpplTimings::TimerRef Gaussian::samperTimer_m |
Timer for performance profiling.
Definition at line 46 of file Gaussian.h.
Referenced by Gaussian(), Gaussian(), and generateParticles().
|
protectedinherited |
Definition at line 16 of file SamplingBase.hpp.
|
private |
Definition at line 130 of file Gaussian.h.
Referenced by generateParticles(), getParameters(), and setSigmaP().
|
private |
Standard deviations for position and momentum distributions.
Definition at line 129 of file Gaussian.h.
Referenced by generateParticles(), getParameters(), and setSigmaR().