www.mooseframework.org
MaterialRealVectorValueAux.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<MaterialAuxBase<>>();
19  params.addParam<unsigned int>("component", 0, "The vector component to consider for this kernel");
20 
21  return params;
22 }
23 
25  : MaterialAuxBase<RealVectorValue>(parameters), _component(getParam<unsigned int>("component"))
26 {
27  if (_component > LIBMESH_DIM)
28  mooseError(
29  "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
30 }
31 
32 Real
34 {
35  return _prop[_qp](_component);
36 }
virtual Real getRealValue() override
Returns material property values at quadrature points.
VectorValue< Real > RealVectorValue
Definition: Assembly.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
A base class for the various Material related AuxKernal objects.
const MaterialProperty< RealVectorValue > & _prop
Reference to the material property for this AuxKernel.
InputParameters validParams< MaterialRealVectorValueAux >()
MaterialRealVectorValueAux(const InputParameters &parameters)
Class constructor.
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:219
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 _component
The vector component to output.
AuxKernel for outputting a RealVectorValue material property component to an AuxVariable.
registerMooseObject("MooseApp", MaterialRealVectorValueAux)