33template<
class Type,
class DType,
class LUType>
55template<
class Type,
class DType,
class LUType>
63template<
class Type,
class DType,
class LUType>
87 smootherPtr->smooth(
psi, -nSweeps_);
93 Type normFactor =
Zero;
96 Field<Type> Apsi(
psi.size());
97 Field<Type> temp(
psi.size());
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
158 (nIter += nSweeps_) < this->maxIter_
159 && !solverPerf.checkConvergence
166 || nIter < this->minIter_
171 solverPerf.nIterations() =
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
static autoPtr< smoother > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &smootherDict)
Return a new smoother.
label maxIter_
Maximum number of iterations in the solver.
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Construct for given field name, matrix and controls.
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
Type normFactor(const Field< Type > &psi, const Field< Type > &Apsi, Field< Type > &tmpField, const lduMatrix::normTypes normType) const
Return the matrix norm using the specified norm method.
label minIter_
Minimum number of iterations in the solver.
int log_
Verbosity level for solver output statements.
virtual void readControls()
Read the control parameters from controlDict_.
const LduMatrix< Type, DType, LUType > & matrix_
dictionary controlDict_
Dictionary of solution controls.
const word & fieldName() const noexcept
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
SmoothSolver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Construct from matrix components and solver data dictionary.
label nSweeps_
Number of sweeps before the evaluation of residual.
virtual void readControls()
Read the control parameters from the controlDict_.
virtual SolverPerformance< Type > solve(Field< Type > &psi) const
Solve the matrix with this solver.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A traits class, which is primarily used for primitives and vector-space.
A class for handling words, derived from Foam::string.
const volScalarField & psi
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
messageStream Info
Information stream (stdout output on master, null elsewhere).
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
Type gSumCmptMag(const UList< Type > &f, const label comm)