Preconditioned conjugate gradient solver for symmetric lduMatrices using a run-time selectable preconditioner. More...
#include <PCG.H>


Public Member Functions | |
| TypeName ("PCG") | |
| Runtime type information. | |
| PCG (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 | ~PCG ()=default |
| Destructor. | |
| virtual solverPerformance | scalarSolve (solveScalarField &psi, const solveScalarField &source, const direction cmpt=0) const |
| Solve the matrix with this solver. | |
| virtual solverPerformance | solve (scalarField &psi, const scalarField &source, const direction cmpt=0) const |
| Solve the matrix with this solver. | |
| Public Member Functions inherited from lduMatrix::solver | |
| virtual const word & | type () const =0 |
| Runtime type information. | |
| 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) | |
| Construct solver for given field name, matrix etc. | |
| virtual | ~solver ()=default |
| Destructor. | |
| 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. | |
| solveScalarField::cmptType | normFactor (const solveScalarField &psi, const solveScalarField &source, const solveScalarField &Apsi, solveScalarField &tmpField, const lduMatrix::normTypes normType) const |
| Return the matrix norm using the specified norm method. | |
| solveScalarField::cmptType | normFactor (const solveScalarField &psi, const solveScalarField &source, const solveScalarField &Apsi, solveScalarField &tmpField) const |
| Return the matrix norm used to normalise the residual for the stopping criterion. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from lduMatrix::solver | |
| static autoPtr< solver > | New (const word &solverName, 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 of given type. | |
| 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 given dictionary. | |
| Protected Member Functions inherited from lduMatrix::solver | |
| virtual void | readControls () |
| Read the control parameters from controlDict_. | |
| Protected Attributes inherited from lduMatrix::solver | |
| word | fieldName_ |
| const lduMatrix & | matrix_ |
| const FieldField< Field, scalar > & | interfaceBouCoeffs_ |
| const FieldField< Field, scalar > & | interfaceIntCoeffs_ |
| lduInterfaceFieldPtrsList | interfaces_ |
| dictionary | controlDict_ |
| Dictionary of solution controls. | |
| int | log_ |
| Verbosity level for solver output statements. | |
| label | minIter_ |
| Minimum number of iterations in the solver. | |
| label | maxIter_ |
| Maximum number of iterations in the solver. | |
| lduMatrix::normTypes | normType_ |
| The normalisation type. | |
| scalar | tolerance_ |
| Final convergence tolerance. | |
| scalar | relTol_ |
| Convergence tolerance relative to the initial. | |
| profilingTrigger | profiling_ |
| Profiling instrumentation. | |
Preconditioned conjugate gradient solver for symmetric lduMatrices using a run-time selectable preconditioner.
| PCG | ( | 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 38 of file PCG.C.
References lduMatrix::solver::fieldName(), lduMatrix::solver::interfaceBouCoeffs(), lduMatrix::solver::interfaceIntCoeffs(), lduMatrix::solver::interfaces(), lduMatrix::solver::matrix(), and lduMatrix::solver::solver().

|
virtualdefault |
Destructor.
References psi.
| TypeName | ( | "PCG" | ) |
Runtime type information.
References lduMatrix::solver::fieldName(), lduMatrix::solver::interfaceBouCoeffs(), lduMatrix::solver::interfaceIntCoeffs(), lduMatrix::solver::interfaces(), and lduMatrix::solver::matrix().

|
virtual |
Solve the matrix with this solver.
Reimplemented from lduMatrix::solver.
Definition at line 62 of file PCG.C.
References alpha, UList< T >::begin(), beta(), SolverPerformance< Type >::checkConvergence(), SolverPerformance< Type >::checkSingularity(), lduMatrix::solver::controlDict_, Foam::endl(), lduMatrix::solver::fieldName_, SolverPerformance< Type >::finalResidual(), lduMatrix::preconditioner::getName(), Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, SolverPerformance< Type >::great_, Foam::gSumMag(), Foam::gSumProd(), Foam::Info, SolverPerformance< Type >::initialResidual(), lduMatrix::solver::interfaceBouCoeffs_, lduMatrix::solver::interfaces_, lduMatrix::solver::log_, Foam::mag(), lduMatrix::solver::matrix(), lduMatrix::solver::matrix_, lduMatrix::solver::maxIter_, mesh, lduMatrix::solver::minIter_, lduMatrix::preconditioner::New(), SolverPerformance< Type >::nIterations(), lduMatrix::solver::normFactor(), psi, lduMatrix::solver::relTol_, and lduMatrix::solver::tolerance_.
Referenced by solve().


|
virtual |
Solve the matrix with this solver.
Implements lduMatrix::solver.
Definition at line 213 of file PCG.C.
References refPtr< T >::ref(), and scalarSolve().
