38 lduMatrix::smoother::addsymMatrixConstructorToTable<symGaussSeidelSmoother>
41 lduMatrix::smoother::addasymMatrixConstructorToTable<symGaussSeidelSmoother>
50 const word& fieldName,
72 const word& fieldName_,
82 solveScalar* __restrict__ psiPtr =
psi.
begin();
84 const label nCells =
psi.
size();
87 solveScalar* __restrict__ bPrimePtr = bPrime.begin();
89 const scalar*
const __restrict__ diagPtr = matrix_.
diag().
begin();
90 const scalar*
const __restrict__ upperPtr =
92 const scalar*
const __restrict__ lowerPtr =
95 const label*
const __restrict__ uPtr =
98 const label*
const __restrict__ ownStartPtr =
143 label fEnd = ownStartPtr[0];
145 for (label celli=0; celli<nCells; celli++)
149 fEnd = ownStartPtr[celli + 1];
152 psii = bPrimePtr[celli];
155 for (label facei=fStart; facei<fEnd; facei++)
157 psii -= upperPtr[facei]*psiPtr[uPtr[facei]];
161 psii /= diagPtr[celli];
164 for (label facei=fStart; facei<fEnd; facei++)
166 bPrimePtr[uPtr[facei]] -= lowerPtr[facei]*psii;
169 psiPtr[celli] = psii;
172 fStart = ownStartPtr[nCells];
174 for (label celli=nCells-1; celli>=0; celli--)
178 fStart = ownStartPtr[celli];
181 psii = bPrimePtr[celli];
184 for (label facei=fStart; facei<fEnd; facei++)
186 psii -= upperPtr[facei]*psiPtr[uPtr[facei]];
193 psii /= diagPtr[celli];
195 psiPtr[celli] = psii;
const scalarField & diag() const
static void smooth(const word &fieldName, solveScalarField &psi, const lduMatrix &matrix, const solveScalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
void size(const label n)
Older name for setAddressableSize.
Field< solveScalar > solveScalarField
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests)
lduMatrix::smoother::addasymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherAsymMatrixConstructorToTable_
A field of fields is a PtrList of fields with reference counting.
void smooth(volScalarField &field, const scalar coeff)
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
A lduMatrix::smoother for symmetric Gauss-Seidel.
A class for handling words, derived from Foam::string.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
void updateMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt, const label startRequest) const
Update interfaced interfaces for matrix operations.
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
Initialise the update of interfaced interfaces for matrix operations.
const scalarField & lower() const
A const Field/List wrapper with possible data conversion.
lduMatrix::smoother::addsymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherSymMatrixConstructorToTable_
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.
const volScalarField & psi
symGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
const labelUList & ownerStartAddr() const
Return owner start addressing.