www.mooseframework.org
MaterialStdVectorRealGradientAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
16 
17 template <>
20 {
21  InputParameters params = validParams<MaterialStdVectorAuxBase<>>();
22  params.addClassDescription("Extracts a component of a material's std::vector<RealGradient> to an "
23  "aux variable. If the std::vector is not of sufficient size then "
24  "zero is returned");
25  params.addParam<unsigned int>(
26  "component", 0, "The gradient component to be extracted for this kernel");
27  return params;
28 }
29 
31  const InputParameters & parameters)
33  _component(getParam<unsigned int>("component"))
34 {
35  if (_component > LIBMESH_DIM)
36  mooseError(
37  "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
38 }
39 
40 Real
42 {
43  return _prop[_qp][_index](_component);
44 }
RealVectorValue RealGradient
Definition: Assembly.h:43
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const MaterialProperty< std::vector< RealGradient > > & _prop
Reference to the material property for this AuxKernel.
unsigned int _index
index of the vecor element
virtual Real getRealValue() override
Returns material property values at quadrature points.
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:192
InputParameters validParams< MaterialStdVectorRealGradientAux >()
MaterialStdVectorRealGradientAux(const InputParameters &parameters)
unsigned int _component
component of the real gradient to be extracted
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...
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
A base class for the various Material related AuxKernal objects.