26 #ifndef MERCURYDPM_PSDCONTINUOUS_H
27 #define MERCURYDPM_PSDCONTINUOUS_H
67 static void print (std::vector<PSDContinuous>& psd);
89 static void interpolateCSD (std::vector<PSDContinuous>& psd,
unsigned n);
98 static std::vector<PSDContinuous>
cutoffCumulativeNumber (std::vector<PSDContinuous> psd,
double quantileMin,
double quantileMax,
double minPolydispersity = 0.1) {
102 double radiusMinCut = std::min(radiusMin*(1+minPolydispersity),radiusMax);
106 while (psd.front().radius<=radiusMinCut) psd.erase(psd.begin());
107 psd.insert(psd.begin(),
PSDContinuous{radiusMinCut,quantileMin});
110 while (psd.back().radius>=radiusMax) psd.pop_back();
119 static std::vector<PSDContinuous>
cutoffAndSqueezeCumulativeNumber (std::vector<PSDContinuous> psd,
double quantileMin,
double quantileMax,
double squeeze,
double minPolydispersity = 0.1) {
126 for (
auto& p : psd) {
127 p.radius = r50+(p.radius-r50)*squeeze;
146 static double getD0 (
const std::vector<PSDContinuous>& psd){
150 static double getD10 (
const std::vector<PSDContinuous>& psd){
154 static double getD50 (
const std::vector<PSDContinuous>& psd){
158 static double getD90 (
const std::vector<PSDContinuous>& psd){
162 static double getD100 (
const std::vector<PSDContinuous>& psd){
168 static double getQuantile(std::vector<PSDContinuous> psd,
double quantile);
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
const PSD convertPSD2ToPSD(const std::vector< PSDContinuous > &psd2)
Definition: PSDContinuous.cc:209
Contains a vector with radii and probabilities of a user defined particle size distribution (PSD)
Definition: PSD.h:65
Definition: PSDContinuous.h:51
static void convertSubtractiveToCumulative(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:86
friend std::ostream & operator<<(std::ostream &os, const PSDContinuous &psd)
Writes to output stream.
Definition: PSDContinuous.h:189
bool operator<(const double probability) const
Definition: PSDContinuous.h:181
static double getD0(const std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.h:146
static void convertSubtractiveVolumeToNumber(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:110
static std::vector< PSDContinuous > getCumulativeNumberFromVolume(std::vector< PSDContinuous > psd)
Definition: PSDContinuous.h:92
static double getD90(const std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.h:158
static void convertCumulativeVolumeToNumber(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:128
static void convertSubtractiveNumberToVolume(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:151
static void validateCumulativeDistribution(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:49
static void convertCumulativeNumberToVolume(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:169
static std::vector< PSDContinuous > cutoffCumulativeNumber(std::vector< PSDContinuous > psd, double quantileMin, double quantileMax, double minPolydispersity=0.1)
Definition: PSDContinuous.h:98
static double getVolumetricMean(std::vector< PSDContinuous > psd)
Definition: PSDContinuous.cc:200
static std::vector< PSDContinuous > cutoffAndSqueezeCumulativeNumber(std::vector< PSDContinuous > psd, double quantileMin, double quantileMax, double squeeze, double minPolydispersity=0.1)
Definition: PSDContinuous.h:119
static double getD10(const std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.h:150
static void convertCumulativeToSubtractive(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:98
static double getQuantile(std::vector< PSDContinuous > psd, double quantile)
Definition: PSDContinuous.cc:188
double probability
Definition: PSDContinuous.h:203
static void interpolateCSD(std::vector< PSDContinuous > &psd, unsigned n)
Definition: PSDContinuous.cc:134
double radius
Definition: PSDContinuous.h:202
static double getD100(const std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.h:162
static double getD50(const std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.h:154
static void print(std::vector< PSDContinuous > &psd)
Definition: PSDContinuous.cc:32
friend std::istream & operator>>(std::istream &is, PSDContinuous &psd)
Reads from input stream.
Definition: PSDContinuous.h:197
static std::vector< PSDContinuous > createPSDFromRadiiAndProbabilities(const std::vector< double > &radius, const std::vector< double > &probability)
Definition: PSDContinuous.cc:68