35 addsymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
39 addasymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
48 const word& fieldName,
78 blockStart_ =
min(blockStart_,
min(faceCells));
84 Pout<<
"nonBlockingGaussSeidelSmoother :"
85 <<
" Starting block on cell " << blockStart_
86 <<
" out of " << nCells <<
endl;
95 const word& fieldName_,
98 const label blockStart,
106 scalar* __restrict__ psiPtr =
psi.
begin();
111 scalar* __restrict__ bPrimePtr = bPrime.
begin();
113 const scalar*
const __restrict__ diagPtr = matrix_.
diag().
begin();
114 const scalar*
const __restrict__ upperPtr =
116 const scalar*
const __restrict__ lowerPtr =
119 const label*
const __restrict__ uPtr =
122 const label*
const __restrict__ ownStartPtr =
165 label fEnd = ownStartPtr[0];
167 for (
label celli=0; celli<blockStart; celli++)
171 fEnd = ownStartPtr[celli + 1];
174 curPsi = bPrimePtr[celli];
177 for (
label curFace=fStart; curFace<fEnd; curFace++)
179 curPsi -= upperPtr[curFace]*psiPtr[uPtr[curFace]];
183 curPsi /= diagPtr[celli];
186 for (
label curFace=fStart; curFace<fEnd; curFace++)
188 bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
191 psiPtr[celli] = curPsi;
204 for (
label celli=blockStart; celli < nCells; celli++)
208 fEnd = ownStartPtr[celli + 1];
211 curPsi = bPrimePtr[celli];
214 for (
label curFace=fStart; curFace<fEnd; curFace++)
216 curPsi -= upperPtr[curFace]*psiPtr[uPtr[curFace]];
220 curPsi /= diagPtr[celli];
223 for (
label curFace=fStart; curFace<fEnd; curFace++)
225 bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
228 psiPtr[celli] = curPsi;
#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.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
const lduMatrix & matrix_
const lduInterfaceFieldPtrsList & interfaces() const
const lduMatrix & matrix() const
const FieldField< Field, scalar > & interfaceBouCoeffs() const
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.
Variant of gaussSeidelSmoother that expects processor boundary cells to be sorted last and so can blo...
nonBlockingGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
static void smooth(const word &fieldName, scalarField &psi, const lduMatrix &matrix, const label blockStart, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
defineTypeNameAndDebug(combustionModel, 0)
lduMatrix::smoother::addasymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherAsymMatrixConstructorToTable_
prefixOSstream Pout(cout, "Pout")
lduMatrix::smoother::addsymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherSymMatrixConstructorToTable_