www.mooseframework.org
NeighborMooseVariableInterface.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 
12 // MOOSE includes
13 #include "Assembly.h"
14 #include "MooseVariableFE.h"
15 #include "MooseTypes.h"
16 #include "Problem.h"
17 #include "SubProblem.h"
18 
19 template <typename T>
21  const MooseObject * moose_object,
22  bool nodal,
23  Moose::VarKindType expected_var_type,
24  Moose::VarFieldType expected_var_field_type)
26  moose_object, nodal, "variable", expected_var_type, expected_var_field_type)
27 {
28 }
29 
30 template <typename T>
32 {
33 }
34 
35 template <typename T>
36 const typename OutputTools<T>::VariableValue &
38 {
39  if (this->_nodal)
40  return this->_variable->dofValuesNeighbor();
41  else
42  return this->_variable->slnNeighbor();
43 }
44 
45 template <>
46 const VectorVariableValue &
48 {
49  if (this->_nodal)
50  mooseError("Dofs are scalars while vector variables have vector values. Mismatch");
51  else
52  return this->_variable->slnNeighbor();
53 }
54 
55 template <typename T>
56 const typename OutputTools<T>::VariableValue &
58 {
59  if (this->_nodal)
60  return this->_variable->dofValuesOldNeighbor();
61  else
62  return this->_variable->slnOldNeighbor();
63 }
64 
65 template <>
66 const VectorVariableValue &
68 {
69  if (this->_nodal)
70  mooseError("Dofs are scalars while vector variables have vector values. Mismatch");
71  else
72  return this->_variable->slnOldNeighbor();
73 }
74 
75 template <typename T>
76 const typename OutputTools<T>::VariableValue &
78 {
79  if (this->_nodal)
80  return this->_variable->dofValuesOlderNeighbor();
81  else
82  return this->_variable->slnOlderNeighbor();
83 }
84 
85 template <>
86 const VectorVariableValue &
88 {
89  if (this->_nodal)
90  mooseError("Dofs are scalars while vector variables have vector values. Mismatch");
91  else
92  return this->_variable->slnOlderNeighbor();
93 }
94 
95 template <typename T>
96 const typename OutputTools<T>::VariableGradient &
98 {
99  if (this->_nodal)
100  mooseError("Nodal variables do not have gradients");
101 
102  return this->_variable->gradSlnNeighbor();
103 }
104 
105 template <typename T>
106 const typename OutputTools<T>::VariableGradient &
108 {
109  if (this->_nodal)
110  mooseError("Nodal variables do not have gradients");
111 
112  return this->_variable->gradSlnOldNeighbor();
113 }
114 
115 template <typename T>
116 const typename OutputTools<T>::VariableGradient &
118 {
119  if (this->_nodal)
120  mooseError("Nodal variables do not have gradients");
121 
122  return this->_variable->gradSlnOlderNeighbor();
123 }
124 
125 template <typename T>
126 const typename OutputTools<T>::VariableSecond &
128 {
129  if (this->_nodal)
130  mooseError("Nodal variables do not have second derivatives");
131 
132  return this->_variable->secondSlnNeighbor();
133 }
134 
135 template <typename T>
136 const typename OutputTools<T>::VariableSecond &
138 {
139  if (this->_nodal)
140  mooseError("Nodal variables do not have second derivatives");
141 
142  return this->_variable->secondSlnOldNeighbor();
143 }
144 
145 template <typename T>
146 const typename OutputTools<T>::VariableSecond &
148 {
149  if (this->_nodal)
150  mooseError("Nodal variables do not have second derivatives");
151 
152  return this->_variable->secondSlnOlderNeighbor();
153 }
154 
155 template <typename T>
156 const typename OutputTools<T>::VariableTestSecond &
158 {
159  if (this->_nodal)
160  mooseError("Nodal variables do not have second derivatives");
161 
162  return this->_variable->secondPhiFaceNeighbor();
163 }
164 
165 template <typename T>
166 const typename OutputTools<T>::VariablePhiSecond &
168 {
169  if (this->_nodal)
170  mooseError("Nodal variables do not have second derivatives");
171 
172  return this->_mvi_assembly->secondPhiFaceNeighbor(*this->_variable);
173 }
174 
VarFieldType
Definition: MooseTypes.h:634
virtual const OutputTools< T >::VariablePhiSecond & neighborSecondPhi()
The second derivative of the neighbor&#39;s shape function.
virtual const OutputTools< T >::VariableGradient & neighborGradient()
The gradient of the variable this object is operating on evaluated on the "neighbor" element...
NeighborMooseVariableInterface(const MooseObject *moose_object, bool nodal, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_STANDARD)
Constructing the object.
virtual const OutputTools< T >::VariableGradient & neighborGradientOld()
The old gradient of the variable this object is operating on evaluated on the "neighbor" element...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
Definition: MooseTypes.h:319
virtual const OutputTools< T >::VariableSecond & neighborSecond()
The second derivative of the variable this object is operating on evaluated on the "neighbor" element...
virtual const OutputTools< T >::VariableGradient & neighborGradientOlder()
The older gradient of the variable this object is operating on evaluated on the "neighbor" element...
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
virtual const OutputTools< T >::VariableSecond & neighborSecondOlder()
The older second derivative of the variable this object is operating on evaluated on the "neighbor" e...
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:627
virtual const OutputTools< T >::VariableSecond & neighborSecondOld()
The old second derivative of the variable this object is operating on evaluated on the "neighbor" ele...
virtual const OutputTools< T >::VariableTestSecond & neighborSecondTest()
The second derivative of the neighbor&#39;s test function.
virtual const OutputTools< T >::VariableValue & neighborValueOld()
The old value of the variable this object is operating on evaluated on the "neighbor" element...
Interface for objects that need to get values of MooseVariables.
virtual const OutputTools< T >::VariableValue & neighborValue()
The value of the variable this object is operating on evaluated on the "neighbor" element...
virtual const OutputTools< T >::VariableValue & neighborValueOlder()
The older value of the variable this object is operating on evaluated on the "neighbor" element...