|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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 / std::sqrt(2)) |
| static const double | percentileTwoSigmasNormalDist_m = std::erf(2 / std::sqrt(2)) |
| static const double | percentileThreeSigmasNormalDist_m = std::erf(3 / std::sqrt(2)) |
| static const double | percentileFourSigmasNormalDist_m = std::erf(4 / std::sqrt(2)) |
Definition at line 35 of file DistributionMoments.h.
|
private |
Definition at line 90 of file DistributionMoments.h.
| DistributionMoments::DistributionMoments | ( | ) |
Definition at line 47 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 58 of file DistributionMoments.cpp.
References computeStatistics().
Referenced by LossDataSink::saveH5().

| void DistributionMoments::compute | ( | PartBunchBase< double, 3 > const & | bunch | ) |
Definition at line 53 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 442 of file DistributionMoments.cpp.
References allreduce(), Physics::c, computePlasmaParameter(), debyeLength_m, Physics::epsilon_0, Units::eV2kg, Util::getGamma(), PartBunchBase< T, Dim >::getM(), PartBunchBase< T, Dim >::getTotalNum(), Physics::q_e, resetPlasmaParameters(), and temperature_m.

| void DistributionMoments::computeMeanKineticEnergy | ( | PartBunchBase< double, 3 > const & | bunch | ) |
Definition at line 430 of file DistributionMoments.cpp.
References allreduce(), Util::getKineticEnergy(), PartBunchBase< T, Dim >::getLocalNum(), and meanKineticEnergy_m.

|
private |
Definition at line 65 of file DistributionMoments.cpp.
References allreduce(), centroid_m, Util::getGamma(), OpalParticle::getMass(), OpalParticle::getP(), OpalParticle::getTime(), isParticleExcluded(), maxR_m, meanGamma_m, meanKineticEnergy_m, meanP_m, meanR_m, meanTime_m, minR_m, and totalNumParticles_m.
Referenced by computeStatistics().

|
private |
Definition at line 349 of file DistributionMoments.cpp.
References allreduce(), begin(), and end().
Referenced by computePercentiles().

|
private |
Definition at line 176 of file DistributionMoments.cpp.
References allreduce(), computeNormalizedEmittance(), Options::computePercentiles, determinePercentilesDetail(), 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, sixtyEightPercentile_m, and totalNumParticles_m.
Referenced by computeStatistics().

| void DistributionMoments::computePlasmaParameter | ( | double | density | ) |
Definition at line 484 of file DistributionMoments.cpp.
References debyeLength_m, Physics::pi, and plasmaParameter_m.
Referenced by computeDebyeLength().
|
private |
Definition at line 131 of file DistributionMoments.cpp.
References allreduce(), centroid_m, computeMeans(), computePercentiles(), fillMembers(), OpalParticle::getCharge(), Util::getKineticEnergy(), OpalParticle::getMass(), OpalParticle::getP(), OpalParticle::getTime(), isParticleExcluded(), meanKineticEnergy_m, meanR_m, meanTime_m, reset(), and totalNumParticles_m.
Referenced by compute(), and 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 301 of file DistributionMoments.cpp.
References allreduce(), begin(), end(), IpplInfo::getNodes(), meanR_m, and IpplInfo::myNode().
Referenced by computePercentiles().

|
private |
Definition at line 385 of file DistributionMoments.cpp.
References geometricEps_m, halo_m, Options::haloShift, meanGamma_m, meanP_m, meanR_m, moments_m, normalizedEps_m, stdKineticEnergy_m, stdP_m, stdR_m, stdRP_m, stdTime_m, totalCharge_m, totalMass_m, and totalNumParticles_m.
Referenced by computeStatistics().
|
inline |
Definition at line 287 of file DistributionMoments.h.
References sixtyEightPercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 299 of file DistributionMoments.h.
References ninetyFivePercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 323 of file DistributionMoments.h.
References ninetyNine_NinetyNinePercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 311 of file DistributionMoments.h.
References ninetyNinePercentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 245 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 257 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 222 of file DistributionMoments.h.
References debyeLength_m.
|
inline |
Definition at line 239 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 251 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 172 of file DistributionMoments.h.
References geometricEps_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 184 of file DistributionMoments.h.
References halo_m.
|
inline |
Definition at line 335 of file DistributionMoments.h.
References maxR_m, and minR_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 202 of file DistributionMoments.h.
References meanGamma_m.
|
inline |
Definition at line 208 of file DistributionMoments.h.
References meanKineticEnergy_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 154 of file DistributionMoments.h.
References meanP_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 142 of file DistributionMoments.h.
References meanR_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 190 of file DistributionMoments.h.
References meanTime_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 263 of file DistributionMoments.h.
References moments_m.
|
inline |
Definition at line 166 of file DistributionMoments.h.
References normalizedEps_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 293 of file DistributionMoments.h.
References normalizedEps68Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 305 of file DistributionMoments.h.
References normalizedEps95Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 329 of file DistributionMoments.h.
References normalizedEps99_99Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 317 of file DistributionMoments.h.
References normalizedEps99Percentile_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 227 of file DistributionMoments.h.
References plasmaParameter_m.
|
inline |
Definition at line 160 of file DistributionMoments.h.
References stdP_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 148 of file DistributionMoments.h.
References stdR_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 178 of file DistributionMoments.h.
References stdRP_m.
|
inline |
Definition at line 233 of file DistributionMoments.h.
References stdKineticEnergy_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 196 of file DistributionMoments.h.
References stdTime_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 215 of file DistributionMoments.h.
References Physics::c, Units::eV2kg, Physics::kB, and temperature_m.
|
inline |
Definition at line 269 of file DistributionMoments.h.
References totalCharge_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 275 of file DistributionMoments.h.
References totalMass_m.
Referenced by LossDataSink::saveH5().
|
inline |
Definition at line 281 of file DistributionMoments.h.
References totalNumParticles_m.
|
private |
Definition at line 529 of file DistributionMoments.cpp.
References Options::amr, OpalParticle::getId(), OpalData::getInstance(), and OpalData::isInOPALCyclMode().
Referenced by computeMeans(), and computeStatistics().

|
private |
Definition at line 491 of file DistributionMoments.cpp.
References centroid_m, 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 522 of file DistributionMoments.cpp.
References debyeLength_m, plasmaParameter_m, and temperature_m.
Referenced by computeDebyeLength(), and DistributionMoments().
|
private |
Definition at line 128 of file DistributionMoments.h.
Referenced by computeMeans(), computeStatistics(), and reset().
|
private |
Definition at line 124 of file DistributionMoments.h.
Referenced by computeDebyeLength(), computePlasmaParameter(), getDebyeLength(), and resetPlasmaParameters().
|
private |
Definition at line 107 of file DistributionMoments.h.
Referenced by fillMembers(), getGeometricEmittance(), and reset().
|
private |
Definition at line 108 of file DistributionMoments.h.
Referenced by fillMembers(), getHalo(), and reset().
|
private |
Definition at line 109 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), and getMaxR().
|
private |
Definition at line 127 of file DistributionMoments.h.
Referenced by computeMeans(), fillMembers(), and getMeanGamma().
|
private |
Definition at line 122 of file DistributionMoments.h.
Referenced by computeMeanKineticEnergy(), computeMeans(), computeStatistics(), getMeanKineticEnergy(), and reset().
|
private |
Definition at line 102 of file DistributionMoments.h.
Referenced by computeMeans(), fillMembers(), getMeanMomentum(), and reset().
|
private |
Definition at line 101 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), computeStatistics(), determinePercentilesDetail(), fillMembers(), getMeanPosition(), and reset().
|
private |
Definition at line 120 of file DistributionMoments.h.
Referenced by computeMeans(), computeStatistics(), and getMeanTime().
|
private |
Definition at line 110 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), and getMaxR().
|
private |
Definition at line 129 of file DistributionMoments.h.
Referenced by fillMembers(), getDDx(), getDDy(), getDx(), getDy(), getMoments6x6(), and reset().
|
private |
Definition at line 113 of file DistributionMoments.h.
Referenced by computePercentiles(), get95Percentile(), and reset().
|
private |
Definition at line 117 of file DistributionMoments.h.
Referenced by computePercentiles(), get99_99Percentile(), and reset().
|
private |
Definition at line 115 of file DistributionMoments.h.
Referenced by computePercentiles(), get99Percentile(), and reset().
|
private |
Definition at line 112 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance68Percentile(), and reset().
|
private |
Definition at line 114 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance95Percentile(), and reset().
|
private |
Definition at line 118 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance99_99Percentile(), and reset().
|
private |
Definition at line 116 of file DistributionMoments.h.
Referenced by computePercentiles(), getNormalizedEmittance99Percentile(), and reset().
|
private |
Definition at line 106 of file DistributionMoments.h.
Referenced by fillMembers(), getNormalizedEmittance(), and reset().
|
staticprivate |
Definition at line 138 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 135 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 137 of file DistributionMoments.h.
Referenced by computePercentiles().
|
staticprivate |
Definition at line 136 of file DistributionMoments.h.
Referenced by computePercentiles().
|
private |
Definition at line 125 of file DistributionMoments.h.
Referenced by computePlasmaParameter(), getPlasmaParameter(), and resetPlasmaParameters().
|
private |
Definition at line 111 of file DistributionMoments.h.
Referenced by computePercentiles(), get68Percentile(), and reset().
|
private |
Definition at line 126 of file DistributionMoments.h.
Referenced by fillMembers(), getStdKineticEnergy(), and reset().
|
private |
Definition at line 104 of file DistributionMoments.h.
Referenced by fillMembers(), getStandardDeviationMomentum(), and reset().
|
private |
Definition at line 103 of file DistributionMoments.h.
Referenced by fillMembers(), getStandardDeviationPosition(), and reset().
|
private |
Definition at line 105 of file DistributionMoments.h.
Referenced by fillMembers(), getStandardDeviationRP(), and reset().
|
private |
Definition at line 121 of file DistributionMoments.h.
Referenced by fillMembers(), and getStdTime().
|
private |
Definition at line 123 of file DistributionMoments.h.
Referenced by computeDebyeLength(), getTemperature(), and resetPlasmaParameters().
|
private |
Definition at line 131 of file DistributionMoments.h.
Referenced by fillMembers(), getTotalCharge(), and reset().
|
private |
Definition at line 132 of file DistributionMoments.h.
Referenced by fillMembers(), getTotalMass(), and reset().
|
private |
Definition at line 133 of file DistributionMoments.h.
Referenced by computeMeans(), computePercentiles(), computeStatistics(), fillMembers(), getTotalNumParticles(), and reset().