32template<
class Type,
class DType,
class LUType>
39 LduMatrix<Type, DType, LUType>::preconditioner(sol),
40 rD_(sol.matrix().
diag())
48template<
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();
72 label nCells = rD.
size();
81template<
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;
118 sface = losortPtr[
face];
119 wAPtr[uPtr[sface]] -=
120 dot(rDPtr[uPtr[sface]],
dot(lowerPtr[sface], wAPtr[lPtr[sface]]));
131template<
class Type,
class DType,
class LUType>
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;
174 sface = losortPtr[
face];
175 wTPtr[lPtr[sface]] -=
176 dot(rDPtr[lPtr[sface]],
dot(lowerPtr[sface], wTPtr[uPtr[sface]]));
Generic templated field type.
Abstract base-class for LduMatrix solvers.
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
const lduAddressing & lduAddr() const
Return the LDU addressing.
Field< LUType > & upper()
Field< LUType > & lower()
Simplified diagonal-based incomplete LU preconditioner for asymmetric matrices.
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.
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void size(const label n)
Older name for setAddressableSize.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)