https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorVariableComponentAux.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
13
16{
17 MooseEnum component("x=0 y=1 z=2");
20 "Creates a field consisting of one component of a coupled vector variable.");
21 params.addRequiredCoupledVar("vector_variable",
22 "The variable from which to compute the component");
23 params.addRequiredParam<MooseEnum>("component", component, "The component to compute");
24 return params;
25}
26
28 : AuxKernel(parameters),
29 _nodal_variable_value(_nodal ? &coupledNodalValue<RealVectorValue>("vector_variable")
30 : nullptr),
31 _elemental_variable_value(_nodal ? nullptr : &coupledVectorValue("vector_variable")),
32 _component(getParam<MooseEnum>("component"))
33{
34}
35
36Real
registerMooseObject("MooseApp", VectorVariableComponentAux)
const bool _nodal
Flag indicating if the AuxKernel is nodal.
Definition AuxKernel.h:116
unsigned int _qp
Quadrature point index.
Definition AuxKernel.h:155
static InputParameters validParams()
Definition AuxKernel.C:27
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Extract a component from a vector variable.
const VectorVariableValue *const _elemental_variable_value
Pointer to elemental variable value.
const int _component
Desired component.
const RealVectorValue *const _nodal_variable_value
Pointer to nodal variable value.
virtual Real computeValue() override
Compute and return the value of the aux variable.
static InputParameters validParams()
VectorVariableComponentAux(const InputParameters &parameters)
Class constructor.