30 template<
class Type,
class DType,
class LUType>
37 LduMatrix<Type, DType, LUType>::preconditioner(sol),
38 rD_(sol.matrix().
diag())
46 template<
class Type,
class DType,
class LUType>
53 DType* __restrict__ rDPtr = rD.
begin();
58 const LUType*
const __restrict__ upperPtr = matrix.
upper().
begin();
59 const LUType*
const __restrict__ lowerPtr = matrix.
lower().
begin();
79 template<
class Type,
class DType,
class LUType>
86 Type* __restrict__ wAPtr = wA.
begin();
87 const Type* __restrict__ rAPtr = rA.
begin();
88 const DType* __restrict__ rDPtr = rD_.begin();
90 const label*
const __restrict__ uPtr =
91 this->solver_.matrix().lduAddr().upperAddr().begin();
92 const label*
const __restrict__ lPtr =
93 this->solver_.matrix().lduAddr().lowerAddr().begin();
94 const label*
const __restrict__ losortPtr =
95 this->solver_.matrix().lduAddr().losortAddr().begin();
97 const LUType*
const __restrict__ upperPtr =
98 this->solver_.matrix().upper().begin();
99 const LUType*
const __restrict__ lowerPtr =
100 this->solver_.matrix().lower().begin();
103 label nFaces = this->solver_.matrix().upper().size();
104 label nFacesM1 = nFaces - 1;
116 sface = losortPtr[
face];
117 wAPtr[uPtr[sface]] -=
118 dot(rDPtr[uPtr[sface]],
dot(lowerPtr[sface], wAPtr[lPtr[sface]]));
129 template<
class Type,
class DType,
class LUType>
136 Type* __restrict__ wTPtr = wT.
begin();
137 const Type* __restrict__ rTPtr = rT.
begin();
138 const DType* __restrict__ rDPtr = rD_.begin();
140 const label*
const __restrict__ uPtr =
141 this->solver_.matrix().lduAddr().upperAddr().begin();
142 const label*
const __restrict__ lPtr =
143 this->solver_.matrix().lduAddr().lowerAddr().begin();
144 const label*
const __restrict__ losortPtr =
145 this->solver_.matrix().lduAddr().losortAddr().begin();
147 const LUType*
const __restrict__ upperPtr =
148 this->solver_.matrix().upper().begin();
149 const LUType*
const __restrict__ lowerPtr =
150 this->solver_.matrix().lower().begin();
153 label nFaces = this->solver_.matrix().upper().size();
154 label nFacesM1 = nFaces - 1;
172 sface = losortPtr[
face];
173 wTPtr[lPtr[sface]] -=
174 dot(rDPtr[lPtr[sface]],
dot(lowerPtr[sface], wTPtr[uPtr[sface]]));
Abstract base-class for LduMatrix solvers.
const LduMatrix< Type, DType, LUType > & matrix() const
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Field< LUType > & upper()
const lduAddressing & lduAddr() const
Return the LDU addressing.
Field< LUType > & lower()
void size(const label)
Override size to be inconsistent with allocated storage.
static void calcInvD(Field< DType > &rD, const LduMatrix< Type, DType, LUType > &matrix)
Calculate the reciprocal of the preconditioned diagonal.
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const
Return wA the preconditioned form of residual rA.
TDILUPreconditioner(const typename LduMatrix< Type, DType, LUType >::solver &sol, const dictionary &preconditionerDict)
Construct from matrix components and preconditioner data dictionary.
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
iterator begin()
Return an iterator to begin traversing the UList.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A face is a list of labels corresponding to mesh vertices.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)