38 lduMatrix::smoother::addsymMatrixConstructorToTable<GaussSeidelSmoother>
41 lduMatrix::smoother::addasymMatrixConstructorToTable<GaussSeidelSmoother>
50 const word& fieldName,
73 const word& fieldName_,
83 solveScalar* __restrict__ psiPtr =
psi.begin();
85 const label nCells =
psi.size();
90 solveScalar* __restrict__ bPrimePtr = bPrime.
begin();
92 const scalar*
const __restrict__ diagPtr = matrix_.
diag().
begin();
93 const scalar*
const __restrict__ upperPtr =
95 const scalar*
const __restrict__ lowerPtr =
98 const label*
const __restrict__ uPtr =
101 const label*
const __restrict__ ownStartPtr =
117 for (label sweep=0; sweep<nSweeps; sweep++)
146 label fEnd = ownStartPtr[0];
148 for (label celli=0; celli<nCells; celli++)
152 fEnd = ownStartPtr[celli + 1];
155 psii = bPrimePtr[celli];
158 for (label facei=fStart; facei<fEnd; facei++)
160 psii -= upperPtr[facei]*psiPtr[uPtr[facei]];
164 psii /= diagPtr[celli];
167 for (label facei=fStart; facei<fEnd; facei++)
169 bPrimePtr[uPtr[facei]] -= lowerPtr[facei]*psii;
172 psiPtr[celli] = psii;
A const Field/List wrapper with possible data conversion.
A field of fields is a PtrList of fields with reference counting.
A lduMatrix::smoother for Gauss-Seidel.
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.
GaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Construct from components.
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const labelUList & ownerStartAddr() const
Return owner start addressing.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
const lduMatrix & matrix_
const lduInterfaceFieldPtrsList & interfaces_
smoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct for given field name, matrix etc.
const lduInterfaceFieldPtrsList & interfaces() const noexcept
const FieldField< Field, scalar > & interfaceBouCoeffs_
const lduMatrix & matrix() const noexcept
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
const word & fieldName() const noexcept
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
const lduAddressing & lduAddr() const
Return the LDU addressing.
const scalarField & diag() const
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 & upper() const
const scalarField & lower() const
const solveScalarField & work() const
Work array.
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.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & psi
void smooth(volScalarField &field, const scalar coeff)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
lduMatrix::smoother::addasymMatrixConstructorToTable< GaussSeidelSmoother > addGaussSeidelSmootherAsymMatrixConstructorToTable_
Field< solveScalar > solveScalarField
lduMatrix::smoother::addsymMatrixConstructorToTable< GaussSeidelSmoother > addGaussSeidelSmootherSymMatrixConstructorToTable_
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.