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 
14 template <>
17 {
18  InputParameters params = validParams<MaterialStdVectorAuxBase<>>();
19  params.addClassDescription("Extracts a component of a material's std::vector<RealGradient> to an "
20  "aux variable. If the std::vector is not of sufficient size then "
21  "zero is returned");
22  params.addParam<unsigned int>(
23  "component", 0, "The gradient component to be extracted for this kernel");
24  return params;
25 }
26 
28  const InputParameters & parameters)
29  : MaterialStdVectorAuxBase<RealGradient>(parameters),
30  _component(getParam<unsigned int>("component"))
31 {
32  if (_component > LIBMESH_DIM)
33  mooseError(
34  "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
35 }
36 
37 Real
39 {
40  return _prop[_qp][_index](_component);
41 }
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...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
const MaterialProperty< std::vector< RealGradient > > & _prop
Reference to the material property for this AuxKernel.
registerMooseObject("MooseApp", MaterialStdVectorRealGradientAux)
unsigned int _index
index of the vecor element
virtual Real getRealValue() override
Returns material property values at quadrature points.
InputParameters validParams< MaterialStdVectorRealGradientAux >()
MaterialStdVectorRealGradientAux(const InputParameters &parameters)
unsigned int _component
component of the real gradient to be extracted
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:219
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...
A base class for the various Material related AuxKernal objects.