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();
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];
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];
180 const label sface = losortPtr[
face];
181 wTPtr[lPtr[sface]] -=
182 rDPtr[lPtr[sface]]*lowerPtr[sface]*wTPtr[uPtr[sface]];
Simplified diagonal-based incomplete LU preconditioner for asymmetric matrices. The reciprocal of the...
virtual void preconditionT(solveScalarField &wT, const solveScalarField &rT, const direction cmpt=0) const
Return wT the transpose-matrix preconditioned form of residual rT.
DILUPreconditioner(const lduMatrix::solver &, const dictionary &solverControlsUnused)
Construct from matrix components and preconditioner solver controls.
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
static void calcReciprocalD(solveScalarField &, const lduMatrix &)
Calculate the reciprocal of the preconditioned diagonal.
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 solver & solver_
Reference to the base-solver this preconditioner is used with.
preconditioner(const solver &sol)
Construct for given solver.
Abstract base-class for lduMatrix solvers.
const lduMatrix & 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.
const scalarField & upper() const
const scalarField & lower() const
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< solveScalar > solveScalarField
lduMatrix::preconditioner::addasymMatrixConstructorToTable< DILUPreconditioner > addDILUPreconditionerAsymMatrixConstructorToTable_
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)