39 lduMatrix::solver::addsymMatrixConstructorToTable<smoothSolver>
42 lduMatrix::solver::addasymMatrixConstructorToTable<smoothSolver>
51 const word& fieldName,
118 solverPerf.nIterations() -= nSweeps_;
122 solveScalar normFactor = 0;
125 ConstPrecisionAdaptor<solveScalar, scalar> tsource(source);
132 matrix_.Amul(Apsi,
psi, interfaceBouCoeffs_, interfaces_, cmpt);
135 normFactor = this->normFactor(
psi, tsource(), Apsi, temp);
137 residual = tsource() - Apsi;
141 ConstPrecisionAdaptor<scalar, solveScalar>(residual)(),
147 solverPerf.initialResidual() =
148 gSumMag(residual, matrix().
mesh().comm())/normFactor;
149 solverPerf.finalResidual() = solverPerf.initialResidual();
155 <<
" Normalisation factor = " << normFactor <<
endl;
163 || !solverPerf.checkConvergence(tolerance_, relTol_, log_)
200 solverPerf.finalResidual() =
201 gSumMag(residual, matrix().
mesh().comm())/normFactor;
205 (solverPerf.nIterations() += nSweeps_) < maxIter_
206 && !solverPerf.checkConvergence(tolerance_, relTol_, log_)
208 || solverPerf.nIterations() < minIter_
214 ConstPrecisionAdaptor<scalar, solveScalar>(residual)(),
virtual void smooth(solveScalarField &psi, const scalarField &source, const direction cmpt, const label nSweeps) const =0
Smooth the solution for a given number of sweeps.
virtual solverPerformance solve(scalarField &psi, const scalarField &source, const direction cmpt=0) const
Solve the matrix with this solver.
void size(const label n)
Older name for setAddressableSize.
Field< solveScalar > solveScalarField
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void setResidualField(const scalarField &residual, const word &fieldName, const bool initial) const
Set the residual field using an IOField on the object registry if it exists.
label nSweeps_
Number of sweeps before the evaluation of residual.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
A non-const Field/List wrapper with possible data conversion.
A field of fields is a PtrList of fields with reference counting.
A class for handling words, derived from Foam::string.
lduMatrix::solver::addsymMatrixConstructorToTable< smoothSolver > addsmoothSolverSymMatrixConstructorToTable_
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
lduMatrix::solver::addasymMatrixConstructorToTable< smoothSolver > addsmoothSolverAsymMatrixConstructorToTable_
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
dictionary controlDict_
Dictionary of solution controls.
smoothSolver(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Construct from matrix components and solver controls.
virtual void readControls()
Read the control parameters from the controlDict_.
OSstream & masterStream(const label communicator)
Return OSstream for output operations on the master process only, Snull on other processes.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
static autoPtr< smoother > New(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Return a new smoother.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
Iterative solver for symmetric and asymmetric matrices which uses a run-time selected smoother e...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
const volScalarField & psi
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
virtual void readControls()
Read the control parameters from controlDict_.