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 
12 #include "metaphysicl/raw_type.h"
13 
16 
17 template <bool is_ad>
20 {
22  params.addClassDescription(
23  "Capture a component of a vector material property in an auxiliary variable.");
24  params.addParam<unsigned int>("component", 0, "The vector component to consider for this kernel");
25 
26  return params;
27 }
28 
29 template <bool is_ad>
31  const InputParameters & parameters)
32  : MaterialAuxBaseTempl<RealVectorValue, is_ad>(parameters),
33  _component(this->template getParam<unsigned int>("component"))
34 {
35  if (_component > LIBMESH_DIM)
36  this->mooseError(
37  "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
38 }
39 
40 template <bool is_ad>
41 Real
43 {
44  return MetaPhysicL::raw_value(this->_prop[this->_qp](_component));
45 }
46 
virtual Real getRealValue() override
Returns material property values at quadrature points.
unsigned int _component
The vector component to output.
A base class for the various Material related AuxKernal objects.
auto raw_value(const Eigen::Map< T > &in)
Definition: ADReal.h:73
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MaterialRealVectorValueAuxTempl(const InputParameters &parameters)
Class constructor.
static InputParameters validParams()
AuxKernel for outputting a RealVectorValue material property component to an AuxVariable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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 ErrorVector unsigned int
registerMooseObject("MooseApp", MaterialRealVectorValueAux)