38 lduMatrix::preconditioner::
39 addsymMatrixConstructorToTable<FDICPreconditioner>
46 Foam::FDICPreconditioner::FDICPreconditioner
53 rD_(sol.matrix().
diag().size()),
54 rDuUpper_(sol.matrix().
upper().size()),
55 rDlUpper_(sol.matrix().
upper().size())
60 solveScalar* __restrict__ rDPtr = rD_.
begin();
61 solveScalar* __restrict__ rDuUpperPtr = rDuUpper_.
begin();
62 solveScalar* __restrict__ rDlUpperPtr = rDlUpper_.
begin();
64 const label*
const __restrict__ uPtr =
66 const label*
const __restrict__ lPtr =
68 const scalar*
const __restrict__ upperPtr =
71 const label nCells = rD_.
size();
80 for (label cell=0; cell<nCells; cell++)
82 rDPtr[cell] = 1.0/rDPtr[cell];
85 for (label face=0; face<nFaces; face++)
87 rDuUpperPtr[face] = rDPtr[uPtr[face]]*upperPtr[face];
88 rDlUpperPtr[face] = rDPtr[lPtr[face]]*upperPtr[face];
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 solveScalar*
const __restrict__ rDuUpperPtr = rDuUpper_.begin();
112 const solveScalar*
const __restrict__ rDlUpperPtr = rDlUpper_.begin();
114 const label nCells = wA.size();
115 const label nFaces = solver_.matrix().upper().
size();
116 const label nFacesM1 = nFaces - 1;
118 for (label cell=0; cell<nCells; cell++)
120 wAPtr[cell] = rDPtr[cell]*rAPtr[cell];
123 for (label face=0; face<nFaces; face++)
125 wAPtr[uPtr[face]] -= rDuUpperPtr[face]*wAPtr[lPtr[face]];
128 for (label face=nFacesM1; face>=0; face--)
130 wAPtr[lPtr[face]] -= rDlUpperPtr[face]*wAPtr[uPtr[face]];
const scalarField & diag() const
void size(const label n)
Older name for setAddressableSize.
A face is a list of labels corresponding to mesh vertices.
Field< solveScalar > solveScalarField
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const solver & solver_
Reference to the base-solver this preconditioner is used with.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const lduMatrix & matrix() const noexcept
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
virtual const labelUList & upperAddr() const =0
Return upper addressing.
Abstract base-class for lduMatrix solvers.
Faster version of the DICPreconditioner diagonal-based incomplete Cholesky preconditioner for symmetr...
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
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.
lduMatrix::preconditioner::addsymMatrixConstructorToTable< FDICPreconditioner > addFDICPreconditionerSymMatrixConstructorToTable_