www.mooseframework.org
LevelSetVelocityInterface.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef LEVELSETVELOCITYINTERFACE_H
9 #define LEVELSETVELOCITYINTERFACE_H
10 
11 // MOOSE includes
12 #include "InputParameters.h"
13 #include "MooseVariableBase.h"
14 #include "Kernel.h"
15 
16 template <typename T = Kernel>
18 
19 template <>
20 InputParameters validParams<LevelSetVelocityInterface<>>();
21 
26 template <class T>
27 class LevelSetVelocityInterface : public T
28 {
29 public:
30  LevelSetVelocityInterface(const InputParameters & parameters);
31 
32 protected:
37  void computeQpVelocity();
38 
41  const VariableValue & _velocity_x;
42  const VariableValue & _velocity_y;
43  const VariableValue & _velocity_z;
45 
48  const unsigned int _x_vel_var;
49  const unsigned int _y_vel_var;
50  const unsigned int _z_vel_var;
52 
54  RealVectorValue _velocity;
55 };
56 
57 template <class T>
58 void
60 {
61  _velocity(0) = _velocity_x[T::_qp];
62  _velocity(1) = _velocity_y[T::_qp];
63  _velocity(2) = _velocity_z[T::_qp];
64 }
65 
66 template <class T>
68  : T(parameters),
69  _velocity_x(T::coupledValue("velocity_x")),
70  _velocity_y(T::coupledValue("velocity_y")),
71  _velocity_z(T::coupledValue("velocity_z")),
72  _x_vel_var(T::coupled("velocity_x")),
73  _y_vel_var(T::coupled("velocity_y")),
74  _z_vel_var(T::coupled("velocity_z"))
75 {
76 }
77 
78 #endif // LEVELSETVELOCITYINTERFACE_H
RealVectorValue _velocity
Storage for velocity vector.
A helper class for defining the velocity as coupled variables for the levelset equation.
LevelSetVelocityInterface(const InputParameters &parameters)
void computeQpVelocity()
This method should be called when the velocity vector needs to be updated, this is not done automatic...