39 addsymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
43 addasymMatrixConstructorToTable<nonBlockingGaussSeidelSmoother>
52 const word& fieldName,
89 Pout<<
"nonBlockingGaussSeidelSmoother :"
90 <<
" Starting block on cell " << blockStart_
91 <<
" out of " << nCells <<
endl;
100 const word& fieldName_,
102 const lduMatrix& matrix_,
103 const label blockStart,
105 const FieldField<Field, scalar>& interfaceBouCoeffs_,
111 solveScalar* __restrict__ psiPtr =
psi.begin();
113 const label nCells =
psi.size();
116 solveScalar* __restrict__ bPrimePtr = bPrime.begin();
118 const scalar*
const __restrict__ diagPtr = matrix_.diag().begin();
119 const scalar*
const __restrict__ upperPtr =
120 matrix_.upper().begin();
121 const scalar*
const __restrict__ lowerPtr =
122 matrix_.lower().begin();
124 const label*
const __restrict__ uPtr =
125 matrix_.lduAddr().upperAddr().begin();
127 const label*
const __restrict__ ownStartPtr =
128 matrix_.lduAddr().ownerStartAddr().begin();
142 for (label sweep=0; sweep<nSweeps; sweep++)
148 matrix_.initMatrixInterfaces
160 label fEnd = ownStartPtr[0];
162 for (label celli=0; celli<blockStart; celli++)
166 fEnd = ownStartPtr[celli + 1];
169 curPsi = bPrimePtr[celli];
172 for (label curFace=fStart; curFace<fEnd; curFace++)
174 curPsi -= upperPtr[curFace]*psiPtr[uPtr[curFace]];
178 curPsi /= diagPtr[celli];
181 for (label curFace=fStart; curFace<fEnd; curFace++)
183 bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
186 psiPtr[celli] = curPsi;
189 matrix_.updateMatrixInterfaces
201 for (label celli=blockStart; celli < nCells; celli++)
205 fEnd = ownStartPtr[celli + 1];
208 curPsi = bPrimePtr[celli];
211 for (label curFace=fStart; curFace<fEnd; curFace++)
213 curPsi -= upperPtr[curFace]*psiPtr[uPtr[curFace]];
217 curPsi /= diagPtr[celli];
220 for (label curFace=fStart; curFace<fEnd; curFace++)
222 bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
225 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.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
label size() const noexcept
The number of entries in the list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Smooth ATC in cells next to a set of patches supplied by type.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
const lduMatrix & matrix_
const lduInterfaceFieldPtrsList & interfaces_
smoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct for given field name, matrix etc.
const lduInterfaceFieldPtrsList & interfaces() const noexcept
const FieldField< Field, scalar > & interfaceBouCoeffs_
const lduMatrix & matrix() const noexcept
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
const word & fieldName() 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.
const scalarField & diag() const
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, const dictionary &solverControls)
Construct from components.
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
Namespace for handling debugging switches.
void smooth(volScalarField &field, const scalar coeff)
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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_
Field< solveScalar > solveScalarField
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
UList< label > labelUList
A UList of labels.
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
lduMatrix::smoother::addsymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherSymMatrixConstructorToTable_
#define forAll(list, i)
Loop across all elements in list.