Line data Source code
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 : #include "NeighborMooseVariableInterface.h" 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> 20 8519 : NeighborMooseVariableInterface<T>::NeighborMooseVariableInterface( 21 : const MooseObject * moose_object, 22 : bool nodal, 23 : Moose::VarKindType expected_var_type, 24 : Moose::VarFieldType expected_var_field_type) 25 : : MooseVariableInterface<T>( 26 8519 : moose_object, nodal, "variable", expected_var_type, expected_var_field_type) 27 : { 28 8519 : } 29 : 30 : template <typename T> 31 8235 : NeighborMooseVariableInterface<T>::~NeighborMooseVariableInterface() 32 : { 33 8235 : } 34 : 35 : template <typename T> 36 : const typename OutputTools<T>::VariableValue & 37 0 : NeighborMooseVariableInterface<T>::neighborValue() 38 : { 39 0 : if (this->_nodal) 40 0 : return this->_variable->dofValuesNeighbor(); 41 : else 42 0 : return this->_variable->slnNeighbor(); 43 : } 44 : 45 : template <> 46 : const VectorVariableValue & 47 0 : NeighborMooseVariableInterface<RealVectorValue>::neighborValue() 48 : { 49 0 : if (this->_nodal) 50 0 : mooseError("Dofs are scalars while vector variables have vector values. Mismatch"); 51 : else 52 0 : return this->_variable->slnNeighbor(); 53 : } 54 : 55 : template <typename T> 56 : const typename OutputTools<T>::VariableValue & 57 0 : NeighborMooseVariableInterface<T>::neighborValueOld() 58 : { 59 0 : if (this->_nodal) 60 0 : return this->_variable->dofValuesOldNeighbor(); 61 : else 62 0 : return this->_variable->slnOldNeighbor(); 63 : } 64 : 65 : template <> 66 : const VectorVariableValue & 67 0 : NeighborMooseVariableInterface<RealVectorValue>::neighborValueOld() 68 : { 69 0 : if (this->_nodal) 70 0 : mooseError("Dofs are scalars while vector variables have vector values. Mismatch"); 71 : else 72 0 : return this->_variable->slnOldNeighbor(); 73 : } 74 : 75 : template <typename T> 76 : const typename OutputTools<T>::VariableValue & 77 0 : NeighborMooseVariableInterface<T>::neighborValueOlder() 78 : { 79 0 : if (this->_nodal) 80 0 : return this->_variable->dofValuesOlderNeighbor(); 81 : else 82 0 : return this->_variable->slnOlderNeighbor(); 83 : } 84 : 85 : template <> 86 : const VectorVariableValue & 87 0 : NeighborMooseVariableInterface<RealVectorValue>::neighborValueOlder() 88 : { 89 0 : if (this->_nodal) 90 0 : mooseError("Dofs are scalars while vector variables have vector values. Mismatch"); 91 : else 92 0 : return this->_variable->slnOlderNeighbor(); 93 : } 94 : 95 : template <typename T> 96 : const typename OutputTools<T>::VariableGradient & 97 0 : NeighborMooseVariableInterface<T>::neighborGradient() 98 : { 99 0 : if (this->_nodal) 100 0 : mooseError("Nodal variables do not have gradients"); 101 : 102 0 : return this->_variable->gradSlnNeighbor(); 103 : } 104 : 105 : template <typename T> 106 : const typename OutputTools<T>::VariableGradient & 107 0 : NeighborMooseVariableInterface<T>::neighborGradientOld() 108 : { 109 0 : if (this->_nodal) 110 0 : mooseError("Nodal variables do not have gradients"); 111 : 112 0 : return this->_variable->gradSlnOldNeighbor(); 113 : } 114 : 115 : template <typename T> 116 : const typename OutputTools<T>::VariableGradient & 117 0 : NeighborMooseVariableInterface<T>::neighborGradientOlder() 118 : { 119 0 : if (this->_nodal) 120 0 : mooseError("Nodal variables do not have gradients"); 121 : 122 0 : return this->_variable->gradSlnOlderNeighbor(); 123 : } 124 : 125 : template <typename T> 126 : const typename OutputTools<T>::VariableSecond & 127 39 : NeighborMooseVariableInterface<T>::neighborSecond() 128 : { 129 39 : if (this->_nodal) 130 0 : mooseError("Nodal variables do not have second derivatives"); 131 : 132 39 : return this->_variable->secondSlnNeighbor(); 133 : } 134 : 135 : template <typename T> 136 : const typename OutputTools<T>::VariableSecond & 137 0 : NeighborMooseVariableInterface<T>::neighborSecondOld() 138 : { 139 0 : if (this->_nodal) 140 0 : mooseError("Nodal variables do not have second derivatives"); 141 : 142 0 : return this->_variable->secondSlnOldNeighbor(); 143 : } 144 : 145 : template <typename T> 146 : const typename OutputTools<T>::VariableSecond & 147 0 : NeighborMooseVariableInterface<T>::neighborSecondOlder() 148 : { 149 0 : if (this->_nodal) 150 0 : mooseError("Nodal variables do not have second derivatives"); 151 : 152 0 : return this->_variable->secondSlnOlderNeighbor(); 153 : } 154 : 155 : template <typename T> 156 : const typename OutputTools<T>::VariableTestSecond & 157 0 : NeighborMooseVariableInterface<T>::neighborSecondTest() 158 : { 159 0 : if (this->_nodal) 160 0 : mooseError("Nodal variables do not have second derivatives"); 161 : 162 0 : return this->_variable->secondPhiFaceNeighbor(); 163 : } 164 : 165 : template <typename T> 166 : const typename OutputTools<T>::VariablePhiSecond & 167 0 : NeighborMooseVariableInterface<T>::neighborSecondPhi() 168 : { 169 0 : if (this->_nodal) 170 0 : mooseError("Nodal variables do not have second derivatives"); 171 : 172 0 : return this->_mvi_assembly->secondPhiFaceNeighbor(*this->_variable); 173 : } 174 : 175 : template class NeighborMooseVariableInterface<Real>; 176 : template class NeighborMooseVariableInterface<RealVectorValue>; 177 : template class NeighborMooseVariableInterface<RealEigenVector>;