https://mooseframework.inl.gov
VolumeWeightedWeibull.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "VolumeWeightedWeibull.h"
11 
12 registerMooseObject("SolidMechanicsApp", VolumeWeightedWeibull);
13 
16 {
18  params.addRequiredParam<Real>("reference_volume", "Reference volume (of a test specimen)");
19  params.addRequiredParam<Real>("weibull_modulus", "Weibull modulus");
20  params.addParam<Real>(
21  "median",
22  "Median value of property measured in a specimen of volume equal to reference_volume");
23  params.addClassDescription("Initialize a variable with randomly generated numbers following "
24  "a volume-weighted Weibull distribution");
25  return params;
26 }
27 
29  : RandomICBase(parameters),
30  _reference_volume(getParam<Real>("reference_volume")),
31  _weibull_modulus(getParam<Real>("weibull_modulus")),
32  _median(getParam<Real>("median"))
33 {
34 }
35 
36 Real
37 VolumeWeightedWeibull::value(const Point & /*p*/)
38 {
39  return _median * std::pow(_reference_volume * std::log(generateRandom()) /
40  (_current_elem_volume * std::log(0.5)),
41  1.0 / _weibull_modulus);
42 }
virtual Real value(const Point &p) override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Real generateRandom()
const Real & _current_elem_volume
VolumeWeightedWeibull(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
const Real _weibull_modulus
The Weibull modulus.
VolumeWeightedWeibull generates a spatially randomized field that follows a Weibull distribution weig...
registerMooseObject("SolidMechanicsApp", VolumeWeightedWeibull)
const Real _median
The median value of the strength for specimens having volume equal to the reference volume...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const Real _reference_volume
The reference volume of the test specimen from which a median strength is obtained.
static InputParameters validParams()
static InputParameters validParams()
MooseUnits pow(const MooseUnits &, int)