www.mooseframework.org
MaterialRealTensorValueAux.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>("row", 0, "The row component to consider for this kernel");
20  params.addParam<unsigned int>("column", 0, "The column component to consider for this kernel");
21  return params;
22 }
23 
25  : MaterialAuxBase<RealTensorValue>(parameters),
26  _row(getParam<unsigned int>("row")),
27  _col(getParam<unsigned int>("column"))
28 {
29  if (_row > LIBMESH_DIM)
30  mooseError(
31  "The row component ", _row, " does not exist for ", LIBMESH_DIM, " dimensional problems");
32  if (_col > LIBMESH_DIM)
33  mooseError("The column component ",
34  _col,
35  " does not exist for ",
36  LIBMESH_DIM,
37  " dimensional problems");
38 }
39 
40 Real
42 {
43  return _prop[_qp](_row, _col);
44 }
InputParameters validParams< MaterialRealTensorValueAux >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
AuxKernel for outputting a RealTensorValue material property component to an AuxVariable.
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
A base class for the various Material related AuxKernal objects.
const MaterialProperty< RealTensorValue > & _prop
Reference to the material property for this AuxKernel.
MaterialRealTensorValueAux(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...
virtual Real getRealValue() override
Returns material property values at quadrature points.
TensorValue< Real > RealTensorValue
Definition: MooseTypes.h:132
registerMooseObject("MooseApp", MaterialRealTensorValueAux)
unsigned int _row
The row index to output.
unsigned int _col
The column index to output.