www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
RandomEulerAngleProvider Class Reference

Assign random Euler angles to each grains. More...

#include <RandomEulerAngleProvider.h>

Inheritance diagram for RandomEulerAngleProvider:
[legend]

Public Member Functions

 RandomEulerAngleProvider (const InputParameters &parameters)
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual const EulerAnglesgetEulerAngles (unsigned int) const override
 
virtual unsigned int getGrainNum () const override
 

Protected Attributes

const GrainTrackerInterface_grain_tracker
 
std::vector< EulerAngles_angles
 
MooseRandom _random
 

Detailed Description

Assign random Euler angles to each grains.

Definition at line 23 of file RandomEulerAngleProvider.h.

Constructor & Destructor Documentation

RandomEulerAngleProvider::RandomEulerAngleProvider ( const InputParameters &  parameters)

Definition at line 22 of file RandomEulerAngleProvider.C.

23  : EulerAngleProvider(params),
24  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_tracker_object")),
25  _angles(0)
26 {
27  _random.seed(0, getParam<unsigned int>("seed"));
28 }
EulerAngleProvider(const InputParameters &parameters)
std::vector< EulerAngles > _angles
const GrainTrackerInterface & _grain_tracker

Member Function Documentation

virtual void RandomEulerAngleProvider::execute ( )
inlineoverridevirtual

Definition at line 29 of file RandomEulerAngleProvider.h.

29 {}
virtual void RandomEulerAngleProvider::finalize ( )
inlineoverridevirtual

Definition at line 30 of file RandomEulerAngleProvider.h.

30 {}
const EulerAngles & RandomEulerAngleProvider::getEulerAngles ( unsigned int  i) const
overridevirtual

Implements EulerAngleProvider.

Definition at line 49 of file RandomEulerAngleProvider.C.

Referenced by finalize().

50 {
51  mooseAssert(i < getGrainNum(), "Requesting Euler angles for an invalid grain id");
52  return _angles[i];
53 }
virtual unsigned int getGrainNum() const override
std::vector< EulerAngles > _angles
unsigned int RandomEulerAngleProvider::getGrainNum ( ) const
overridevirtual

Implements EulerAngleProvider.

Definition at line 43 of file RandomEulerAngleProvider.C.

Referenced by finalize(), and getEulerAngles().

44 {
45  return _angles.size();
46 }
std::vector< EulerAngles > _angles
void RandomEulerAngleProvider::initialize ( )
overridevirtual

Definition at line 31 of file RandomEulerAngleProvider.C.

32 {
33  EulerAngles angle;
34  auto grain_num = _grain_tracker.getTotalFeatureCount();
35  for (auto i = _angles.size(); i < grain_num; ++i)
36  {
37  angle.random(_random);
38  _angles.push_back(angle);
39  }
40 }
virtual std::size_t getTotalFeatureCount() const =0
Returns a number large enough to contain the largest ID for all grains in use.
void random()
Definition: EulerAngles.C:12
Euler angle triplet.
Definition: EulerAngles.h:20
std::vector< EulerAngles > _angles
const GrainTrackerInterface & _grain_tracker

Member Data Documentation

std::vector<EulerAngles> RandomEulerAngleProvider::_angles
protected

Definition at line 37 of file RandomEulerAngleProvider.h.

Referenced by getEulerAngles(), getGrainNum(), and initialize().

const GrainTrackerInterface& RandomEulerAngleProvider::_grain_tracker
protected

Definition at line 36 of file RandomEulerAngleProvider.h.

Referenced by initialize().

MooseRandom RandomEulerAngleProvider::_random
protected

Definition at line 39 of file RandomEulerAngleProvider.h.

Referenced by initialize(), and RandomEulerAngleProvider().


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