www.mooseframework.org
ElementPropertyReadFile.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "GeneralUserObject.h"
13 
23 
24 template <>
25 InputParameters validParams<ElementPropertyReadFile>();
26 
27 class ElementPropertyReadFile : public GeneralUserObject
28 {
29 public:
30  static InputParameters validParams();
31 
32  ElementPropertyReadFile(const InputParameters & parameters);
34 
35  virtual void initialize() {}
36  virtual void execute() {}
37  virtual void finalize() {}
38 
42  void readElementData();
43 
47  virtual void readGrainData();
48 
53  virtual void initGrainCenterPoints();
54 
58  Real getData(const Elem *, unsigned int) const;
59 
63  Real getElementData(const Elem *, unsigned int) const;
64 
69  Real getGrainData(const Elem *, unsigned int) const;
70 
75  Real minPeriodicDistance(Point, Point) const;
76 
77 protected:
79  std::string _prop_file_name;
81  std::vector<Real> _data;
83  unsigned int _nprop;
85  unsigned int _ngrain;
87  MooseEnum _read_type;
89  unsigned int _rand_seed;
91  MooseEnum _rve_type;
92 
93  MooseMesh & _mesh;
94  std::vector<Point> _center;
95 
96 private:
97  unsigned int _nelem;
98  Point _top_right;
99  Point _bottom_left;
100  Point _range;
102 };
ElementPropertyReadFile::finalize
virtual void finalize()
Definition: ElementPropertyReadFile.h:37
ElementPropertyReadFile::ElementPropertyReadFile
ElementPropertyReadFile(const InputParameters &parameters)
Definition: ElementPropertyReadFile.C:42
ElementPropertyReadFile::_ngrain
unsigned int _ngrain
Number of grains (for property read based on grains)
Definition: ElementPropertyReadFile.h:85
ElementPropertyReadFile::_nprop
unsigned int _nprop
Number of properties in a row.
Definition: ElementPropertyReadFile.h:83
ElementPropertyReadFile
Definition: ElementPropertyReadFile.h:27
ElementPropertyReadFile::_bottom_left
Point _bottom_left
Definition: ElementPropertyReadFile.h:99
ElementPropertyReadFile::_range
Point _range
Definition: ElementPropertyReadFile.h:100
ElementPropertyReadFile::_center
std::vector< Point > _center
Definition: ElementPropertyReadFile.h:94
ElementPropertyReadFile::getData
Real getData(const Elem *, unsigned int) const
This function assign property data to elements.
Definition: ElementPropertyReadFile.C:126
ElementPropertyReadFile::_data
std::vector< Real > _data
Store property values read from file.
Definition: ElementPropertyReadFile.h:81
ElementPropertyReadFile::_read_type
MooseEnum _read_type
Type of read - element or grain.
Definition: ElementPropertyReadFile.h:87
ElementPropertyReadFile::_mesh
MooseMesh & _mesh
Definition: ElementPropertyReadFile.h:93
ElementPropertyReadFile::getElementData
Real getElementData(const Elem *, unsigned int) const
This function assign properties to element read from file with element based properties.
Definition: ElementPropertyReadFile.C:140
validParams< ElementPropertyReadFile >
InputParameters validParams< ElementPropertyReadFile >()
ElementPropertyReadFile::execute
virtual void execute()
Definition: ElementPropertyReadFile.h:36
ElementPropertyReadFile::_max_range
Real _max_range
Definition: ElementPropertyReadFile.h:101
ElementPropertyReadFile::readElementData
void readElementData()
This function reads element data from file.
Definition: ElementPropertyReadFile.C:79
ElementPropertyReadFile::_nelem
unsigned int _nelem
Definition: ElementPropertyReadFile.h:97
ElementPropertyReadFile::readGrainData
virtual void readGrainData()
This function Read grain data from file.
Definition: ElementPropertyReadFile.C:97
ElementPropertyReadFile::~ElementPropertyReadFile
virtual ~ElementPropertyReadFile()
Definition: ElementPropertyReadFile.h:33
ElementPropertyReadFile::_rve_type
MooseEnum _rve_type
Type of grain structure - non-periodic default.
Definition: ElementPropertyReadFile.h:91
ElementPropertyReadFile::_rand_seed
unsigned int _rand_seed
Random seed - used for generating grain centers.
Definition: ElementPropertyReadFile.h:89
ElementPropertyReadFile::minPeriodicDistance
Real minPeriodicDistance(Point, Point) const
This function calculates minimum distance between 2 points considering periodicity of the simulation ...
Definition: ElementPropertyReadFile.C:194
ElementPropertyReadFile::initialize
virtual void initialize()
Definition: ElementPropertyReadFile.h:35
ElementPropertyReadFile::validParams
static InputParameters validParams()
Definition: ElementPropertyReadFile.C:21
ElementPropertyReadFile::_prop_file_name
std::string _prop_file_name
Name of file containing property values.
Definition: ElementPropertyReadFile.h:79
ElementPropertyReadFile::_top_right
Point _top_right
Definition: ElementPropertyReadFile.h:98
ElementPropertyReadFile::getGrainData
Real getGrainData(const Elem *, unsigned int) const
This function assign properties to element read from file with grain based properties Grain distribut...
Definition: ElementPropertyReadFile.C:153
ElementPropertyReadFile::initGrainCenterPoints
virtual void initGrainCenterPoints()
This function generates grain center point Presently random generated.
Definition: ElementPropertyReadFile.C:116