GMRESSolver< T > Class Template Reference

#include <GMRESSolver.H>

Inheritance diagram for GMRESSolver< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T>
class GMRESSolver< T >

Krylov solver using the GMRES algorithm. Important parmeters are: 1) relative tolerance: m_reps(1.e-12) 2) restart length: m_restrtLen(30)

Public Member Functions

 GMRESSolver ()
virtual ~GMRESSolver ()
void clearData ()
virtual void setHomogeneous (bool a_homogeneous)
virtual void setConvergenceMetrics (Real a_metric, Real a_tolerance)
 Set a convergence metric, along with solver tolerance, if desired.
virtual void define (LinearOp< T > *a_op, bool a_homogeneous=true)
virtual void solve (T &a_phi, const T &a_rhs)
 solve the equation.
int restartLen () const
void setRestartLen (int mm)

Public Attributes

bool m_homogeneous
LinearOp< T > * m_op
int m_imax
int m_verbosity
Real m_eps
Real m_reps
int m_exitStatus
Real m_small
int m_normType

Private Member Functions

void allocate ()
void CycleGMRES (T &xx, int &reason, int &itcount, Real &rnorm0, const bool avoidnorms=false)
void ResidualGMRES (T &a_vv, const T &a_xx, const T &a_bb, T &a_temp)
void BuildGMRESSoln (Real nrs[], T &a_xx, const int it, const T vv_0[])
void UpdateGMRESHessenberg (const int it, bool hapend, Real &res)
void TwoUnmodifiedGramSchmidtOrthogonalization (const int it)
void ApplyAB (T &a_dest, const T &a_xx, T &a_temp) const

Private Attributes

int m_restrtLen
Realm_data
Realm_hes
Realm_hh
Realm_d
Realm_ee
Realm_dd
T * m_work_arr

Constructor & Destructor Documentation

template<class T>
GMRESSolver< T >::GMRESSolver (  )  [inline]

template<class T>
GMRESSolver< T >::~GMRESSolver (  )  [inline, virtual]


Member Function Documentation

template<class T>
void GMRESSolver< T >::clearData (  )  [inline]

template<class T>
virtual void GMRESSolver< T >::setHomogeneous ( bool  a_homogeneous  )  [inline, virtual]

reset whether the solver is homogeneous.

Implements LinearSolver< T >.

References GMRESSolver< T >::m_homogeneous.

template<class T>
void GMRESSolver< T >::setConvergenceMetrics ( Real  a_metric,
Real  a_tolerance 
) [inline, virtual]

Set a convergence metric, along with solver tolerance, if desired.

Default implementation does nothing, since there are probably cases (liked direct solves), where this has no real meaning.

Reimplemented from LinearSolver< T >.

References GMRESSolver< T >::m_eps.

template<class T>
void GMRESSolver< T >::define ( LinearOp< T > *  a_op,
bool  a_homogeneous = true 
) [inline, virtual]

define the solver. a_op is the linear operator. a_homogeneous is whether the solver uses homogeneous boundary conditions.

Implements LinearSolver< T >.

References GMRESSolver< T >::m_homogeneous, and GMRESSolver< T >::m_op.

template<class T>
void GMRESSolver< T >::solve ( T &  a_phi,
const T &  a_rhs 
) [inline, virtual]

solve the equation.

m_exitStatus set = -1 if solver exited for an unknown reason set = 1 if solver converged to tolerance set = 2 if rho = 0 set = 3 if max number of restarts was reached

Implements LinearSolver< T >.

References CH_START, CH_STOP, CH_TIMER, CH_TIMERS, GMRESSolver< T >::CycleGMRES(), GMRESSolver< T >::m_exitStatus, GMRESSolver< T >::m_imax, GMRESSolver< T >::m_op, GMRESSolver< T >::m_restrtLen, GMRESSolver< T >::m_verbosity, GMRESSolver< T >::m_work_arr, pout(), GMRESSolver< T >::ResidualGMRES(), VEC_OFFSET, VEC_TEMP_LHS, VEC_TEMP_RHS, and VEC_VV.

template<class T>
int GMRESSolver< T >::restartLen (  )  const [inline]

template<class T>
void GMRESSolver< T >::setRestartLen ( int  mm  )  [inline]

template<class T>
void GMRESSolver< T >::allocate (  )  [inline, private]

template<class T>
void GMRESSolver< T >::CycleGMRES ( T &  xx,
int &  reason,
int &  itcount,
Real rnorm0,
const bool  avoidnorms = false 
) [inline, private]

template<class T>
void GMRESSolver< T >::ResidualGMRES ( T &  a_vv,
const T &  a_xx,
const T &  a_bb,
T &  a_temp 
) [inline, private]

template<class T>
void GMRESSolver< T >::BuildGMRESSoln ( Real  nrs[],
T &  a_xx,
const int  it,
const T  vv_0[] 
) [inline, private]

template<class T>
void GMRESSolver< T >::UpdateGMRESHessenberg ( const int  it,
bool  hapend,
Real res 
) [inline, private]

References Abs(), CC, GRS, HH, pout(), and SS.

Referenced by GMRESSolver< T >::CycleGMRES().

template<class T>
void GMRESSolver< T >::TwoUnmodifiedGramSchmidtOrthogonalization ( const int  it  )  [inline, private]

template<class T>
void GMRESSolver< T >::ApplyAB ( T &  a_dest,
const T &  a_xx,
T &  a_temp 
) const [inline, private]


Member Data Documentation

template<class T>
bool GMRESSolver< T >::m_homogeneous

public member data: whether the solver is restricted to homogeneous boundary conditions

Referenced by GMRESSolver< T >::define(), and GMRESSolver< T >::setHomogeneous().

template<class T>
LinearOp<T>* GMRESSolver< T >::m_op

template<class T>
int GMRESSolver< T >::m_restrtLen [private]

template<class T>
int GMRESSolver< T >::m_imax

public member data: max iterations (eg, >= m_restrtLen)

Referenced by GMRESSolver< T >::CycleGMRES(), and GMRESSolver< T >::solve().

template<class T>
int GMRESSolver< T >::m_verbosity

public member data: how much screen out put the user wants. set = 0 for no output.

Referenced by GMRESSolver< T >::CycleGMRES(), and GMRESSolver< T >::solve().

template<class T>
Real GMRESSolver< T >::m_eps

public member data: solver tolerance

Referenced by GMRESSolver< T >::setConvergenceMetrics().

template<class T>
Real GMRESSolver< T >::m_reps

public member data: relative solver tolerance

template<class T>
int GMRESSolver< T >::m_exitStatus

public member data: set = -1 if solver exited for an unknown reason set = 1 if solver converged to tolerance set = 2 if rho = 0 set = 3 if max number of restarts was reached

Referenced by GMRESSolver< T >::solve().

template<class T>
Real GMRESSolver< T >::m_small

public member data: what the algorithm should consider "close to zero"

template<class T>
int GMRESSolver< T >::m_normType

template<class T>
Real* GMRESSolver< T >::m_data [private]

template<class T>
Real* GMRESSolver< T >::m_hes [private]

template<class T>
Real * GMRESSolver< T >::m_hh [private]

template<class T>
Real * GMRESSolver< T >::m_d [private]

template<class T>
Real * GMRESSolver< T >::m_ee [private]

template<class T>
Real * GMRESSolver< T >::m_dd [private]

template<class T>
T* GMRESSolver< T >::m_work_arr [private]


The documentation for this class was generated from the following file:

Generated on Fri Apr 5 04:25:06 2019 for Chombo + EB by  doxygen 1.5.5