Chombo + EB  3.2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
GMRESSolver< T > Class Template Reference

#include <GMRESSolver.H>

Inheritance diagram for GMRESSolver< T >:
Inheritance graph
[legend]

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. More...
 
virtual void define (LinearOp< T > *a_op, bool a_homogeneous=true)
 
virtual void solve (T &a_phi, const T &a_rhs)
 solve the equation. More...
 
int restartLen () const
 
void setRestartLen (int mm)
 
- Public Member Functions inherited from LinearSolver< T >
virtual ~LinearSolver ()
 

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
 

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)

Constructor & Destructor Documentation

◆ GMRESSolver()

template<class T >
GMRESSolver< T >::GMRESSolver ( )

◆ ~GMRESSolver()

template<class T >
GMRESSolver< T >::~GMRESSolver ( )
virtual

Member Function Documentation

◆ clearData()

template<class T >
void GMRESSolver< T >::clearData ( )

◆ setHomogeneous()

template<class T >
virtual void GMRESSolver< T >::setHomogeneous ( bool  a_homogeneous)
inlinevirtual

◆ setConvergenceMetrics()

template<class T >
void GMRESSolver< T >::setConvergenceMetrics ( Real  a_metric,
Real  a_tolerance 
)
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.

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

◆ define()

template<class T >
void GMRESSolver< T >::define ( LinearOp< T > *  a_op,
bool  a_homogeneous = true 
)
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.

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

◆ solve()

template<class T >
void GMRESSolver< T >::solve ( T &  a_phi,
const T &  a_rhs 
)
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.

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

◆ restartLen()

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

◆ setRestartLen()

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

◆ allocate()

template<class T >
void GMRESSolver< T >::allocate ( )
private

◆ CycleGMRES()

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

◆ ResidualGMRES()

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

◆ BuildGMRESSoln()

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

◆ UpdateGMRESHessenberg()

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

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

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

◆ TwoUnmodifiedGramSchmidtOrthogonalization()

template<class T >
void GMRESSolver< T >::TwoUnmodifiedGramSchmidtOrthogonalization ( const int  it)
private

◆ ApplyAB()

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

Member Data Documentation

◆ m_homogeneous

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().

◆ m_op

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

◆ m_restrtLen

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

◆ m_imax

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().

◆ m_verbosity

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().

◆ m_eps

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

public member data: solver tolerance

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

◆ m_reps

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

public member data: relative solver tolerance

◆ m_exitStatus

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().

◆ m_small

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

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

◆ m_normType

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

◆ m_data

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

◆ m_hes

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

◆ m_hh

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

◆ m_d

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

◆ m_ee

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

◆ m_dd

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

◆ m_work_arr

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

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