Iterative solver for symmetric and asymmetric matrices which uses a run-time selected smoother e.g. GaussSeidel to converge the solution to the required tolerance. To improve efficiency, the residual is evaluated after every nSweeps smoothing iterations. More...
Public Member Functions | |
TypeName ("SmoothSolver") | |
Runtime type information. More... | |
SmoothSolver (const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict) | |
Construct from matrix components and solver data dictionary. More... | |
virtual SolverPerformance< Type > | solve (Field< Type > &psi) const |
Solve the matrix with this solver. More... | |
Public Member Functions inherited from LduMatrix< Type, DType, LUType >::solver | |
virtual const word & | type () const =0 |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, solver, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict)) | |
declareRunTimeSelectionTable (autoPtr, solver, asymMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict)) | |
solver (const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict) | |
Construct for given field name, matrix and controls. More... | |
virtual | ~solver ()=default |
Destructor. More... | |
const word & | fieldName () const noexcept |
const LduMatrix< Type, DType, LUType > & | matrix () const noexcept |
virtual void | read (const dictionary &) |
Read and reset the solver parameters from the given dictionary. More... | |
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. More... | |
Type | normFactor (const Field< Type > &psi, const Field< Type > &Apsi, Field< Type > &tmpField) const |
Return the matrix norm used to normalise the residual for the stopping criterion. More... | |
Protected Member Functions | |
virtual void | readControls () |
Read the control parameters from the controlDict_. More... | |
Protected Member Functions inherited from LduMatrix< Type, DType, LUType >::solver | |
template<class T > | |
void | readControl (const dictionary &dict, T &val, const word &key) |
Deprecated(2021-09) Read control parameter from dictionary. More... | |
Protected Attributes | |
label | nSweeps_ |
Number of sweeps before the evaluation of residual. More... | |
Protected Attributes inherited from LduMatrix< Type, DType, LUType >::solver | |
word | fieldName_ |
const LduMatrix< Type, DType, LUType > & | matrix_ |
dictionary | controlDict_ |
Dictionary of solution controls. More... | |
int | log_ |
Verbosity level for solver output statements. More... | |
label | minIter_ |
Minimum number of iterations in the solver. More... | |
label | maxIter_ |
Maximum number of iterations in the solver. More... | |
lduMatrix::normTypes | normType_ |
The matrix normalisation type. More... | |
Type | tolerance_ |
Final convergence tolerance. More... | |
Type | relTol_ |
Convergence tolerance relative to the initial. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from LduMatrix< Type, DType, LUType >::solver | |
static autoPtr< solver > | New (const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict) |
Return a new solver. More... | |
Iterative solver for symmetric and asymmetric matrices which uses a run-time selected smoother e.g. GaussSeidel to converge the solution to the required tolerance. To improve efficiency, the residual is evaluated after every nSweeps smoothing iterations.
Definition at line 50 of file SmoothSolver.H.
SmoothSolver | ( | const word & | fieldName, |
const LduMatrix< Type, DType, LUType > & | matrix, | ||
const dictionary & | solverDict | ||
) |
Construct from matrix components and solver data dictionary.
Definition at line 28 of file SmoothSolver.C.
|
protectedvirtual |
Read the control parameters from the controlDict_.
Reimplemented from LduMatrix< Type, DType, LUType >::solver.
Definition at line 49 of file SmoothSolver.C.
TypeName | ( | "SmoothSolver< Type, DType, LUType >" | ) |
Runtime type information.
|
virtual |
Solve the matrix with this solver.
Implements LduMatrix< Type, DType, LUType >::solver.
Definition at line 58 of file SmoothSolver.C.
References SolverPerformance< Type >::checkConvergence(), Foam::cmptDivide(), Foam::endl(), SolverPerformance< Type >::finalResidual(), Foam::gSumCmptMag(), Foam::Info, SolverPerformance< Type >::initialResidual(), Foam::New(), SolverPerformance< Type >::nIterations(), psi, and Foam::Zero.
|
protected |
Number of sweeps before the evaluation of residual.
Definition at line 61 of file SmoothSolver.H.