38 lduMatrix::preconditioner::
39 addasymMatrixConstructorToTable<DILUPreconditioner>
53 rD_(sol.matrix().
diag().size())
70 solveScalar* __restrict__ rDPtr = rD.
begin();
75 const scalar*
const __restrict__ upperPtr = matrix.
upper().
begin();
76 const scalar*
const __restrict__ lowerPtr = matrix.
lower().
begin();
86 const label nCells = rD.
size();
88 for (label cell=0; cell<nCells; cell++)
102 solveScalar* __restrict__ wAPtr = wA.begin();
103 const solveScalar* __restrict__ rAPtr = rA.begin();
104 const solveScalar* __restrict__ rDPtr = rD_.begin();
106 const label*
const __restrict__ uPtr =
107 solver_.matrix().lduAddr().upperAddr().begin();
108 const label*
const __restrict__ lPtr =
109 solver_.matrix().lduAddr().lowerAddr().begin();
111 const scalar*
const __restrict__ upperPtr =
112 solver_.matrix().upper().begin();
113 const scalar*
const __restrict__ lowerPtr =
114 solver_.matrix().lower().begin();
116 const label nCells = wA.size();
117 const label nFaces = solver_.matrix().upper().
size();
118 const label nFacesM1 = nFaces - 1;
120 for (label cell=0; cell<nCells; cell++)
122 wAPtr[cell] = rDPtr[cell]*rAPtr[cell];
125 for (label face=0; face<nFaces; face++)
128 rDPtr[uPtr[face]]*lowerPtr[face]*wAPtr[lPtr[face]];
131 for (label face=nFacesM1; face>=0; face--)
146 solveScalar* __restrict__ wTPtr = wT.begin();
147 const solveScalar* __restrict__ rTPtr = rT.begin();
148 const solveScalar* __restrict__ rDPtr = rD_.begin();
150 const label*
const __restrict__ uPtr =
151 solver_.matrix().lduAddr().upperAddr().begin();
152 const label*
const __restrict__ lPtr =
153 solver_.matrix().lduAddr().lowerAddr().begin();
154 const label*
const __restrict__ losortPtr =
155 solver_.matrix().lduAddr().losortAddr().begin();
157 const scalar*
const __restrict__ upperPtr =
158 solver_.matrix().upper().begin();
159 const scalar*
const __restrict__ lowerPtr =
160 solver_.matrix().lower().begin();
162 const label nCells = wT.size();
163 const label nFaces = solver_.matrix().upper().size();
164 const label nFacesM1 = nFaces - 1;
166 for (label cell=0; cell<nCells; cell++)
168 wTPtr[cell] = rDPtr[cell]*rTPtr[cell];
171 for (label face=0; face<nFaces; face++)
174 rDPtr[uPtr[face]]*upperPtr[face]*wTPtr[lPtr[face]];
178 for (label face=nFacesM1; face>=0; face--)
180 const label sface = losortPtr[face];
181 wTPtr[lPtr[sface]] -=
182 rDPtr[lPtr[sface]]*lowerPtr[sface]*wTPtr[uPtr[sface]];
const scalarField & diag() const
void size(const label n)
Older name for setAddressableSize.
static void calcReciprocalD(solveScalarField &, const lduMatrix &)
Calculate the reciprocal of the preconditioned diagonal.
A face is a list of labels corresponding to mesh vertices.
lduMatrix::preconditioner::addasymMatrixConstructorToTable< DILUPreconditioner > addDILUPreconditionerAsymMatrixConstructorToTable_
Field< solveScalar > solveScalarField
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const lduMatrix & matrix() const noexcept
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
DILUPreconditioner(const lduMatrix::solver &, const dictionary &solverControlsUnused)
Construct from matrix components and preconditioner solver controls.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
Abstract base-class for lduMatrix solvers.
virtual void preconditionT(solveScalarField &wT, const solveScalarField &rT, const direction cmpt=0) const
Return wT the transpose-matrix preconditioned form of residual rT.
const scalarField & lower() const
iterator begin() noexcept
Return an iterator to begin traversing the UList.
defineTypeNameAndDebug(combustionModel, 0)
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
const scalarField & upper() const
const lduAddressing & lduAddr() const
Return the LDU addressing.
A cell is defined as a list of faces with extra functionality.
Simplified diagonal-based incomplete LU preconditioner for asymmetric matrices. The reciprocal of the...