https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NeighborMooseVariableInterface.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
12// MOOSE includes
13#include "Assembly.h"
14#include "MooseVariableFE.h"
15#include "MooseTypes.h"
16#include "Problem.h"
17#include "SubProblem.h"
18
19template <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{
29
30template <typename T>
35template <typename T>
36const typename OutputTools<T>::VariableValue &
38{
39 if (this->_nodal)
40 return this->_variable->dofValuesNeighbor();
41 else
42 return this->_variable->slnNeighbor();
43}
44
45template <>
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
55template <typename T>
56const typename OutputTools<T>::VariableValue &
58{
59 if (this->_nodal)
60 return this->_variable->dofValuesOldNeighbor();
61 else
62 return this->_variable->slnOldNeighbor();
63}
65template <>
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
75template <typename T>
76const typename OutputTools<T>::VariableValue &
78{
79 if (this->_nodal)
80 return this->_variable->dofValuesOlderNeighbor();
81 else
82 return this->_variable->slnOlderNeighbor();
83}
84
85template <>
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
95template <typename T>
98{
99 if (this->_nodal)
100 mooseError("Nodal variables do not have gradients");
101
102 return this->_variable->gradSlnNeighbor();
103}
105template <typename T>
108{
109 if (this->_nodal)
110 mooseError("Nodal variables do not have gradients");
112 return this->_variable->gradSlnOldNeighbor();
113}
114
115template <typename T>
119 if (this->_nodal)
120 mooseError("Nodal variables do not have gradients");
121
122 return this->_variable->gradSlnOlderNeighbor();
123}
124
125template <typename T>
126const 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
135template <typename T>
136const 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
145template <typename T>
146const 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
155template <typename T>
158{
159 if (this->_nodal)
160 mooseError("Nodal variables do not have second derivatives");
161
162 return this->_variable->secondPhiFaceNeighbor();
163}
164
165template <typename T>
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
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
Definition MooseTypes.h:365
forward declarations
Definition MooseArray.h:18
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
Interface for objects that need to get values of MooseVariables.
Enhances MooseVariableInterface interface provide values from neighbor elements.
virtual const OutputTools< T >::VariableGradient & neighborGradientOlder()
The older gradient of the variable this object is operating on evaluated on the "neighbor" element.
virtual const OutputTools< T >::VariableSecond & neighborSecondOlder()
The older second derivative of the variable this object is operating on evaluated on the "neighbor" e...
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.
virtual const OutputTools< T >::VariableGradient & neighborGradientOld()
The old gradient of the variable this object is operating on evaluated on the "neighbor" element.
virtual const OutputTools< T >::VariableValue & neighborValueOld()
The old value of the variable this object is operating on evaluated on the "neighbor" element.
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's test 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 >::VariableSecond & neighborSecond()
The second derivative of the variable this object is operating on evaluated on the "neighbor" element...
virtual const OutputTools< T >::VariablePhiSecond & neighborSecondPhi()
The second derivative of the neighbor's shape function.
VarKindType
Framework-wide stuff.
Definition MooseTypes.h:769