www.mooseframework.org
MaterialStdVectorRealGradientAux.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 
11 
13 
16 {
18  params.addClassDescription("Extracts a component of a material's std::vector<RealGradient> to an "
19  "aux variable. If the std::vector is not of sufficient size then "
20  "zero is returned");
21  params.addParam<unsigned int>(
22  "component", 0, "The gradient component to be extracted for this kernel");
23  return params;
24 }
25 
27  const InputParameters & parameters)
29  _component(getParam<unsigned int>("component"))
30 {
31  if (_component > LIBMESH_DIM)
32  mooseError(
33  "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
34 }
35 
36 Real
38 {
39  return _prop[_qp][_index](_component);
40 }
static InputParameters validParams()
AuxKernel for outputting a std::vector material-property component to an AuxVariable.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
registerMooseObject("MooseApp", MaterialStdVectorRealGradientAux)
const GenericMaterialProperty< std::vector< T >, is_ad > & _prop
Reference to the material property for this AuxKernel.
virtual Real getRealValue() override
Returns material property values at quadrature points.
A base class for the various Material related AuxKernal objects.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MaterialStdVectorRealGradientAux(const InputParameters &parameters)
unsigned int _component
component of the real gradient to be extracted
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:230
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
unsigned int _index
index of the vecor element
void ErrorVector unsigned int