Go to the documentation of this file.
35 addsymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
39 addasymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
48 const word& fieldName,
67 const label nCells = matrix.
diag().size();
71 labelList startCellI(interfaceBouCoeffs.size(), -1);
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 =
115 matrix_.
upper().begin();
116 const scalar*
const __restrict__ lowerPtr =
117 matrix_.
lower().begin();
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;
const lduAddressing & lduAddr() const
Return the LDU addressing.
lduMatrix::smoother::addsymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherSymMatrixConstructorToTable_
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,...
nonBlockingGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
const volScalarField & psi
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void negate()
Negate this field.
bool set(const label) const
Is element set.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
lduMatrix::smoother::addasymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherAsymMatrixConstructorToTable_
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
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.
void smooth(volScalarField &field, const scalar coeff)