https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorVariableMagnitudeAux.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{
18 params.addClassDescription("Creates a field consisting of the magnitude of a "
19 "coupled vector variable.");
20 params.addRequiredCoupledVar("vector_variable",
21 "The variable from which to compute the component");
22 return params;
23}
24
26 : AuxKernel(parameters), _variable_value(coupledVectorValue("vector_variable"))
27{
28}
29
30Real
32{
33 return std::sqrt(Utility::pow<2>(_variable_value[_qp](0)) +
34 Utility::pow<2>(_variable_value[_qp](1)) +
35 Utility::pow<2>(_variable_value[_qp](2)));
36}
registerMooseObject("MooseApp", VectorVariableMagnitudeAux)
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 addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Compute the magnitude of a vector variable.
virtual Real computeValue() override
Compute and return the value of the aux variable.
VectorVariableMagnitudeAux(const InputParameters &parameters)
Class constructor.
const VectorVariableValue & _variable_value
Reference to vector variable value.
static InputParameters validParams()