www.mooseframework.org
VectorMagnitudeAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 // MOOSE includes
16 #include "VectorMagnitudeAux.h"
17 #include "MooseMesh.h"
18 
19 template <>
22 {
24  params.addClassDescription("Creates a field representing the magnitude of three coupled "
25  "variables using an Euclidean norm.");
26  params.addRequiredCoupledVar("x", "x-component of the vector");
27  params.addCoupledVar("y", "y-component of the vector");
28  params.addCoupledVar("z", "z-component of the vector");
29 
30  return params;
31 }
32 
34  : AuxKernel(parameters),
35  _x(coupledValue("x")),
36  _y(_mesh.dimension() >= 2 ? coupledValue("y") : _zero),
37  _z(_mesh.dimension() >= 3 ? coupledValue("z") : _zero)
38 {
39 }
40 
41 Real
43 {
44  return std::sqrt((_x[_qp] * _x[_qp]) + (_y[_qp] * _y[_qp]) + (_z[_qp] * _z[_qp]));
45 }
InputParameters validParams< VectorMagnitudeAux >()
virtual Real computeValue() override
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const VariableValue & _y
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:30
VectorMagnitudeAux(const InputParameters &parameters)
const VariableValue & _z
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:192
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:51
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.
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...
const VariableValue & _x