OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <DistributionMoments.h>
Private Types | |
using | iterator_t = std::vector< Vektor< double, 2 > >::const_iterator |
Private Member Functions | |
bool | isParticleExcluded (const OpalParticle &) const |
template<class InputIt > | |
void | computeMeans (const InputIt &, const InputIt &) |
template<class InputIt > | |
void | computeStatistics (const InputIt &, const InputIt &) |
template<class InputIt > | |
void | computePercentiles (const InputIt &, const InputIt &) |
std::pair< double, iterator_t > | determinePercentilesDetail (const iterator_t &begin, const iterator_t &end, const std::vector< int > &globalAccumulatedHistogram, const std::vector< int > &localAccumulatedHistogram, unsigned int dimension, int numRequiredParticles) const |
double | computeNormalizedEmittance (const iterator_t &begin, const iterator_t &end) const |
void | fillMembers (std::vector< double > const &) |
void | reset () |
void | resetPlasmaParameters () |
Private Attributes | |
Vector_t | meanR_m |
Vector_t | meanP_m |
Vector_t | stdR_m |
Vector_t | stdP_m |
Vector_t | stdRP_m |
Vector_t | normalizedEps_m |
Vector_t | geometricEps_m |
Vector_t | halo_m |
Vector_t | maxR_m |
Vector_t | minR_m |
Vector_t | sixtyEightPercentile_m |
Vector_t | normalizedEps68Percentile_m |
Vector_t | ninetyFivePercentile_m |
Vector_t | normalizedEps95Percentile_m |
Vector_t | ninetyNinePercentile_m |
Vector_t | normalizedEps99Percentile_m |
Vector_t | ninetyNine_NinetyNinePercentile_m |
Vector_t | normalizedEps99_99Percentile_m |
double | meanTime_m |
double | stdTime_m |
double | meanKineticEnergy_m |
double | temperature_m |
double | debyeLength_m |
double | plasmaParameter_m |
double | stdKineticEnergy_m |
double | meanGamma_m |
double | centroid_m [6] |
FMatrix< double, 6, 6 > | moments_m |
double | totalCharge_m |
double | totalMass_m |
unsigned int | totalNumParticles_m |
Static Private Attributes | |
static const double | percentileOneSigmaNormalDist_m = std::erf(1 / sqrt(2)) |
static const double | percentileTwoSigmasNormalDist_m = std::erf(2 / sqrt(2)) |
static const double | percentileThreeSigmasNormalDist_m = std::erf(3 / sqrt(2)) |
static const double | percentileFourSigmasNormalDist_m = std::erf(4 / sqrt(2)) |
Definition at line 33 of file DistributionMoments.h.
|
private |
Definition at line 88 of file DistributionMoments.h.
DistributionMoments::DistributionMoments | ( | ) |
Definition at line 40 of file DistributionMoments.cpp.
References reset(), and resetPlasmaParameters().
void DistributionMoments::compute | ( | const std::vector< OpalParticle >::const_iterator & | first, |
const std::vector< OpalParticle >::const_iterator & | last | ||
) |
Definition at line 51 of file DistributionMoments.cpp.
References computeStatistics().
Referenced by LossDataSink::saveH5().
void DistributionMoments::compute | ( | PartBunchBase< double, 3 > const & | bunch | ) |
Definition at line 46 of file DistributionMoments.cpp.
References PartBunchBase< T, Dim >::begin(), computeStatistics(), and PartBunchBase< T, Dim >::end().
void DistributionMoments::computeDebyeLength | ( | PartBunchBase< double, 3 > const & | bunch_r, |
double | density | ||
) |
Definition at line 434 of file DistributionMoments.cpp.
References allreduce(), Physics::c, computePlasmaParameter(), debyeLength_m, Physics::epsilon_0, Units::eV2kg, Util::getGamma(), PartBunchBase< T, Dim >::getTotalNum(), Units::GeV2eV, Physics::m_e, pow(), Physics::q_e, resetPlasmaParameters(), sqrt(), and temperature_m.
void DistributionMoments::computeMeanKineticEnergy | ( | PartBunchBase< double, 3 > const & | bunch | ) |
Definition at line 422 of file DistributionMoments.cpp.
References allreduce(), Util::getKineticEnergy(), PartBunchBase< T, Dim >::getLocalNum(), and meanKineticEnergy_m.
|
private |
Definition at line 58 of file DistributionMoments.cpp.
References allreduce(), centroid_m, Util::getGamma(), OpalParticle::getMass(), OpalParticle::getP(), OpalParticle::getTime(), isParticleExcluded(), max(), maxR_m, meanGamma_m, meanKineticEnergy_m, meanP_m, meanR_m, meanTime_m, minR_m, and totalNumParticles_m.
Referenced by computeStatistics().
|
private |
Definition at line 340 of file DistributionMoments.cpp.
References allreduce(), begin(), end(), max(), pow(), and sqrt().
Referenced by computePercentiles().
|
private |
Definition at line 167 of file DistributionMoments.cpp.
References abs(), allreduce(), computeNormalizedEmittance(), Options::computePercentiles, determinePercentilesDetail(), floor(), log10(), max(), maxR_m, meanR_m, minR_m, ninetyFivePercentile_m, ninetyNine_NinetyNinePercentile_m, ninetyNinePercentile_m, normalizedEps68Percentile_m, normalizedEps95Percentile_m, normalizedEps99_99Percentile_m, normalizedEps99Percentile_m, percentileFourSigmasNormalDist_m, percentileOneSigmaNormalDist_m, percentileThreeSigmasNormalDist_m, percentileTwoSigmasNormalDist_m, pow(), sixtyEightPercentile_m, and totalNumParticles_m.
Referenced by computeStatistics().
void DistributionMoments::computePlasmaParameter | ( | double | density | ) |
Definition at line 476 of file DistributionMoments.cpp.
References debyeLength_m, Physics::pi, plasmaParameter_m, and pow().
Referenced by computeDebyeLength().
|
private |
Definition at line 123 of file DistributionMoments.cpp.
References allreduce(), centroid_m, computeMeans(), computePercentiles(), fillMembers(), OpalParticle::getCharge(), Util::getKineticEnergy(), OpalParticle::getMass(), OpalParticle::getP(), OpalParticle::getTime(), isParticleExcluded(), meanKineticEnergy_m, meanTime_m, pow(), reset(), and totalNumParticles_m.
Referenced by compute().
|
private |
Computes the percentile and the range of all local particles that are contained therein. In a first step the container globalAccumulatedHistogram is looped through until accumulated histogram value exceeds the required number of particles. The percentile then is between the boundaries of the last histogram bin before the loop stopped. Then all particle coordinates that are between the boundaries of this bin are communicated acros all nodes and sorted. The exact percentile is then determined by counting the n smallest coordinates such that the total number of partiles results is equal to 'numRequiredParticles'. In accordance with matlab (?) the percentile is the midpoint between the last particle within the percentile and tje first particle outside. Finally each node determines which of its particles are contained in the percentile.
To determine the histogram, the coordinates should not be used directly. Instead, the absolute value of the difference between a coordinate and the mean, |x - <x>|, should be used so that the percentile values are similar to the standard deviation.
begin | begin of a container containing the one dimensional phase space of all local particles. |
end | end of the container. |
globalAccumulatedHistogram | container with partial sum of histogram values of position coordinates summed up across all nodes. The first value should be 0. |
localAccumulatedHistogram | container with partial sum of histogram values of position coordinates of all local particles. The first value should be 0. |
dimension | dimension of the one dimensional phase space. |
numRequiredParticles | number of particles that are contained in the requested percentile. Is determined by the total number of particles and the percentile. |
Definition at line 292 of file DistributionMoments.cpp.
References abs(), allreduce(), begin(), end(), IpplInfo::getNodes(), meanR_m, and IpplInfo::myNode().
Referenced by computePercentiles().
|
private |
Definition at line 376 of file DistributionMoments.cpp.
References centroid_m, geometricEps_m, halo_m, Options::haloShift, max(), meanGamma_m, meanP_m, meanR_m, moments_m, normalizedEps_m, pow(), sqrt(), stdKineticEnergy_m, stdP_m, stdR_m, stdRP_m, stdTime_m, totalCharge_m, totalMass_m, and totalNumParticles_m.
Referenced by computeStatistics().
|
inline |
Definition at line 285 of file DistributionMoments.h.
References sixtyEightPercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 297 of file DistributionMoments.h.
References ninetyFivePercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 321 of file DistributionMoments.h.
References ninetyNine_NinetyNinePercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 309 of file DistributionMoments.h.
References ninetyNinePercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 243 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 255 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 220 of file DistributionMoments.h.
References debyeLength_m.
|
inline |
Definition at line 237 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 249 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 170 of file DistributionMoments.h.
References geometricEps_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 182 of file DistributionMoments.h.
References halo_m.
|
inline |
Definition at line 333 of file DistributionMoments.h.
References abs(), max(), maxR_m, and minR_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 200 of file DistributionMoments.h.
References meanGamma_m.
|
inline |
Definition at line 206 of file DistributionMoments.h.
References meanKineticEnergy_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 152 of file DistributionMoments.h.
References meanP_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 140 of file DistributionMoments.h.
References meanR_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 188 of file DistributionMoments.h.
References meanTime_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 261 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 164 of file DistributionMoments.h.
References normalizedEps_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 291 of file DistributionMoments.h.
References normalizedEps68Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 303 of file DistributionMoments.h.
References normalizedEps95Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 327 of file DistributionMoments.h.
References normalizedEps99_99Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 315 of file DistributionMoments.h.
References normalizedEps99Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 225 of file DistributionMoments.h.
References plasmaParameter_m.
|
inline |
Definition at line 158 of file DistributionMoments.h.
References stdP_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 146 of file DistributionMoments.h.
References stdR_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 176 of file DistributionMoments.h.
References stdRP_m.
|
inline |
Definition at line 231 of file DistributionMoments.h.
References stdKineticEnergy_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 194 of file DistributionMoments.h.
References stdTime_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 213 of file DistributionMoments.h.
References Physics::c, Units::eV2kg, Physics::kB, and temperature_m.
|
inline |
Definition at line 267 of file DistributionMoments.h.
References totalCharge_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 273 of file DistributionMoments.h.
References totalMass_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 279 of file DistributionMoments.h.
References totalNumParticles_m.
|
private |
Definition at line 521 of file DistributionMoments.cpp.
References Options::amr, OpalParticle::getId(), OpalData::getInstance(), and OpalData::isInOPALCyclMode().
Referenced by computeMeans(), and computeStatistics().
|
private |
Definition at line 483 of file DistributionMoments.cpp.
References begin(), centroid_m, end(), geometricEps_m, halo_m, meanKineticEnergy_m, meanP_m, meanR_m, moments_m, ninetyFivePercentile_m, ninetyNine_NinetyNinePercentile_m, ninetyNinePercentile_m, normalizedEps68Percentile_m, normalizedEps95Percentile_m, normalizedEps99_99Percentile_m, normalizedEps99Percentile_m, normalizedEps_m, sixtyEightPercentile_m, stdKineticEnergy_m, stdP_m, stdR_m, stdRP_m, totalCharge_m, totalMass_m, and totalNumParticles_m.
Referenced by computeStatistics(), and DistributionMoments().
|
private |
Definition at line 514 of file DistributionMoments.cpp.
References debyeLength_m, plasmaParameter_m, and temperature_m.
Referenced by computeDebyeLength(), and DistributionMoments().
|
private |
Definition at line 126 of file DistributionMoments.h.
Referenced by computeMeans(), computeStatistics(), fillMembers(), and reset().
|
private |
Definition at line 122 of file DistributionMoments.h.
Referenced by computeDebyeLength(), computePlasmaParameter(), getDebyeLength(), and resetPlasmaParameters().
|
private |
Definition at line 105 of file DistributionMoments.h.
Referenced by fillMembers(), getGeometricEmittance(), and reset().
|
private |
Definition at line 106 of file DistributionMoments.h.
Referenced by fillMembers(), getHalo(), and reset().
|
private |
Definition at line 107 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), and getMaxR().
|
private |
Definition at line 125 of file DistributionMoments.h.
Referenced by computeMeans(), fillMembers(), and getMeanGamma().
|
private |
Definition at line 120 of file DistributionMoments.h.
Referenced by computeMeanKineticEnergy(), computeMeans(), computeStatistics(), getMeanKineticEnergy(), and reset().
|
private |
Definition at line 100 of file DistributionMoments.h.
Referenced by computeMeans(), fillMembers(), getMeanMomentum(), and reset().
|
private |
Definition at line 99 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), determinePercentilesDetail(), fillMembers(), getMeanPosition(), and reset().
|
private |
Definition at line 118 of file DistributionMoments.h.
Referenced by computeMeans(), computeStatistics(), and getMeanTime().
|
private |
Definition at line 108 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), and getMaxR().
|
private |
Definition at line 127 of file DistributionMoments.h.
Referenced by fillMembers(), getDDx(), getDDy(), getDx(), getDy(), getMoments6x6(), and reset().
|
private |
Definition at line 111 of file DistributionMoments.h.
Referenced by computePercentiles(), get95Percentile(), and reset().
|
private |
Definition at line 115 of file DistributionMoments.h.
Referenced by computePercentiles(), get99_99Percentile(), and reset().
|
private |
Definition at line 113 of file DistributionMoments.h.
Referenced by computePercentiles(), get99Percentile(), and reset().
|
private |
Definition at line 110 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance68Percentile(), and reset().
|
private |
Definition at line 112 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance95Percentile(), and reset().
|
private |
Definition at line 116 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance99_99Percentile(), and reset().
|
private |
Definition at line 114 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance99Percentile(), and reset().
|
private |
Definition at line 104 of file DistributionMoments.h.
Referenced by fillMembers(), getNormalizedEmittance(), and reset().
|
staticprivate |
Definition at line 136 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 133 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 135 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 134 of file DistributionMoments.h.
Referenced by computePercentiles().
|
private |
Definition at line 123 of file DistributionMoments.h.
Referenced by computePlasmaParameter(), getPlasmaParameter(), and resetPlasmaParameters().
|
private |
Definition at line 109 of file DistributionMoments.h.
Referenced by computePercentiles(), get68Percentile(), and reset().
|
private |
Definition at line 124 of file DistributionMoments.h.
Referenced by fillMembers(), getStdKineticEnergy(), and reset().
|
private |
Definition at line 102 of file DistributionMoments.h.
Referenced by fillMembers(), getStandardDeviationMomentum(), and reset().
|
private |
Definition at line 101 of file DistributionMoments.h.
Referenced by fillMembers(), getStandardDeviationPosition(), and reset().
|
private |
Definition at line 103 of file DistributionMoments.h.
Referenced by fillMembers(), getStandardDeviationRP(), and reset().
|
private |
Definition at line 119 of file DistributionMoments.h.
Referenced by fillMembers(), and getStdTime().
|
private |
Definition at line 121 of file DistributionMoments.h.
Referenced by computeDebyeLength(), getTemperature(), and resetPlasmaParameters().
|
private |
Definition at line 129 of file DistributionMoments.h.
Referenced by fillMembers(), getTotalCharge(), and reset().
|
private |
Definition at line 130 of file DistributionMoments.h.
Referenced by fillMembers(), getTotalMass(), and reset().
|
private |
Definition at line 131 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), computeStatistics(), fillMembers(), getTotalNumParticles(), and reset().