www.mooseframework.org
ElementPropertyReadFile.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #ifndef ELEMENTPROPERTYREADFILE_H
8 #define ELEMENTPROPERTYREADFILE_H
9 
10 #include "GeneralUserObject.h"
11 
21 
22 template <>
23 InputParameters validParams<ElementPropertyReadFile>();
24 
25 class ElementPropertyReadFile : public GeneralUserObject
26 {
27 public:
28  ElementPropertyReadFile(const InputParameters & parameters);
30 
31  virtual void initialize() {}
32  virtual void execute() {}
33  virtual void finalize() {}
34 
38  void readElementData();
39 
43  virtual void readGrainData();
44 
49  virtual void initGrainCenterPoints();
50 
54  Real getData(const Elem *, unsigned int) const;
55 
59  Real getElementData(const Elem *, unsigned int) const;
60 
65  Real getGrainData(const Elem *, unsigned int) const;
66 
71  Real minPeriodicDistance(Point, Point) const;
72 
73 protected:
75  std::string _prop_file_name;
77  std::vector<Real> _data;
79  unsigned int _nprop;
81  unsigned int _ngrain;
83  MooseEnum _read_type;
85  unsigned int _rand_seed;
87  MooseEnum _rve_type;
88 
89  MooseMesh & _mesh;
90  std::vector<Point> _center;
91 
92 private:
93  unsigned int _nelem;
94  Point _top_right;
95  Point _bottom_left;
96  Point _range;
97  Real _max_range;
98 };
99 
100 #endif
Real getElementData(const Elem *, unsigned int) const
This function assign properties to element read from file with element based properties.
unsigned int _nprop
Number of properties in a row.
ElementPropertyReadFile(const InputParameters &parameters)
InputParameters validParams< ElementPropertyReadFile >()
Real getData(const Elem *, unsigned int) const
This function assign property data to elements.
Real minPeriodicDistance(Point, Point) const
This function calculates minimum distance between 2 points considering periodicity of the simulation ...
std::vector< Point > _center
unsigned int _ngrain
Number of grains (for property read based on grains)
MooseEnum _read_type
Type of read - element or grain.
std::vector< Real > _data
Store property values read from file.
void readElementData()
This function reads element data from file.
virtual void readGrainData()
This function Read grain data from file.
unsigned int _rand_seed
Random seed - used for generating grain centers.
MooseEnum _rve_type
Type of grain structure - non-periodic default.
Real getGrainData(const Elem *, unsigned int) const
This function assign properties to element read from file with grain based properties Grain distribut...
virtual void initGrainCenterPoints()
This function generates grain center point Presently random generated.
std::string _prop_file_name
Name of file containing property values.