https://mooseframework.inl.gov
VectorMagnitudeAux.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 
10 // MOOSE includes
11 #include "VectorMagnitudeAux.h"
12 #include "MooseMesh.h"
13 
15 
18 {
20  params.addClassDescription("Creates a field representing the magnitude of three coupled "
21  "variables using an Euclidean norm.");
22  params.addRequiredCoupledVar("x", "x-component of the vector");
23  params.addCoupledVar("y", "y-component of the vector");
24  params.addCoupledVar("z", "z-component of the vector");
25 
26  return params;
27 }
28 
30  : AuxKernel(parameters),
31  _x(coupledValue("x")),
32  _y(_mesh.dimension() >= 2 ? coupledValue("y") : _zero),
33  _z(_mesh.dimension() >= 3 ? coupledValue("z") : _zero)
34 {
35 }
36 
37 Real
39 {
40  return std::sqrt((_x[_qp] * _x[_qp]) + (_y[_qp] * _y[_qp]) + (_z[_qp] * _z[_qp]));
41 }
Computes the magnitude of a vector whose components are given by up to three coupled variables...
virtual Real computeValue() override
Compute and return the value of the aux variable.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const VariableValue & _y
registerMooseObject("MooseApp", VectorMagnitudeAux)
VectorMagnitudeAux(const InputParameters &parameters)
const VariableValue & _z
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:230
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...
static InputParameters validParams()
Definition: AuxKernel.C:27
const VariableValue & _x