www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
PolycrystalRandomIC Class Reference

Random initial condition for a polycrystalline material. More...

#include <PolycrystalRandomIC.h>

Inheritance diagram for PolycrystalRandomIC:
[legend]

Public Member Functions

 PolycrystalRandomIC (const InputParameters &parameters)
 
virtual Real value (const Point &p)
 

Private Attributes

const unsigned int _op_num
 
const unsigned int _op_index
 
const unsigned int _random_type
 

Detailed Description

Random initial condition for a polycrystalline material.

Definition at line 23 of file PolycrystalRandomIC.h.

Constructor & Destructor Documentation

◆ PolycrystalRandomIC()

PolycrystalRandomIC::PolycrystalRandomIC ( const InputParameters &  parameters)

Definition at line 27 of file PolycrystalRandomIC.C.

28  : RandomICBase(parameters),
29  _op_num(getParam<unsigned int>("op_num")),
30  _op_index(getParam<unsigned int>("op_index")),
31  _random_type(getParam<unsigned int>("random_type"))
32 {
33 }

Member Function Documentation

◆ value()

Real PolycrystalRandomIC::value ( const Point &  p)
virtual

Definition at line 36 of file PolycrystalRandomIC.C.

37 {
38  Point cur_pos = p;
39  Real val = generateRandom();
40 
41  switch (_random_type)
42  {
43  case 0: // Continuously random
44  return val;
45 
46  case 1: // Discretely random
47  {
48  unsigned int rndind = _op_num * val;
49 
50  if (rndind == _op_index)
51  return 1.0;
52  else
53  return 0.0;
54  }
55  }
56 
57  paramError("random_type", "Bad type passed in PolycrystalRandomIC");
58 }

Member Data Documentation

◆ _op_index

const unsigned int PolycrystalRandomIC::_op_index
private

Definition at line 32 of file PolycrystalRandomIC.h.

Referenced by value().

◆ _op_num

const unsigned int PolycrystalRandomIC::_op_num
private

Definition at line 31 of file PolycrystalRandomIC.h.

Referenced by value().

◆ _random_type

const unsigned int PolycrystalRandomIC::_random_type
private

Definition at line 33 of file PolycrystalRandomIC.h.

Referenced by value().


The documentation for this class was generated from the following files:
PolycrystalRandomIC::_op_num
const unsigned int _op_num
Definition: PolycrystalRandomIC.h:31
PolycrystalRandomIC::_random_type
const unsigned int _random_type
Definition: PolycrystalRandomIC.h:33
PolycrystalRandomIC::_op_index
const unsigned int _op_index
Definition: PolycrystalRandomIC.h:32