PCG
This class is used to manage the Preconditioned Coniugate Gradient. More…
#include "PCG.h"
Inherits from LinSolver
Inherited by PCG_CPU
Public Functions
| Name | |
|---|---|
| virtual void | Solve(MatrixProd & MAT, DDMat & RHS, DDMat & SOL, MatrixProd & PREC, const string *restrict filename =nullptr) Solves the linear system with monolithic preconditioning. |
| virtual void | Solve(MatrixProd & MAT, DDMat & RHS, DDMat & SOL, MatrixProd & PREC_L, MatrixProd & PREC_R, const string *restrict filename =nullptr) Solves the linear system with split preconditioning. |
| virtual | ~PCG() =0 Deletes the PCG object. |
| virtual void | Set_Solver(MatrixProd & MAT, DDMat & RHS, MatrixProd & PREC) =0 Sets the solver for monolythic preconditioning. |
| virtual void | Set_Solver(MatrixProd & MAT, DDMat & RHS, MatrixProd & PREC_L, MatrixProd & PREC_R) =0 Sets the solver for split preconditioning. |
Protected Attributes
| Name | |
|---|---|
| DDMat * | Pxr preconditioned residual array. |
| DDMat * | p direction array. |
| DDMat * | pnew new direction array. |
| DDMat * | Axp Axp array. |
Additional inherited members
Public Functions inherited from LinSolver
| Name | |
|---|---|
| virtual | ~LinSolver() =0 Deletes the object. |
| void | Set_use_PrecRes(const bool input_use_PrecRes) Sets the the use of preconditioned residual in controlling convergence. |
| void | Set_maxITER(const int input_maxITER) Sets the maximum number of iterations. |
| void | Set_exitTOL(const double input_exitTOL) Sets the exit tolerance. |
| void | Set_initial_sol(const int input_initial_sol) Sets the flag for initial solution. |
| void | Set_printConvProfile(const bool input_printConvProfile) Sets the flag for Convergence Profile printing. |
| void | Set_restart(int const input_restart) Sets the restart frequency. |
| void | SetParms_from_XML(xml_document & input_xml) Sets the parameters from the XML file. |
| int | get_ITER() const Returns the number of iterations performed in previous solution. |
| const rExt * | get_ptr_normRES0() const Returns an handle to the Euclidean norm of the initial residual for each RHS. |
| const rExt * | get_ptr_normRESiter() const Returns an handle to the Euclidean norm of the final iterative residual for each RHS. |
| const rExt * | get_ptr_normRESreal() const Returns an handle to the Euclidean norm of the final real residual for each RHS. |
| const rExt * | get_ptr_normRHS() const Returns an handle to the Euclidean norm of each RHS. |
Protected Attributes inherited from LinSolver
| Name | |
|---|---|
| bool | Set_flag flag for Set_Solver. |
| bool | use_PrecRes parameter to decide whether to use standard or preconditioned residual |
| int | maxITER maximum number of iterations. |
| double | exitTOL exit tolerance. |
| int | initial_sol flag to set the initial solution. |
| int | restart |
| bool | printConvProfile flag for Convergence Profile printing. |
| DDMat * | RES residual array. |
| DDMat * | SCR1 array for scratch 1. |
| int | ITER total number of iterations. |
| VEC_CPU< rExt > | normRES0 euclidean norm of the initial residual. |
| VEC_CPU< rExt > | normRESiter euclidean norm of the final iterative residual. |
| VEC_CPU< rExt > | normRESreal euclidean norm of the final real residual. |
| VEC_CPU< rExt > | normRHS euclidean norm of the Right Hand Side. |
Detailed Description
class PCG;
This class is used to manage the Preconditioned Coniugate Gradient.
class PCG.
Public Functions Documentation
function Solve
virtual void Solve(
MatrixProd & MAT,
DDMat & RHS,
DDMat & SOL,
MatrixProd & PREC,
const string *__restrict__ filename =nullptr
)
Solves the linear system with monolithic preconditioning.
Parameters:
- MAT system matrix.
- RHS system Right Hand Side.
- SOL solution array.
- PREC preconditioner.
- filename file name where the convergence profile is printed (optional).
Reimplements: LinSolver::Solve
function Solve
virtual void Solve(
MatrixProd & MAT,
DDMat & RHS,
DDMat & SOL,
MatrixProd & PREC_L,
MatrixProd & PREC_R,
const string *__restrict__ filename =nullptr
)
Solves the linear system with split preconditioning.
Parameters:
- MAT system matrix.
- RHS system Right Hand Side.
- SOL solution array.
- PREC_L LEFT preconditioner.
- PREC_R RIGHT preconditioner.
- filename file name where the convergence profile is printed (optional).
Reimplements: LinSolver::Solve
function ~PCG
virtual ~PCG() =0
Deletes the PCG object.
function Set_Solver
virtual void Set_Solver(
MatrixProd & MAT,
DDMat & RHS,
MatrixProd & PREC
) =0
Sets the solver for monolythic preconditioning.
Parameters:
- MAT system matrix.
- RHS Right Hand Side.
- PREC preconditioner.
Reimplements: LinSolver::Set_Solver
Reimplemented by: PCG_CPU::Set_Solver
function Set_Solver
virtual void Set_Solver(
MatrixProd & MAT,
DDMat & RHS,
MatrixProd & PREC_L,
MatrixProd & PREC_R
) =0
Sets the solver for split preconditioning.
Parameters:
- MAT system matrix.
- RHS Right Hand Side.
- PREC_L LEFT preconditioner.
- PREC_R RIGHT preconditioner.
Reimplements: LinSolver::Set_Solver
Reimplemented by: PCG_CPU::Set_Solver
Protected Attributes Documentation
variable Pxr
DDMat * Pxr = nullptr;
preconditioned residual array.
variable p
DDMat * p = nullptr;
direction array.
variable pnew
DDMat * pnew = nullptr;
new direction array.
variable Axp
DDMat * Axp = nullptr;
Axp array.
Updated on 19 November 2024 at 10:20:48 CET