class HCL_GMRES_d : public HCL_LinearSolver_d

HCL_GMRES_d implements the preconditioned Generalized Minimal Residual (GMRES) algorithm for solving a linear operator equation with a (possibly) non-symmetric operator (See Golub and VanLoan [1996])

Inheritance:


Public

Input Parameters
int MaxItn
Maximum number of GMRES restarts
int SubspaceDim
Dimension of the Krylov subspace
int Flexible
Flexible GMRES flag
int SaveMemory
Save memory flag
int DispFlag
Display level
Methods
HCL_GMRES_d ( char *fname, HCL_LinearOp_d * m, HCL_LinearSolver_d * ls )
Usual Constructor
HCL_GMRES_d ( char *fname, HCL_LinearOp_d * minv )
Alternate constructor
Table& Parameters ()
Access to parameter table
int Solve ( const HCL_LinearOp_d & A, const HCL_Vector_d & b, HCL_Vector_d & x )
Solve (approximately) the equation Ax=b for x
Output parameters
double ResidualNorm
Norm of the residual error
int TermCode
Termination code

Inherited from HCL_LinearSolver_d:

Public Methods

virtual Table& Parameters()
virtual int Solve( const HCL_LinearOp_d & A, const HCL_Vector_d & b, HCL_Vector_d & x )

Inherited from HCL_Base:

Public Methods

int Count()
void DecCount()
void IncCount()

Private Fields

int ReferenceCount

Documentation

HCL_GMRES_d implements the preconditioned Generalized Minimal Residual (GMRES) algorithm for solving a linear operator equation with a (possibly) non-symmetric operator (See Golub and VanLoan [1996])
Methods

HCL_GMRES_d( char *fname, HCL_LinearOp_d * m, HCL_LinearSolver_d * ls )
Usual Constructor.

Takes (a pointer to) the preconditioner and (a pointer to) the linear solver (used for inverting the preconditioner).

Parameters:
fname - Parameter file name or NULL.
m - Preconditioning operator.
ls - Linear Solver to invert the preconditioning operator.

HCL_GMRES_d( char *fname, HCL_LinearOp_d * minv )
Alternate constructor. Same behavior as the usual contructor, but acceps a (pointer to a) linear op MInv to compute Inv[M] rather than computing the inverse of M using a linear solver.

Parameters:
fname - Parameter file name or NULL.
minv - Inverse of preconditioning operator or NULL.

Table& Parameters()
Access to parameter table. Algorithmic parameters can be accessed with Parameters().GetValue("NAME",val) or changed with Parameters().PutValue("NAME",val)

int Solve( const HCL_LinearOp_d & A, const HCL_Vector_d & b, HCL_Vector_d & x )
Solve (approximately) the equation Ax=b for x.
Returns:
The value of TermCode (see the Parameters section of this document.)
Parameters:
A - Linear operator
b - RHS vector
x - Initially, this must be a (nonzero) starting vector for the iteration. On exit, this contains the approximate solution

Input Parameters
In a parameter file, the names may be prepended by "LinearSolver::" , "LinearSolverGMRES::" or "GMRES::"

int MaxItn
Maximum number of GMRES restarts.
Default = 50

int SubspaceDim
Dimension of the Krylov subspace. Increasing this will generally reduce the number of iterations required, however, the time and storage used per iteration will increase with m*n (n being the dimension of the problem) for GMRES, or 2*m*n for FGMRES.
Default = 10

int Flexible
Flexible GMRES flag. If set to 1, the algorithm will use a Flexible GMRES (FGMRES) iteration. This is necessary if GMRES is used with a linear solver for the preconditioner that does not accurately emulate a linear operator. (For example, when using GMRES as its own preconditioner.) Setting this option roughly doubles the memory usage.
Default = 0

int SaveMemory
Save memory flag. If set to 1, the algorithm will only keep memory allocated that it is actually using. Note that this does not decrease the overall memory usage, but it does allow a preconditioner to use memory that would otherwise be tied up. In this case, before each call to the linear solver for the preconditioner, GMRES will set the linear solver's "SubspaceDim" parameter to the number of unallocated vectors. This is most useful if GMRES is it's own preconditioner, because in this case, the total memory used will not exceed that of unpreconditioned GMRES. (Note that "Flexible" must also be set for this to work.)
Default = 0

int DispFlag
Display level. This determines how much information should be displayed during the execution of the algorithm. Common values are:
0 - No output
1 - One-line summary output
2 - Detailed header and footer with timing information
3 - Per-iteration information

Default = 2

Output parameters

double ResidualNorm
Norm of the residual error

int TermCode
Termination code. Value is one of:

0 - Success
1 - Too many GMRES iterations taken
-1 - SubspaceDim < 2


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de