33 template<
class Type,
class DType,
class LUType>
36 const word& fieldName,
55 template<
class Type,
class DType,
class LUType>
59 this->controlDict_.readIfPresent(
"nSweeps", nSweeps_);
63 template<
class Type,
class DType,
class LUType>
87 smootherPtr->smooth(
psi, -nSweeps_);
93 Type normFactor =
Zero;
100 this->matrix_.Amul(Apsi,
psi);
103 normFactor = this->normFactor(
psi, Apsi, temp);
111 solverPerf.finalResidual() = solverPerf.initialResidual();
116 Info<<
" Normalisation factor = " << normFactor <<
endl;
124 || !solverPerf.checkConvergence
132 autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
158 (nIter += nSweeps_) < this->maxIter_
159 && !solverPerf.checkConvergence
166 || nIter < this->minIter_
171 solverPerf.nIterations() =
172 pTraits<typename pTraits<Type>::labelType>::one*nIter;
void size(const label n)
Older name for setAddressableSize.
Base class for solution control classes.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual SolverPerformance< Type > solve(Field< Type > &psi) const
Solve the matrix with this solver.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static autoPtr< smoother > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &smootherDict)
Return a new smoother.
Type gSumCmptMag(const UList< Type > &f, const label comm)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Generic templated field type.
A class for handling words, derived from Foam::string.
virtual void readControls()
Read the control parameters from the controlDict_.
SmoothSolver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Construct from matrix components and solver data dictionary.
int debug
Static debugging option.
LduMatrix is a general matrix class in which the coefficients are stored as three arrays...
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
const volScalarField & psi
virtual void readControls()
Read the control parameters from controlDict_.
static constexpr const zero Zero
Global zero (0)