Go to the documentation of this file.
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 =
87 matrix_.
upper().begin();
88 const scalar*
const __restrict__ lowerPtr =
89 matrix_.
lower().begin();
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;
const lduAddressing & lduAddr() const
Return the LDU addressing.
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
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.
const labelUList & ownerStartAddr() const
Return owner start addressing.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
iterator begin()
Return an iterator to begin traversing the UList.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
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.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Abstract base-class for lduMatrix smoothers.
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.
const volScalarField & psi
void negate()
Negate this field.
bool set(const label) const
Is element set.
symGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
lduMatrix::smoother::addasymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherAsymMatrixConstructorToTable_
defineTypeNameAndDebug(combustionModel, 0)
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
lduMatrix::smoother::addsymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherSymMatrixConstructorToTable_
void smooth(volScalarField &field, const scalar coeff)