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

A class used to generate a lognormal distribution. More...

#include <Lognormal.h>

Inheritance diagram for Lognormal:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 Lognormal (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
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () 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 &nm) 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
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) 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)
 
static Real cdf (const Real &x, const Real &location, const Real &scale)
 
static Real quantile (const Real &p, const Real &location, const Real &scale)
 

Public Attributes

const ConsoleStream _console
 

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_location
 The lognormal location parameter (m or mu) More...
 
const Real_scale
 The lognormal scale parameter (s or sigma) More...
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Detailed Description

A class used to generate a lognormal distribution.

Definition at line 17 of file Lognormal.h.

Constructor & Destructor Documentation

◆ Lognormal()

Lognormal::Lognormal ( const InputParameters parameters)

Definition at line 27 of file Lognormal.C.

28  : Distribution(parameters), _location(getParam<Real>("location")), _scale(getParam<Real>("scale"))
29 {
30 }
Distribution(const InputParameters &parameters)
const Real & _location
The lognormal location parameter (m or mu)
Definition: Lognormal.h:34
const Real & _scale
The lognormal scale parameter (s or sigma)
Definition: Lognormal.h:37
const InputParameters & parameters() const

Member Function Documentation

◆ cdf() [1/2]

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

Implements Distribution.

Definition at line 58 of file Lognormal.C.

59 {
60  return cdf(x, _location, _scale);
61 }
const Real & _location
The lognormal location parameter (m or mu)
Definition: Lognormal.h:34
virtual Real cdf(const Real &x) const override
Definition: Lognormal.C:58
const std::vector< double > x
const Real & _scale
The lognormal scale parameter (s or sigma)
Definition: Lognormal.h:37

◆ cdf() [2/2]

Real Lognormal::cdf ( const Real x,
const Real location,
const Real scale 
)
static

Definition at line 40 of file Lognormal.C.

41 {
42  return 0.5 * (1.0 + std::erf((std::log(x) - location) / (scale * std::sqrt(2.0))));
43 }
const std::vector< double > x

◆ pdf() [1/2]

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

Implements Distribution.

Definition at line 52 of file Lognormal.C.

53 {
54  return pdf(x, _location, _scale);
55 }
virtual Real pdf(const Real &x) const override
Definition: Lognormal.C:52
const Real & _location
The lognormal location parameter (m or mu)
Definition: Lognormal.h:34
const std::vector< double > x
const Real & _scale
The lognormal scale parameter (s or sigma)
Definition: Lognormal.h:37

◆ pdf() [2/2]

Real Lognormal::pdf ( const Real x,
const Real location,
const Real scale 
)
static

Definition at line 33 of file Lognormal.C.

34 {
35  return 1.0 / (x * scale * std::sqrt(2.0 * M_PI)) *
36  std::exp(-0.5 * Utility::pow<2>((std::log(x) - location) / scale));
37 }
void scale(MeshBase &mesh, const Real xs, const Real ys=0., const Real zs=0.)
const std::vector< double > x

◆ quantile() [1/2]

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

Implements Distribution.

Definition at line 64 of file Lognormal.C.

65 {
66  return quantile(p, _location, _scale);
67 }
const Real & _location
The lognormal location parameter (m or mu)
Definition: Lognormal.h:34
const Real & _scale
The lognormal scale parameter (s or sigma)
Definition: Lognormal.h:37
virtual Real quantile(const Real &p) const override
Definition: Lognormal.C:64

◆ quantile() [2/2]

Real Lognormal::quantile ( const Real p,
const Real location,
const Real scale 
)
static

Definition at line 46 of file Lognormal.C.

47 {
48  return std::exp(Normal::quantile(p, location, scale));
49 }
virtual Real quantile(const Real &p) const override
Definition: Normal.C:80

◆ validParams()

InputParameters Lognormal::validParams ( )
static

Definition at line 18 of file Lognormal.C.

19 {
21  params.addClassDescription("Lognormal distribution");
22  params.addRequiredParam<Real>("location", "The Lognormal location parameter (m or mu).");
23  params.addRequiredParam<Real>("scale", "The Lognormal scale parameter (s or sigma).");
24  return params;
25 }
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

◆ _location

const Real& Lognormal::_location
protected

The lognormal location parameter (m or mu)

Definition at line 34 of file Lognormal.h.

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

◆ _scale

const Real& Lognormal::_scale
protected

The lognormal scale parameter (s or sigma)

Definition at line 37 of file Lognormal.h.

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


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