www.mooseframework.org
VectorVariableComponentAux.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  MooseEnum component("x=0 y=1 z=2");
20  params.addClassDescription(
21  "Creates a field consisting of one component of a coupled vector variable.");
22  params.addRequiredCoupledVar("vector_variable",
23  "The variable from which to compute the component");
24  params.addParam<MooseEnum>("component", component, "The component to compute");
25  return params;
26 }
27 
29  : AuxKernel(parameters),
30  _vector_variable_value(coupledNodalValue<RealVectorValue>("vector_variable")),
31  _component(getParam<MooseEnum>("component"))
32 {
33  if (!isNodal())
34  mooseError(
35  "VectorVariableComponentAux is meant to be used with LAGRANGE_VEC variables and so the "
36  "auxiliary variable should be nodal");
37 }
38 
39 Real
41 {
43 }
virtual Real computeValue() override
Compute and return the value of the aux variable.
VectorValue< Real > RealVectorValue
Definition: Assembly.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
const RealVectorValue & _vector_variable_value
Reference to the value of the coupled vector variable.
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:25
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
bool isNodal()
Nodal or elemental kernel?
Definition: AuxKernel.h:84
InputParameters validParams< VectorVariableComponentAux >()
registerMooseObject("MooseApp", VectorVariableComponentAux)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
Extract a component from a vector variable.
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...
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:33
VectorVariableComponentAux(const InputParameters &parameters)
Class constructor.