https://mooseframework.inl.gov
EBSDReaderPointDataAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 #include "EBSDReaderPointDataAux.h"
11 
13 
16 {
18  params.addClassDescription("Outputs the requested EBSD reader point data.");
19  params.addRequiredParam<UserObjectName>("ebsd_reader", "The EBSDReader GeneralUserObject");
22  "data_name", field_types, "The data to be extracted from the EBSD data by this AuxKernel");
23  return params;
24 }
25 
27  : AuxKernel(parameters),
28  _ebsd_reader(getUserObject<EBSDReader>("ebsd_reader")),
29  _data_name(getParam<MooseEnum>("data_name")),
30  _val(_ebsd_reader.getPointDataAccessFunctor(_data_name))
31 {
32  if (isNodal())
33  mooseError("This AuxKernel only supports Elemental fields");
34 }
35 
36 void
38 {
39  // EBSD data is defined at element centroids, so this only makes
40  // sense as an Element AuxKernel
41  Point p = _current_elem->vertex_average();
42 
43  _value = (*_val)(_ebsd_reader.getData(p));
44 }
45 
46 Real
48 {
49  return _value;
50 }
const EBSDReader & _ebsd_reader
static InputParameters validParams()
Real _value
precalculated element value
This kernel makes data from the EBSDReader GeneralUserObject available as AuxVariables.
registerMooseObject("PhaseFieldApp", EBSDReaderPointDataAux)
const EBSDPointData & getData(const Point &p) const
Get the requested type of data at the point p.
Definition: EBSDReader.C:350
void addRequiredParam(const std::string &name, const std::string &doc_string)
A GeneralUserObject that reads an EBSD file and stores the centroid data in a data structure which in...
Definition: EBSDReader.h:31
EBSDReaderPointDataAux(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
const Elem *const & _current_elem
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
static MooseEnum getPointDataFieldType()