Belos Package Browser (Single Doxygen Collection) Development
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Belos::GmresInnerSolver< Scalar, MV, OP > Class Template Reference

Inner solver that uses GMRES (via GmresSolMgr). More...

#include <BelosGmresInnerSolver.hpp>

Inheritance diagram for Belos::GmresInnerSolver< Scalar, MV, OP >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef InnerSolver< Scalar,
MV, OP > 
base_type
typedef base_type::scalar_type scalar_type
typedef base_type::magnitude_type magnitude_type
typedef base_type::multivector_type multivector_type
typedef base_type::operator_type operator_type

Public Member Functions

 GmresInnerSolver (const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > &problem, const Teuchos::RCP< const Teuchos::ParameterList > &params, const bool debug=false)
 Constructor.
Teuchos::RCP< const
Teuchos::ParameterList
getCurrentParameters () const
 Current parameters for the inner solver implementation.
InnerSolveResult solve (const Teuchos::RCP< MV > &X, const Teuchos::RCP< const MV > &B, const magnitude_type convTol, const int maxItersPerRestart, const int maxNumRestarts)
 Solve $AX=B$ for the given right-hand side(s) B.
InnerSolveResult solve (const Teuchos::RCP< MV > &X, const Teuchos::RCP< const MV > &B)
 Solve $AX=B$ for the given right-hand side(s) B.

Private Member Functions

 GmresInnerSolver ()
 Default constructor (not implemented).
InnerSolveResult invokeSolver ()
 Invoke the solver for the current linear system.

Static Private Member Functions

static Teuchos::RCP
< LinearProblem< Scalar, MV,
OP > > 
validProblem (const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > &problem)
 Validate and return the given LinearProblem.

Private Attributes

GmresSolMgr< Scalar, MV, OP > solMgr_
 GMRES solver manager (implementation of GMRES).

Detailed Description

template<class Scalar, class MV, class OP>
class Belos::GmresInnerSolver< Scalar, MV, OP >

Inner solver that uses GMRES (via GmresSolMgr).

Definition at line 55 of file BelosGmresInnerSolver.hpp.


Member Typedef Documentation

template<class Scalar , class MV , class OP >
typedef InnerSolver<Scalar, MV, OP> Belos::GmresInnerSolver< Scalar, MV, OP >::base_type

Definition at line 57 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef base_type::scalar_type Belos::GmresInnerSolver< Scalar, MV, OP >::scalar_type

Reimplemented from Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 58 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef base_type::magnitude_type Belos::GmresInnerSolver< Scalar, MV, OP >::magnitude_type

Reimplemented from Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 59 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef base_type::multivector_type Belos::GmresInnerSolver< Scalar, MV, OP >::multivector_type

Reimplemented from Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 60 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef base_type::operator_type Belos::GmresInnerSolver< Scalar, MV, OP >::operator_type

Reimplemented from Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 61 of file BelosGmresInnerSolver.hpp.


Constructor & Destructor Documentation

template<class Scalar , class MV , class OP >
Belos::GmresInnerSolver< Scalar, MV, OP >::GmresInnerSolver ( const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > &  problem,
const Teuchos::RCP< const Teuchos::ParameterList > &  params,
const bool  debug = false 
) [inline]

Constructor.

Parameters:
problem[in/out] The linear problem to solve. Its initial guess ("left-hand side") and its right-hand side will be changed every time solve() is called. The contents of those multivectors won't be overwritten -- just the pointers (RCPs) will be changed -- so if you want to keep either of them, you need only save the RCP before calling any of the solve() methods. The linear problem itself must be non-null, and the matrix / operator A (problem->getOperator()) in the linear system $AX=B$ to solve must be non-null.
params[in] Parameters for GmresSolMgr. If null, we use defaults, else we make a deep copy.
debug[in] Whether or not to run the GMRES implementation in debug mode (which will produce verbose debugging output, and may also result in extra computation in order to test certain invariants or display status).

Definition at line 102 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
Belos::GmresInnerSolver< Scalar, MV, OP >::GmresInnerSolver ( ) [private]

Default constructor (not implemented).

We forbid default construction syntactically by making the default constructor private to the class, and not implementing it.


Member Function Documentation

template<class Scalar , class MV , class OP >
static Teuchos::RCP<LinearProblem<Scalar, MV, OP> > Belos::GmresInnerSolver< Scalar, MV, OP >::validProblem ( const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > &  problem) [inline, static, private]

Validate and return the given LinearProblem.

To be called only by the GmresInnerSolver constructor.

Definition at line 68 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
Teuchos::RCP<const Teuchos::ParameterList> Belos::GmresInnerSolver< Scalar, MV, OP >::getCurrentParameters ( ) const [inline, virtual]

Current parameters for the inner solver implementation.

These parameters may change values in place, if the five-argument version of the solve() method is called. If you want to preserve the original parameter values, make a deep copy of the returned ParameterList.

Implements Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 114 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
InnerSolveResult Belos::GmresInnerSolver< Scalar, MV, OP >::solve ( const Teuchos::RCP< MV > &  X,
const Teuchos::RCP< const MV > &  B,
const magnitude_type  convTol,
const int  maxItersPerRestart,
const int  maxNumRestarts 
) [inline, virtual]

Solve $AX=B$ for the given right-hand side(s) B.

Parameters:
X[in/out] On input: The initial guess for the inner solver, if the inner solver accepts an initial guess (it is not required to do so). On output: the approximate solution to Ax=B as computed by the inner solver. Whether or not the solver accepts an initial guess, X must be allocated to hold the output, and it must be in the correct vector space for the solution vectors.
B[in] Right-hand side(s) for which to solve
convTol[in] "Convergence tolerance," the meaning of which depends on the subclass
maxItersPerRestart[in] Maximum number of iterations per restart cycle in the inner solve.
maxNumRestarts[in] Maximum number of restart cycle(s) in the inner solve.
Returns:
The result of the inner solve. It is a single result, aggregated over all right-hand side(s).

Implements Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 140 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
InnerSolveResult Belos::GmresInnerSolver< Scalar, MV, OP >::solve ( const Teuchos::RCP< MV > &  X,
const Teuchos::RCP< const MV > &  B 
) [inline, virtual]

Solve $AX=B$ for the given right-hand side(s) B.

This should do the same thing as the five-argument version of solve(), except it should pick reasonable defaults for the convergence tolerance, maximum number of iterations, and maximum number of restart cycles.

Parameters:
X[in/out] On input: The initial guess for the inner solver, if the inner solver accepts an initial guess (it is not required to do so). On output: the approximate solution to Ax=B as computed by the inner solver.
B[in] Right-hand side(s) for which to solve
Returns:
The result of the inner solve. It is a single result, aggregated over all right-hand side(s).

Implements Belos::InnerSolver< Scalar, MV, OP >.

Definition at line 177 of file BelosGmresInnerSolver.hpp.

template<class Scalar , class MV , class OP >
InnerSolveResult Belos::GmresInnerSolver< Scalar, MV, OP >::invokeSolver ( ) [inline, private]

Invoke the solver for the current linear system.

This method assumes that the linear system (more precisely, the left-hand side X and the right-hand side B) have already been set. It aggregates the convergence data from the solve over all right-hand side(s) and returns a single InnerSolveResult which represents that aggregate result.

Definition at line 212 of file BelosGmresInnerSolver.hpp.


Member Data Documentation

template<class Scalar , class MV , class OP >
GmresSolMgr<Scalar, MV, OP> Belos::GmresInnerSolver< Scalar, MV, OP >::solMgr_ [private]

GMRES solver manager (implementation of GMRES).

The solver manager configures GMRES on construction, and can be used to solve different linear systems with the same matrix and different right-hand sides.

Definition at line 202 of file BelosGmresInnerSolver.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines