Go to the documentation of this file.
33 template<
class Type,
class DType,
class LUType>
36 const word& fieldName,
45 rD_(matrix.
diag().size())
48 const DType*
const __restrict__ diagPtr =
matrix.
diag().begin();
49 DType* __restrict__ rDPtr = rD_.begin();
51 for (label celli=0; celli<nCells; celli++)
53 rDPtr[celli] =
inv(diagPtr[celli]);
60 template<
class Type,
class DType,
class LUType>
63 const word& fieldName_,
70 Type* __restrict__ psiPtr =
psi.begin();
72 const label nCells =
psi.size();
75 Type* __restrict__ bPrimePtr = bPrime.begin();
77 const DType*
const __restrict__ rDPtr = rD_.begin();
79 const LUType*
const __restrict__ upperPtr =
80 matrix_.
upper().begin();
82 const LUType*
const __restrict__ lowerPtr =
83 matrix_.
lower().begin();
85 const label*
const __restrict__ uPtr =
88 const label*
const __restrict__ ownStartPtr =
119 label fEnd = ownStartPtr[0];
121 for (label celli=0; celli<nCells; celli++)
125 fEnd = ownStartPtr[celli + 1];
128 curPsi = bPrimePtr[celli];
131 for (label curFace=fStart; curFace<fEnd; curFace++)
133 curPsi -=
dot(upperPtr[curFace], psiPtr[uPtr[curFace]]);
137 curPsi =
dot(rDPtr[celli], curPsi);
140 for (label curFace=fStart; curFace<fEnd; curFace++)
142 bPrimePtr[uPtr[curFace]] -=
dot(lowerPtr[curFace], curPsi);
145 psiPtr[celli] = curPsi;
151 template<
class Type,
class DType,
class LUType>
158 smooth(this->fieldName_,
psi, this->matrix_, rD_, nSweeps);
A class for handling words, derived from Foam::string.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
void initMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
TGaussSeidelSmoother(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix)
void updateMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Field< LUType > & upper()
const labelUList & ownerStartAddr() const
virtual const labelUList & upperAddr() const =0
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
iterator begin() noexcept
static void smooth(const word &fieldName, Field< Type > &psi, const LduMatrix< Type, DType, LUType > &matrix, const Field< DType > &rD, const label nSweeps)
const volScalarField & psi
FieldField< Field, LUType > & interfacesUpper()
const lduAddressing & lduAddr() const
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
Field< LUType > & lower()
void smooth(volScalarField &field, const scalar coeff)