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_,
101 const lduMatrix& matrix_,
102 const label blockStart,
104 const FieldField<Field, scalar>& interfaceBouCoeffs_,
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 =
119 matrix_.upper().begin();
120 const scalar*
const __restrict__ lowerPtr =
121 matrix_.lower().begin();
123 const label*
const __restrict__ uPtr =
124 matrix_.lduAddr().upperAddr().begin();
126 const label*
const __restrict__ ownStartPtr =
127 matrix_.lduAddr().ownerStartAddr().begin();
147 matrix_.initMatrixInterfaces
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;
188 matrix_.updateMatrixInterfaces
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;
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
nonBlockingGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
void size(const label n)
Older name for setAddressableSize.
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Variant of gaussSeidelSmoother that expects processor boundary cells to be sorted last and so can blo...
const lduMatrix & matrix() const noexcept
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.
Field< solveScalar > solveScalarField
lduMatrix::smoother::addsymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherSymMatrixConstructorToTable_
static label nRequests() noexcept
Number of outstanding requests.
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Smooth ATC in cells next to a set of patches supplied by type.
A field of fields is a PtrList of fields with reference counting.
void smooth(volScalarField &field, const scalar coeff)
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
#define forAll(list, i)
Loop across all elements in list.
const lduMatrix & matrix_
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
A class for handling words, derived from Foam::string.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
A const Field/List wrapper with possible data conversion.
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
lduMatrix::smoother::addasymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherAsymMatrixConstructorToTable_
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
const lduAddressing & lduAddr() const
Return the LDU addressing.
const volScalarField & psi
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.