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 _typ
 

Detailed Description

Random initial condition for a polycrystalline material.

Definition at line 21 of file PolycrystalRandomIC.h.

Constructor & Destructor Documentation

PolycrystalRandomIC::PolycrystalRandomIC ( const InputParameters &  parameters)

Definition at line 24 of file PolycrystalRandomIC.C.

25  : InitialCondition(parameters),
26  _op_num(getParam<unsigned int>("op_num")),
27  _op_index(getParam<unsigned int>("op_index")),
28  _typ(getParam<unsigned int>("typ"))
29 {
30 }
const unsigned int _op_num
const unsigned int _op_index
const unsigned int _typ

Member Function Documentation

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

Definition at line 33 of file PolycrystalRandomIC.C.

34 {
35  Point cur_pos = p;
36  Real val = MooseRandom::rand();
37 
38  switch (_typ)
39  {
40  case 0: // Continuously random
41  return val;
42 
43  case 1: // Discretely random
44  {
45  unsigned int rndind = _op_num * val;
46 
47  if (rndind == _op_index)
48  return 1.0;
49  else
50  return 0.0;
51  }
52  }
53 
54  mooseError("Bad type passed in PolycrystalRandomIC");
55 }
const unsigned int _op_num
const unsigned int _op_index
const unsigned int _typ

Member Data Documentation

const unsigned int PolycrystalRandomIC::_op_index
private

Definition at line 30 of file PolycrystalRandomIC.h.

Referenced by value().

const unsigned int PolycrystalRandomIC::_op_num
private

Definition at line 29 of file PolycrystalRandomIC.h.

Referenced by value().

const unsigned int PolycrystalRandomIC::_typ
private

Definition at line 31 of file PolycrystalRandomIC.h.

Referenced by value().


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