https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Weibull Class Reference

A class used to generate a three-parameter Weibull distribution. More...

#include <Weibull.h>

Inheritance diagram for Weibull:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 Weibull (const InputParameters &parameters)
 
virtual Real pdf (const Real &x) const override
 
virtual Real cdf (const Real &x) const override
 
virtual Real quantile (const Real &p) const override
 
virtual Real median () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static Real pdf (const Real &x, const Real &location, const Real &scale, const Real &shape)
 
static Real cdf (const Real &x, const Real &location, const Real &scale, const Real &shape)
 
static Real quantile (const Real &p, const Real &location, const Real &scale, const Real &shape)
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node)
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

const Real_a
 The location parameter (a or low) More...
 
const Real_b
 The scale parameter (b or lambda) More...
 
const Real_c
 The shape parameter (c or k) More...
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Detailed Description

A class used to generate a three-parameter Weibull distribution.

Definition at line 17 of file Weibull.h.

Constructor & Destructor Documentation

◆ Weibull()

Weibull::Weibull ( const InputParameters parameters)

Definition at line 27 of file Weibull.C.

29  _a(getParam<Real>("location")),
30  _b(getParam<Real>("scale")),
31  _c(getParam<Real>("shape"))
32 {
33 }
const InputParameters & parameters() const
Distribution(const InputParameters &parameters)
const Real & _c
The shape parameter (c or k)
Definition: Weibull.h:41
const Real & _a
The location parameter (a or low)
Definition: Weibull.h:35
const Real & _b
The scale parameter (b or lambda)
Definition: Weibull.h:38

Member Function Documentation

◆ cdf() [1/2]

Real Weibull::cdf ( const Real x) const
overridevirtual

Implements Distribution.

Definition at line 72 of file Weibull.C.

73 {
74  return cdf(x, _a, _b, _c);
75 }
virtual Real cdf(const Real &x) const override
Definition: Weibull.C:72
const Real & _c
The shape parameter (c or k)
Definition: Weibull.h:41
const Real & _a
The location parameter (a or low)
Definition: Weibull.h:35
const std::vector< double > x
const Real & _b
The scale parameter (b or lambda)
Definition: Weibull.h:38

◆ cdf() [2/2]

Real Weibull::cdf ( const Real x,
const Real location,
const Real scale,
const Real shape 
)
static

Definition at line 48 of file Weibull.C.

49 {
50  if (x <= location)
51  return 0.0;
52  else
53  {
54  const Real y = (x - location) / scale;
55  return 1.0 - std::exp(-std::pow(y, shape));
56  }
57 }
const std::vector< double > y
const std::vector< double > x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseUnits pow(const MooseUnits &, int)

◆ pdf() [1/2]

Real Weibull::pdf ( const Real x) const
overridevirtual

Implements Distribution.

Definition at line 66 of file Weibull.C.

67 {
68  return pdf(x, _a, _b, _c);
69 }
virtual Real pdf(const Real &x) const override
Definition: Weibull.C:66
const Real & _c
The shape parameter (c or k)
Definition: Weibull.h:41
const Real & _a
The location parameter (a or low)
Definition: Weibull.h:35
const std::vector< double > x
const Real & _b
The scale parameter (b or lambda)
Definition: Weibull.h:38

◆ pdf() [2/2]

Real Weibull::pdf ( const Real x,
const Real location,
const Real scale,
const Real shape 
)
static

Definition at line 36 of file Weibull.C.

37 {
38  if (x <= location)
39  return 0.0;
40  else
41  {
42  const Real y = (x - location) / scale;
43  return shape / scale * std::pow(y, shape - 1.0) * std::exp(-std::pow(y, shape));
44  }
45 }
void scale(MeshBase &mesh, const Real xs, const Real ys=0., const Real zs=0.)
const std::vector< double > y
const std::vector< double > x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseUnits pow(const MooseUnits &, int)

◆ quantile() [1/2]

Real Weibull::quantile ( const Real p) const
overridevirtual

Implements Distribution.

Definition at line 78 of file Weibull.C.

79 {
80  return quantile(p, _a, _b, _c);
81 }
const Real & _c
The shape parameter (c or k)
Definition: Weibull.h:41
const Real & _a
The location parameter (a or low)
Definition: Weibull.h:35
const Real & _b
The scale parameter (b or lambda)
Definition: Weibull.h:38
virtual Real quantile(const Real &p) const override
Definition: Weibull.C:78

◆ quantile() [2/2]

Real Weibull::quantile ( const Real p,
const Real location,
const Real scale,
const Real shape 
)
static

Definition at line 60 of file Weibull.C.

61 {
62  return location + scale * std::pow(-std::log(1 - p), 1.0 / shape);
63 }
void scale(MeshBase &mesh, const Real xs, const Real ys=0., const Real zs=0.)
MooseUnits pow(const MooseUnits &, int)

◆ validParams()

InputParameters Weibull::validParams ( )
static

Definition at line 17 of file Weibull.C.

Referenced by WeibullDistribution::validParams().

18 {
20  params.addClassDescription("Three-parameter Weibull distribution.");
21  params.addRequiredParam<Real>("location", "Location parameter (a or low)");
22  params.addRequiredRangeCheckedParam<Real>("scale", "scale > 0", "Scale parameter (b or lambda)");
23  params.addRequiredRangeCheckedParam<Real>("shape", "shape > 0", "Shape parameter (c or k)");
24  return params;
25 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _a

const Real& Weibull::_a
protected

The location parameter (a or low)

Definition at line 35 of file Weibull.h.

Referenced by cdf(), pdf(), and quantile().

◆ _b

const Real& Weibull::_b
protected

The scale parameter (b or lambda)

Definition at line 38 of file Weibull.h.

Referenced by cdf(), pdf(), and quantile().

◆ _c

const Real& Weibull::_c
protected

The shape parameter (c or k)

Definition at line 41 of file Weibull.h.

Referenced by cdf(), pdf(), and quantile().


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