www.mooseframework.org
EBSDReaderPointDataAux.C
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 #include "EBSDReaderPointDataAux.h"
11 
13 
16 {
18  params.addRequiredParam<UserObjectName>("ebsd_reader", "The EBSDReader GeneralUserObject");
21  "data_name", field_types, "The data to be extracted from the EBSD data by this AuxKernel");
22  return params;
23 }
24 
26  : AuxKernel(parameters),
27  _ebsd_reader(getUserObject<EBSDReader>("ebsd_reader")),
28  _data_name(getParam<MooseEnum>("data_name")),
29  _val(_ebsd_reader.getPointDataAccessFunctor(_data_name))
30 {
31  if (isNodal())
32  mooseError("This AuxKernel only supports Elemental fields");
33 }
34 
35 void
37 {
38  // EBSD data is defined at element centroids, so this only makes
39  // sense as an Element AuxKernel
40  Point p = _current_elem->vertex_average();
41 
42  _value = (*_val)(_ebsd_reader.getData(p));
43 }
44 
45 Real
47 {
48  return _value;
49 }
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
static InputParameters validParams()
static MooseEnum getPointDataFieldType()