39 addsymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
43 addasymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
52 const word& fieldName,
88 Pout<<
"nonBlockingGaussSeidelSmoother :"
89 <<
" Starting block on cell " << blockStart_
90 <<
" out of " << nCells <<
endl;
99 const word& fieldName_,
102 const label blockStart,
110 solveScalar* __restrict__ psiPtr =
psi.
begin();
112 const label nCells =
psi.
size();
115 solveScalar* __restrict__ bPrimePtr = bPrime.
begin();
117 const scalar*
const __restrict__ diagPtr = matrix_.
diag().
begin();
118 const scalar*
const __restrict__ upperPtr =
120 const scalar*
const __restrict__ lowerPtr =
123 const label*
const __restrict__ uPtr =
126 const label*
const __restrict__ ownStartPtr =
141 for (label sweep=0; sweep<nSweeps; sweep++)
159 label fEnd = ownStartPtr[0];
161 for (label celli=0; celli<blockStart; celli++)
165 fEnd = ownStartPtr[celli + 1];
168 curPsi = bPrimePtr[celli];
171 for (label curFace=fStart; curFace<fEnd; curFace++)
173 curPsi -= upperPtr[curFace]*psiPtr[uPtr[curFace]];
177 curPsi /= diagPtr[celli];
180 for (label curFace=fStart; curFace<fEnd; curFace++)
182 bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
185 psiPtr[celli] = curPsi;
200 for (label celli=blockStart; celli < nCells; celli++)
204 fEnd = ownStartPtr[celli + 1];
207 curPsi = bPrimePtr[celli];
210 for (label curFace=fStart; curFace<fEnd; curFace++)
212 curPsi -= upperPtr[curFace]*psiPtr[uPtr[curFace]];
216 curPsi /= diagPtr[celli];
219 for (label curFace=fStart; curFace<fEnd; curFace++)
221 bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
224 psiPtr[celli] = curPsi;
A const Field/List wrapper with possible data conversion.
A field of fields is a PtrList of fields with reference counting.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void size(const label n)
Older name for setAddressableSize.
static label nRequests()
Get number of outstanding requests.
const T * set(const label i) const
label size() const noexcept
The number of elements in the list.
Smooth ATC in cells next to a set of patches supplied by type.
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 noexcept
const lduMatrix & matrix() const noexcept
const FieldField< Field, scalar > & interfaceBouCoeffs() 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.
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
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.
Variant of gaussSeidelSmoother that expects processor boundary cells to be sorted last and so can blo...
static void smooth(const word &fieldName, solveScalarField &psi, const lduMatrix &matrix, const label blockStart, const solveScalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & psi
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
lduMatrix::smoother::addasymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherAsymMatrixConstructorToTable_
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
lduMatrix::smoother::addsymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherSymMatrixConstructorToTable_
#define forAll(list, i)
Loop across all elements in list.