www.mooseframework.org
EBSDReaderPointDataAux.C
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 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<AuxKernel>();
14  params.addRequiredParam<UserObjectName>("ebsd_reader", "The EBSDReader GeneralUserObject");
15  MooseEnum field_types = EBSDAccessFunctors::getPointDataFieldType();
16  params.addRequiredParam<MooseEnum>(
17  "data_name", field_types, "The data to be extracted from the EBSD data by this AuxKernel");
18  return params;
19 }
20 
21 EBSDReaderPointDataAux::EBSDReaderPointDataAux(const InputParameters & parameters)
22  : AuxKernel(parameters),
23  _ebsd_reader(getUserObject<EBSDReader>("ebsd_reader")),
24  _data_name(getParam<MooseEnum>("data_name")),
25  _val(_ebsd_reader.getPointDataAccessFunctor(_data_name))
26 {
27 }
28 
29 void
31 {
32  // EBSD data is defined at element centroids, so this only makes
33  // sense as an Element AuxKernel
34  Point p = _current_elem->centroid();
35 
36  _value = (*_val)(_ebsd_reader.getData(p));
37 }
38 
39 Real
41 {
42  return _value;
43 }
const EBSDReader & _ebsd_reader
Real _value
precalculated element value
const EBSDPointData & getData(const Point &p) const
Get the requested type of data at the point p.
Definition: EBSDReader.C:224
A GeneralUserObject that reads an EBSD file and stores the centroid data in a data structure which in...
Definition: EBSDReader.h:34
EBSDReaderPointDataAux(const InputParameters &parameters)
static MooseEnum getPointDataFieldType()
InputParameters validParams< EBSDReaderPointDataAux >()