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

Read a set of Euler angles from a file. More...

#include <EulerAngleFileReader.h>

Inheritance diagram for EulerAngleFileReader:
[legend]

Public Member Functions

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

Protected Member Functions

void readFile ()
 

Protected Attributes

FileName _file_name
 
std::vector< EulerAngles_angles
 

Detailed Description

Read a set of Euler angles from a file.

Definition at line 22 of file EulerAngleFileReader.h.

Constructor & Destructor Documentation

EulerAngleFileReader::EulerAngleFileReader ( const InputParameters &  parameters)

Definition at line 21 of file EulerAngleFileReader.C.

22  : EulerAngleProvider(params), _file_name(getParam<FileName>("file_name"))
23 {
24  readFile();
25 }
EulerAngleProvider(const InputParameters &parameters)

Member Function Documentation

virtual void EulerAngleFileReader::execute ( )
inlinevirtual

Definition at line 31 of file EulerAngleFileReader.h.

31 {}
virtual void EulerAngleFileReader::finalize ( )
inlinevirtual

Definition at line 32 of file EulerAngleFileReader.h.

32 {}
const EulerAngles & EulerAngleFileReader::getEulerAngles ( unsigned int  i) const
virtual

Implements EulerAngleProvider.

Definition at line 34 of file EulerAngleFileReader.C.

35 {
36  mooseAssert(i < getGrainNum(), "Requesting Euler angles for an invalid grain id");
37  return _angles[i];
38 }
virtual unsigned int getGrainNum() const
std::vector< EulerAngles > _angles
unsigned int EulerAngleFileReader::getGrainNum ( ) const
virtual

Implements EulerAngleProvider.

Definition at line 28 of file EulerAngleFileReader.C.

Referenced by getEulerAngles().

29 {
30  return _angles.size();
31 }
std::vector< EulerAngles > _angles
virtual void EulerAngleFileReader::initialize ( )
inlinevirtual

Definition at line 30 of file EulerAngleFileReader.h.

30 {}
void EulerAngleFileReader::readFile ( )
protected

Definition at line 41 of file EulerAngleFileReader.C.

Referenced by EulerAngleFileReader(), and finalize().

42 {
43  // Read in Euler angles from _file_name
44  std::ifstream inFile(_file_name.c_str());
45  if (!inFile)
46  mooseError("Can't open ", _file_name);
47 
48  // Skip first 4 lines
49  for (unsigned int i = 0; i < 4; ++i)
50  inFile.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
51 
52  // The angle files contain a fourth column with weights that we ignore in this version
53  Real weight;
54 
55  // Loop over grains
56  EulerAngles a;
57  while (inFile >> a.phi1 >> a.Phi >> a.phi2 >> weight)
58  _angles.push_back(EulerAngles(a));
59 }
Euler angle triplet.
Definition: EulerAngles.h:20
std::vector< EulerAngles > _angles

Member Data Documentation

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

Definition at line 38 of file EulerAngleFileReader.h.

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

FileName EulerAngleFileReader::_file_name
protected

Definition at line 37 of file EulerAngleFileReader.h.

Referenced by readFile().


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