Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
CustomDistribution Class Reference

#include <distributions.h>

Inheritance diagram for CustomDistribution:
[legend]

Public Member Functions

 CustomDistribution (const std::vector< double > &d_list, const std::vector< double > &d_probabilities, const unsigned int &prn_seed, const double min_cutoff, const double max_cutoff, const Parameters::Lagrangian::DistributionWeightingType &distribution_weighting_type, const Parameters::Lagrangian::ProbabilityFunctionType &function_type_in, const bool interpolate)
virtual std::vector< double > particle_size_sampling (const unsigned int &number_of_particles) override
double find_min_diameter () override
double find_max_diameter () override
void print_psd_declaration_string (const unsigned int particle_type, const ConditionalOStream &pcout) override
Public Member Functions inherited from Distribution
virtual ~Distribution ()=default

Private Attributes

const std::vector< double > diameter_values
std::vector< double > number_based_cdf
const bool interpolate_diameter_values
std::mt19937 gen
const Parameters::Lagrangian::ProbabilityFunctionType function_type
std::vector< double > fv
double total_integral

Additional Inherited Members

Protected Member Functions inherited from Distribution
 Distribution (const Parameters::Lagrangian::DistributionWeightingType &distribution_weighting_type)
Protected Attributes inherited from Distribution
const Parameters::Lagrangian::DistributionWeightingType weighting_type
double dia_min_cutoff
double dia_max_cutoff

Detailed Description

Definition at line 288 of file distributions.h.

Constructor & Destructor Documentation

◆ CustomDistribution()

CustomDistribution::CustomDistribution ( const std::vector< double > & d_list,
const std::vector< double > & d_probabilities,
const unsigned int & prn_seed,
const double min_cutoff,
const double max_cutoff,
const Parameters::Lagrangian::DistributionWeightingType & distribution_weighting_type,
const Parameters::Lagrangian::ProbabilityFunctionType & function_type_in,
const bool interpolate )

The constructor stores the parameters necessary to define the histogram distribution.

Parameters
[in]d_listVector of diameter values.
[in]d_probabilitiesVector of probability values based on the volume fraction with respect to each diameter value.
[in]prn_seedPseudo-random number seed for the diameter generation.
[in]min_cutoffMinimum cutoff diameter.
[in]max_cutoffMaximum cutoff diameter.
[in]distribution_weighting_typeWeighting type of the distribution.
[in]function_type_inDefines whether the input probability values correspond to the PDF or the CDF.
[in]interpolateIndicates whether the diameter sampled values are linearly interpolated between input diameter and probability values.

Definition at line 388 of file distributions.cc.

References Parameters::Lagrangian::CDF, Distribution::dia_max_cutoff, Distribution::dia_min_cutoff, diameter_values, Distribution::Distribution(), function_type, fv, gen, interpolate_diameter_values, Parameters::Lagrangian::number_based, number_based_cdf, Parameters::Lagrangian::PDF, total_integral, Parameters::Lagrangian::volume_based, and Distribution::weighting_type.

Member Function Documentation

◆ find_max_diameter()

double CustomDistribution::find_max_diameter ( )
overridevirtual

Find the maximum diameter of the custom distribution.

Returns
The minimum diameter of the distribution.

Implements Distribution.

Definition at line 870 of file distributions.cc.

References Distribution::dia_max_cutoff.

◆ find_min_diameter()

double CustomDistribution::find_min_diameter ( )
overridevirtual

Find the minimum diameter of the custom distribution.

Returns
The minimum diameter of the distribution.

Implements Distribution.

Definition at line 864 of file distributions.cc.

References Distribution::dia_min_cutoff.

◆ particle_size_sampling()

std::vector< double > CustomDistribution::particle_size_sampling ( const unsigned int & number_of_particles)
overridevirtual

Carries out the size sampling of each particle inserted at an insertion time step for the histogram distribution.

Parameters
[in]number_of_particlesNumber of particles inserted at a given insertion time step.

Implements Distribution.

Definition at line 702 of file distributions.cc.

References Distribution::dia_max_cutoff, Distribution::dia_min_cutoff, diameter_values, function_type, fv, gen, interpolate_diameter_values, number_based_cdf, Parameters::Lagrangian::PDF, total_integral, Parameters::Lagrangian::volume_based, and Distribution::weighting_type.

◆ print_psd_declaration_string()

void CustomDistribution::print_psd_declaration_string ( const unsigned int particle_type,
const ConditionalOStream & pcout )
overridevirtual

Print the declaration string relative to the particle size distribution used.

Parameters
particle_typeParticle type of the distribution
pcoutParallel conditional output stream used to print the information

Implements Distribution.

Definition at line 876 of file distributions.cc.

Member Data Documentation

◆ diameter_values

const std::vector<double> CustomDistribution::diameter_values
private

Vector containing all the diameter values.

Definition at line 360 of file distributions.h.

◆ function_type

const Parameters::Lagrangian::ProbabilityFunctionType CustomDistribution::function_type
private

Defines if the custom distribution is a probability density function (PDF) or a cumulative density function (CDF).

Definition at line 384 of file distributions.h.

◆ fv

std::vector<double> CustomDistribution::fv
private

Definition at line 389 of file distributions.h.

◆ gen

std::mt19937 CustomDistribution::gen
private

Random number generator for the diameter selection.

Definition at line 378 of file distributions.h.

◆ interpolate_diameter_values

const bool CustomDistribution::interpolate_diameter_values
private

Indicates whether the diameter values are interpolated between the input values during sampling.

Definition at line 373 of file distributions.h.

◆ number_based_cdf

std::vector<double> CustomDistribution::number_based_cdf
private

Vector containing cumulative probabilities associated with the diameter_values vector. The stored values are based on the number-based CDF.

Definition at line 367 of file distributions.h.

◆ total_integral

double CustomDistribution::total_integral
private

Definition at line 395 of file distributions.h.


The documentation for this class was generated from the following files: