Go to the documentation of this file.
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 =
91 matrix_.
upper().begin();
92 const scalar*
const __restrict__ lowerPtr =
93 matrix_.
lower().begin();
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]];
190 psii /= diagPtr[celli];
193 for (label facei=fStart; facei<fEnd; facei++)
195 bPrimePtr[uPtr[facei]] -= lowerPtr[facei]*psii;
198 psiPtr[celli] = psii;
const lduAddressing & lduAddr() const
A class for handling words, derived from Foam::string.
A field of fields is a PtrList of fields with reference counting.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
A lduMatrix::smoother for symmetric Gauss-Seidel.
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
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
const labelUList & ownerStartAddr() const
virtual const labelUList & upperAddr() const =0
Generic templated field type.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Field< solveScalar > solveScalarField
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) 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)
iterator begin() noexcept
symGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
lduMatrix::smoother::addasymMatrixConstructorToTable< symGaussSeidelSmoother > addsymGaussSeidelSmootherAsymMatrixConstructorToTable_
const volScalarField & psi
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)