6 #ifndef PIECEWISE_LINEAR_RANDOM_VARIABLE_H
7 #define PIECEWISE_LINEAR_RANDOM_VARIABLE_H
31 double Sample()
override;
32 double ProbabilityDensity(
const double x);
33 double GetMean()
override;
36 std::string
Info()
const override
38 std::stringstream buffer;
39 buffer <<
"PiecewiseLinearRandomVariable" ;
45 void PrintInfo(std::ostream& rOStream)
const override
47 rOStream <<
"PiecewiseLinearRandomVariable";
52 void PrintData(std::ostream& rOStream)
const override
58 void Check()
override;
63 void CalculateTrapezoidProbabilitiesAndNormalize();
64 std::size_t SampleTrapezoidChoice();
65 double SampleWithinTrapezoid(
const double H,
const double B1,
const double B2);
66 double SampleWithinStandardTrapezoid(
const double b);
67 double SamplePositiveSlopingStandardTriangle();
68 double SampleNegativeSlopingStandardTriangle();
73 double mRelativeClosenessTolerance = 0.0;
74 std::vector<double> mPDFValues;
75 std::vector<double> mPDFBreakpoints;
76 std::mt19937 mRandomNumberGenerator;
77 std::discrete_distribution<int> mTrapezoidsDiscreteDistribution;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Definition: piecewise_linear_random_variable.h:20
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: piecewise_linear_random_variable.h:52
KRATOS_CLASS_POINTER_DEFINITION(PiecewiseLinearRandomVariable)
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: piecewise_linear_random_variable.h:45
std::string Info() const override
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: piecewise_linear_random_variable.h:36
Definition: random_variable.h:19
int seed
Definition: GenerateWind.py:138
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
H
Definition: generate_droplet_dynamics.py:257
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
x
Definition: sensitivityMatrix.py:49