Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
MaterialRealVectorValueAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 #include "metaphysicl/raw_type.h"
12 #include <type_traits>
13 
20 
21 template <typename T, bool is_ad, bool is_functor>
24 {
26  params.addClassDescription(
27  "Capture a component of a vector material property in an auxiliary variable.");
28  params.addParam<unsigned int>("component", 0, "The vector component to consider for this kernel");
29 
30  return params;
31 }
32 
33 template <typename T, bool is_ad, bool is_functor>
35  const InputParameters & parameters)
36  : MaterialAuxBaseTempl<T, is_ad, is_functor>(parameters),
37  _component(this->template getParam<unsigned int>("component"))
38 {
39  if constexpr (std::is_same_v<T, RealVectorValue>)
40  {
41  if (_component > LIBMESH_DIM)
42  this->mooseError("The component ",
43  _component,
44  " does not exist for ",
45  LIBMESH_DIM,
46  " dimensional problems");
47  }
48  else
49  {
50  if (_component > T::N)
51  this->mooseError("The component ", _component, " does not exist.");
52  }
53 }
54 
55 template <typename T, bool is_ad, bool is_functor>
56 Real
58 {
59  return MetaPhysicL::raw_value(this->_full_value(_component));
60 }
61 
virtual Real getRealValue() override
Returns material property values at quadrature points.
A base class for the various Material related AuxKernal objects.
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:73
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
AuxKernel for outputting a RealVectorValue material property component to an AuxVariable.
unsigned int _component
The vector component to output.
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 optional parameter and a documentation string to the InputParameters object...
MaterialRealVectorValueAuxTempl(const InputParameters &parameters)
Class constructor.
static InputParameters validParams()
void ErrorVector unsigned int
registerMooseObject("MooseApp", MaterialRealVectorValueAux)