www.mooseframework.org
PolycrystalCircles.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 POLYCRYSTALCIRCLES_H
8 #define POLYCRYSTALCIRCLES_H
9 
10 #include <array>
12 #include "DelimitedFileReader.h"
13 
14 // Forward Declarations
15 class PolycrystalCircles;
16 
17 template <>
18 InputParameters validParams<PolycrystalCircles>();
19 
29 {
30 public:
31  PolycrystalCircles(const InputParameters & parameters);
32 
33  // Required functions from PolycrystalUserObjectBase
34  virtual void precomputeGrainStructure() override;
35  virtual void getGrainsBasedOnPoint(const Point & point,
36  std::vector<unsigned int> & grains) const override;
37  virtual Real getVariableValue(unsigned int op_index, const Point & p) const override;
38  virtual unsigned int getNumGrains() const override { return _grain_num; }
39 
40 protected:
41  enum COLS
42  {
43  X,
44  Y,
45  Z,
46  R
47  }; // Names of columns in text file.
48  const bool _columnar_3D;
49  unsigned int _grain_num; // Number of crystal grains to create
50 
51  std::vector<Point> _centerpoints; // x,y,z coordinates of circle centers
52  std::vector<Real> _radii; // Radius for each circular grain created
53 };
54 
55 #endif // POLYCRYSTALCIRCLES_H
virtual void getGrainsBasedOnPoint(const Point &point, std::vector< unsigned int > &grains) const override
Method for retrieving active grain IDs based on some point in the mesh.
InputParameters validParams< PolycrystalCircles >()
This object provides the base capability for creating proper polycrystal ICs.
virtual Real getVariableValue(unsigned int op_index, const Point &p) const override
Returns the variable value for a given op_index and mesh point.
std::vector< Real > _radii
virtual unsigned int getNumGrains() const override
Must be overridden by the deriving class to provide the number of grains in the polycrystal structure...
PolycrystalCircles(const InputParameters &parameters)
virtual void precomputeGrainStructure() override
This callback is triggered after the object is initialized and may be optionally overridden to do pre...
std::vector< Point > _centerpoints
PolycrystalCircles creates a polycrystal made up of circles.