https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
21template <typename T, bool is_ad, bool is_functor>
24{
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
33template <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 ",
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
55template <typename T, bool is_ad, bool is_functor>
56Real
61
registerMooseObject("MooseApp", MaterialRealVectorValueAux)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
void ErrorVector unsigned int
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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.
A base class for the various Material related AuxKernal objects.
static InputParameters validParams()
AuxKernel for outputting a RealVectorValue material property component to an AuxVariable.
virtual Real getRealValue() override
Returns material property values at quadrature points.
unsigned int _component
The vector component to output.
MaterialRealVectorValueAuxTempl(const InputParameters &parameters)
Class constructor.
auto raw_value(const Eigen::Map< T > &in)