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 26 of file RandomEulerAngleProvider.h.

Constructor & Destructor Documentation

◆ RandomEulerAngleProvider()

RandomEulerAngleProvider::RandomEulerAngleProvider ( const InputParameters &  parameters)

Definition at line 27 of file RandomEulerAngleProvider.C.

28  : EulerAngleProvider(params),
29  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_tracker_object")),
30  _angles(0)
31 {
32  _random.seed(0, getParam<unsigned int>("seed"));
33 }
EulerAngleProvider(const InputParameters &parameters)
std::vector< EulerAngles > _angles
const GrainTrackerInterface & _grain_tracker

Member Function Documentation

◆ execute()

virtual void RandomEulerAngleProvider::execute ( )
inlineoverridevirtual

Definition at line 32 of file RandomEulerAngleProvider.h.

32 {}

◆ finalize()

virtual void RandomEulerAngleProvider::finalize ( )
inlineoverridevirtual

Definition at line 33 of file RandomEulerAngleProvider.h.

33 {}

◆ getEulerAngles()

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

Implements EulerAngleProvider.

Definition at line 54 of file RandomEulerAngleProvider.C.

55 {
56  mooseAssert(i < getGrainNum(), "Requesting Euler angles for an invalid grain id");
57  return _angles[i];
58 }
virtual unsigned int getGrainNum() const override
std::vector< EulerAngles > _angles

◆ getGrainNum()

unsigned int RandomEulerAngleProvider::getGrainNum ( ) const
overridevirtual

Implements EulerAngleProvider.

Definition at line 48 of file RandomEulerAngleProvider.C.

Referenced by getEulerAngles().

49 {
50  return _angles.size();
51 }
std::vector< EulerAngles > _angles

◆ initialize()

void RandomEulerAngleProvider::initialize ( )
overridevirtual

Definition at line 36 of file RandomEulerAngleProvider.C.

37 {
38  EulerAngles angle;
39  auto grain_num = _grain_tracker.getTotalFeatureCount();
40  for (auto i = _angles.size(); i < grain_num; ++i)
41  {
42  angle.random(_random);
43  _angles.push_back(angle);
44  }
45 }
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:14
Euler angle triplet.
Definition: EulerAngles.h:22
std::vector< EulerAngles > _angles
const GrainTrackerInterface & _grain_tracker

Member Data Documentation

◆ _angles

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

Definition at line 40 of file RandomEulerAngleProvider.h.

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

◆ _grain_tracker

const GrainTrackerInterface& RandomEulerAngleProvider::_grain_tracker
protected

Definition at line 39 of file RandomEulerAngleProvider.h.

Referenced by initialize().

◆ _random

MooseRandom RandomEulerAngleProvider::_random
protected

Definition at line 42 of file RandomEulerAngleProvider.h.

Referenced by initialize(), and RandomEulerAngleProvider().


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