Preconditioned conjugate gradient solver for symmetric lduMatrices using a run-time selectable preconditioner. More...
Public Member Functions | |
TypeName ("PCG") | |
Runtime type information. More... | |
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. More... | |
virtual | ~PCG () |
Destructor. More... | |
virtual solverPerformance | solve (scalarField &psi, const scalarField &source, const direction cmpt=0) const |
Solve the matrix with this solver. More... | |
Public Member Functions inherited from lduMatrix::solver | |
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 () |
Destructor. More... | |
const word & | fieldName () const |
const lduMatrix & | matrix () const |
const FieldField< Field, scalar > & | interfaceBouCoeffs () const |
const FieldField< Field, scalar > & | interfaceIntCoeffs () const |
const lduInterfaceFieldPtrsList & | interfaces () const |
virtual void | read (const dictionary &) |
Read and reset the solver parameters from the given stream. More... | |
scalar | normFactor (const scalarField &psi, const scalarField &source, const scalarField &Apsi, scalarField &tmpField) const |
Return the matrix norm used to normalise the residual for the. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from lduMatrix::solver | |
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... | |
Protected Member Functions inherited from lduMatrix::solver | |
virtual void | readControls () |
Read the control parameters from the controlDict_. More... | |
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 controls. More... | |
label | maxIter_ |
Maximum number of iterations in the solver. More... | |
label | minIter_ |
Minimum number of iterations in the solver. More... | |
scalar | tolerance_ |
Final convergence tolerance. More... | |
scalar | relTol_ |
Convergence tolerance relative to the initial. More... | |
Static Protected Attributes inherited from lduMatrix::solver | |
static const label | defaultMaxIter_ = 1000 |
Default maximum number of iterations in the solver. More... | |
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 42 of file PCG.C.
References PCG::solve().
|
inlinevirtual |
Destructor.
Definition at line 83 of file PCG.H.
References psi, and PCG::solve().
TypeName | ( | "PCG" | ) |
Runtime type information.
|
virtual |
Solve the matrix with this solver.
Implements lduMatrix::solver.
Definition at line 66 of file PCG.C.
References Foam::constant::atomic::alpha, UList< T >::begin(), beta(), SolverPerformance< Type >::checkConvergence(), SolverPerformance< Type >::checkSingularity(), Foam::endl(), SolverPerformance< Type >::finalResidual(), lduMatrix::preconditioner::getName(), SolverPerformance< Type >::great_, Foam::gSumMag(), Foam::gSumProd(), Foam::Info, SolverPerformance< Type >::initialResidual(), Foam::mag(), lduMatrix::mesh(), lduMatrix::preconditioner::New(), SolverPerformance< Type >::nIterations(), and List< T >::size().
Referenced by PCG::PCG(), GAMGSolver::solve(), and PCG::~PCG().