Go to the documentation of this file.
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;
const lduAddressing & lduAddr() const
lduMatrix::smoother::addsymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherSymMatrixConstructorToTable_
A class for handling words, derived from Foam::string.
A field of fields is a PtrList of fields with reference counting.
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
const lduInterfaceFieldPtrsList & interfaces() const noexcept
nonBlockingGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Ostream & endl(Ostream &os)
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
const lduMatrix & matrix_
const labelUList & ownerStartAddr() const
virtual const labelUList & upperAddr() const =0
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
label min(const labelHashSet &set, label minValue=labelMax)
Generic templated field type.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Field< solveScalar > solveScalarField
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
const T * set(const label i) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
virtual const labelUList & patchAddr(const label patchNo) const =0
lduMatrix::smoother::addasymMatrixConstructorToTable< nonBlockingGaussSeidelSmoother > addnonBlockingGaussSeidelSmootherAsymMatrixConstructorToTable_
Variant of gaussSeidelSmoother that expects processor boundary cells to be sorted last and so can blo...
const volScalarField & psi
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)
defineTypeNameAndDebug(combustionModel, 0)
Smooth ATC in cells next to a set of patches supplied by type.
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
const lduMatrix & matrix() const noexcept
void smooth(volScalarField &field, const scalar coeff)