32 template<
class Type,
class DType,
class LUType>
39 LduMatrix<Type, DType, LUType>::preconditioner(sol),
40 rD_(sol.matrix().
diag())
48 template<
class Type,
class DType,
class LUType>
55 DType* __restrict__ rDPtr = rD.begin();
60 const LUType*
const __restrict__ upperPtr = matrix.
upper().begin();
61 const LUType*
const __restrict__ lowerPtr = matrix.
lower().begin();
63 label nFaces = matrix.
upper().size();
72 label nCells = rD.size();
74 for (label cell=0; cell<nCells; cell++)
81 template<
class Type,
class DType,
class LUType>
88 Type* __restrict__ wAPtr = wA.begin();
89 const Type* __restrict__ rAPtr = rA.begin();
90 const DType* __restrict__ rDPtr = rD_.begin();
92 const label*
const __restrict__ uPtr =
93 this->solver_.matrix().lduAddr().upperAddr().begin();
94 const label*
const __restrict__ lPtr =
95 this->solver_.matrix().lduAddr().lowerAddr().begin();
96 const label*
const __restrict__ losortPtr =
97 this->solver_.matrix().lduAddr().losortAddr().begin();
99 const LUType*
const __restrict__ upperPtr =
100 this->solver_.matrix().upper().begin();
101 const LUType*
const __restrict__ lowerPtr =
102 this->solver_.matrix().lower().begin();
104 label nCells = wA.size();
105 label nFaces = this->solver_.matrix().upper().size();
106 label nFacesM1 = nFaces - 1;
108 for (label cell=0; cell<nCells; cell++)
110 wAPtr[cell] =
dot(rDPtr[cell], rAPtr[cell]);
116 for (label face=0; face<nFaces; face++)
118 sface = losortPtr[face];
119 wAPtr[uPtr[sface]] -=
120 dot(rDPtr[uPtr[sface]],
dot(lowerPtr[sface], wAPtr[lPtr[sface]]));
123 for (label face=nFacesM1; face>=0; face--)
131 template<
class Type,
class DType,
class LUType>
135 const Field<Type>& rT
138 Type* __restrict__ wTPtr = wT.begin();
139 const Type* __restrict__ rTPtr = rT.begin();
140 const DType* __restrict__ rDPtr = rD_.begin();
142 const label*
const __restrict__ uPtr =
143 this->solver_.matrix().lduAddr().upperAddr().begin();
144 const label*
const __restrict__ lPtr =
145 this->solver_.matrix().lduAddr().lowerAddr().begin();
146 const label*
const __restrict__ losortPtr =
147 this->solver_.matrix().lduAddr().losortAddr().begin();
149 const LUType*
const __restrict__ upperPtr =
150 this->solver_.matrix().upper().begin();
151 const LUType*
const __restrict__ lowerPtr =
152 this->solver_.matrix().lower().begin();
154 label nCells = wT.size();
155 label nFaces = this->solver_.matrix().upper().size();
156 label nFacesM1 = nFaces - 1;
158 for (label cell=0; cell<nCells; cell++)
160 wTPtr[cell] =
dot(rDPtr[cell], rTPtr[cell]);
163 for (label face=0; face<nFaces; face++)
166 dot(rDPtr[uPtr[face]],
dot(upperPtr[face], wTPtr[lPtr[face]]));
172 for (label face=nFacesM1; face>=0; face--)
174 sface = losortPtr[face];
175 wTPtr[lPtr[sface]] -=
176 dot(rDPtr[lPtr[sface]],
dot(lowerPtr[sface], wTPtr[uPtr[sface]]));