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. More...
Public Member Functions | |
TypeName ("smoothSolver") | |
Runtime type information. More... | |
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. More... | |
virtual | ~smoothSolver ()=default |
Destructor. More... | |
virtual solverPerformance | solve (scalarField &psi, const scalarField &source, const direction cmpt=0) const |
Solve the matrix with this solver. More... | |
![]() | |
virtual const word & | type () const =0 |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, solver, symMatrix,(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls),(fieldName, matrix, interfaceBouCoeffs, interfaceIntCoeffs, interfaces, solverControls)) | |
declareRunTimeSelectionTable (autoPtr, solver, asymMatrix,(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls),(fieldName, matrix, interfaceBouCoeffs, interfaceIntCoeffs, interfaces, solverControls)) | |
solver (const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls) | |
virtual | ~solver ()=default |
Destructor. More... | |
const word & | fieldName () const noexcept |
const lduMatrix & | matrix () const noexcept |
const FieldField< Field, scalar > & | interfaceBouCoeffs () const noexcept |
const FieldField< Field, scalar > & | interfaceIntCoeffs () const noexcept |
const lduInterfaceFieldPtrsList & | interfaces () const noexcept |
virtual void | read (const dictionary &) |
Read and reset the solver parameters from the given stream. More... | |
virtual solverPerformance | scalarSolve (solveScalarField &psi, const solveScalarField &source, const direction cmpt=0) const |
Solve with given field and rhs (in solveScalar precision). More... | |
solveScalarField::cmptType | normFactor (const solveScalarField &psi, const solveScalarField &source, const solveScalarField &Apsi, solveScalarField &tmpField) const |
Protected Member Functions | |
virtual void | readControls () |
Read the control parameters from the controlDict_. More... | |
Protected Attributes | |
label | nSweeps_ |
Number of sweeps before the evaluation of residual. More... | |
![]() | |
word | fieldName_ |
const lduMatrix & | matrix_ |
const FieldField< Field, scalar > & | interfaceBouCoeffs_ |
const FieldField< Field, scalar > & | interfaceIntCoeffs_ |
lduInterfaceFieldPtrsList | interfaces_ |
dictionary | controlDict_ |
Dictionary of controls. More... | |
int | log_ |
Level of verbosity in the solver output statements. More... | |
label | minIter_ |
Minimum number of iterations in the solver. More... | |
label | maxIter_ |
Maximum number of iterations in the solver. More... | |
scalar | tolerance_ |
Final convergence tolerance. More... | |
scalar | relTol_ |
Convergence tolerance relative to the initial. More... | |
profilingTrigger | profiling_ |
Additional Inherited Members | |
![]() | |
static autoPtr< solver > | 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 solver. More... | |
![]() | |
static const label | defaultMaxIter_ = 1000 |
Default maximum number of iterations in the 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 59 of file smoothSolver.H.
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.
Definition at line 50 of file smoothSolver.C.
|
virtualdefault |
Destructor.
|
protectedvirtual |
Read the control parameters from the controlDict_.
Reimplemented from lduMatrix::solver.
Definition at line 75 of file smoothSolver.C.
References lduMatrix::solver::controlDict_, dictionary::getOrDefault(), smoothSolver::nSweeps_, and lduMatrix::solver::readControls().
TypeName | ( | "smoothSolver" | ) |
Runtime type information.
|
virtual |
Solve the matrix with this solver.
Implements lduMatrix::solver.
Definition at line 83 of file smoothSolver.C.
References addProfiling, SolverPerformance< Type >::checkConvergence(), Foam::expressions::patchExpr::debug, Foam::endl(), SolverPerformance< Type >::finalResidual(), Foam::gSumMag(), Foam::Info, SolverPerformance< Type >::initialResidual(), messageStream::masterStream(), mesh, lduMatrix::smoother::New(), SolverPerformance< Type >::nIterations(), psi, refPtr< Container< Type > >::ref(), lduMatrix::setResidualField(), lduMatrix::smoother::smooth(), and Foam::solve().
|
protected |
Number of sweeps before the evaluation of residual.
Definition at line 68 of file smoothSolver.H.
Referenced by smoothSolver::readControls().