DFNgen  2.0
DFN Model Generator
Distributions Class Reference

#include <distributions.h>

Collaboration diagram for Distributions:

Public Member Functions

 Distributions (std::mt19937_64 &_generator, std::vector< Shape > &shapeFamilies)
 
 ~Distributions ()
 

Public Attributes

ExpDistexpDist
 
double maxInput
 

Private Member Functions

int getMaxDigits ()
 
double getMaxDecimalForDouble ()
 
void checkDistributionUserInput (std::vector< Shape > &shapeFamilies)
 
void quitOrContinue ()
 

Detailed Description

The Distributions class is used to hold all the custom distribution classes that are used by DFNgen. As of now, the only distribution we have completely customized is the exponential distribution class ExpDist. The customizations allow us to limit the range of numbers the distribution is able to produce. This allows the user to define the minimum and maximum size fractures they want from the distribution.

Definition at line 15 of file distributions.h.

Constructor & Destructor Documentation

§ Distributions()

Distributions::Distributions ( std::mt19937_64 &  _generator,
std::vector< Shape > &  shapeFamilies 
)

Initialize maxInput. maxInput is the maximum double less than 1. (0.9999... before being recognized as 1)

Initialize exponential distribution class.

Arg 1: Random number generator

Definition at line 30 of file distributions.cpp.

Here is the call graph for this function:

§ ~Distributions()

Distributions::~Distributions ( )

Destructor

Definition at line 194 of file distributions.cpp.

Member Function Documentation

§ checkDistributionUserInput()

void Distributions::checkDistributionUserInput ( std::vector< Shape > &  shapeFamilies)
private

MANDATORY FUNCTION FOR USING EXPONENTIAL DISTRIBUTION This function currently only error checks the exponential distribution option. The code has been outlined to add other distributions easily in the future. A custom exponential distribution function was needed to allow the user to define the minimum and maximum value the distribution would return, without sampling randomly and throwing away numbers larger than the maximum or less than the minimum user defined limit.

This function checks that the user's min and max limit for exponential distribution is acceptible. That is, that the machine is able to produce the min and maximum given. For example, if the mean is set very small, and the user defined maximim is set very large, it may be the case that the largest number able to be produced from the distribution will be less than the user defined maximum. This check will warn the user if this is the case.

This function is MANDATORY for the min and max input options to work. The function initializes the minimum and maximum input to the distrubution function in order to return a value which is between the user's min and max distribution limit from the input file.

Arg 1: Array of all stochastic fracture families

Definition at line 95 of file distributions.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ getMaxDecimalForDouble()

double Distributions::getMaxDecimalForDouble ( )
private

Returns the largest number less than 1.0 before being considered 1.0 by the computer (0.99999...).

Definition at line 56 of file distributions.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ getMaxDigits()

int Distributions::getMaxDigits ( )
private

Calculates and returns the maximum precision, in number of digits, after the decimal place for a number between 0 and 1.

Definition at line 46 of file distributions.cpp.

Here is the caller graph for this function:

§ quitOrContinue()

void Distributions::quitOrContinue ( )
private

Stops program execution and waits for input from user to continue. 'q' or 'Q' to quit program and exit enter/return key to continue with program execution.

Definition at line 172 of file distributions.cpp.

Here is the caller graph for this function:

Member Data Documentation

§ expDist

ExpDist* Distributions::expDist

Definition at line 20 of file distributions.h.

§ maxInput

double Distributions::maxInput

Maximum input to distributions. 0.999999... before being recognized as 1 by the computer (1 returns inf for some distributions).

Set in the Distributions constructor.

Definition at line 26 of file distributions.h.


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