34 lduMatrix::smoother::addsymMatrixConstructorToTable<symGaussSeidelSmoother>
37 lduMatrix::smoother::addasymMatrixConstructorToTable<symGaussSeidelSmoother>
46 const word& fieldName,
68 const word& fieldName_,
78 scalar* __restrict__ psiPtr =
psi.
begin();
83 scalar* __restrict__ bPrimePtr = bPrime.
begin();
85 const scalar*
const __restrict__ diagPtr = matrix_.
diag().
begin();
86 const scalar*
const __restrict__ upperPtr =
88 const scalar*
const __restrict__ lowerPtr =
91 const label*
const __restrict__ uPtr =
94 const label*
const __restrict__ ownStartPtr =
149 label fEnd = ownStartPtr[0];
151 for (
label celli=0; celli<nCells; celli++)
155 fEnd = ownStartPtr[celli + 1];
158 psii = bPrimePtr[celli];
161 for (
label facei=fStart; facei<fEnd; facei++)
163 psii -= upperPtr[facei]*psiPtr[uPtr[facei]];
167 psii /= diagPtr[celli];
170 for (
label facei=fStart; facei<fEnd; facei++)
172 bPrimePtr[uPtr[facei]] -= lowerPtr[facei]*psii;
175 psiPtr[celli] = psii;
178 fStart = ownStartPtr[nCells];
180 for (
label celli=nCells-1; celli>=0; celli--)
184 fStart = ownStartPtr[celli];
187 psii = bPrimePtr[celli];
190 for (
label facei=fStart; facei<fEnd; facei++)
192 psii -= upperPtr[facei]*psiPtr[uPtr[facei]];
196 psii /= diagPtr[celli];
199 for (
label facei=fStart; facei<fEnd; facei++)
201 bPrimePtr[uPtr[facei]] -= lowerPtr[facei]*psii;
204 psiPtr[celli] = psii;
#define forAll(list, i)
Loop across all elements in list.
void negate()
Negate this field.
void size(const label)
Override size to be inconsistent with allocated storage.
iterator begin()
Return an iterator to begin traversing the UList.
bool set(const label) const
Is element set.
const labelUList & ownerStartAddr() const
Return owner start addressing.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
const lduAddressing & lduAddr() const
Return the LDU addressing.
void initMatrixInterfaces(const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const scalarField &psiif, scalarField &result, const direction cmpt) const
Initialise the update of interfaced interfaces.
void updateMatrixInterfaces(const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const scalarField &psiif, scalarField &result, const direction cmpt) const
Update interfaced interfaces for matrix operations.
A lduMatrix::smoother for symmetric Gauss-Seidel.
static void smooth(const word &fieldName, scalarField &psi, const lduMatrix &matrix, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
symGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
A class for handling words, derived from string.
const volScalarField & psi
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
void smooth(volScalarField &field, const scalar coeff)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
lduMatrix::smoother::addasymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherAsymMatrixConstructorToTable_
defineTypeNameAndDebug(combustionModel, 0)
lduMatrix::smoother::addsymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherSymMatrixConstructorToTable_