Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Solver_GMRES_m_Cmplx Class Reference

GMRES(m) algorithm with complex variables. More...

#include <solver_GMRES_m_Cmplx.h>

Inheritance diagram for Solver_GMRES_m_Cmplx:
Solver

Public Member Functions

 Solver_GMRES_m_Cmplx (Fopr *fopr)
 
 Solver_GMRES_m_Cmplx (unique_ptr< Fopr > &fopr)
 
 ~Solver_GMRES_m_Cmplx ()
 
void set_parameters (const Parameters &params)
 
void set_parameters (const int Niter, const int Nrestart, const double Stop_cond)
 
void set_parameters (const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess)
 
void set_parameters_GMRES_m (const int N_M)
 
void solve (Field &solution, const Field &source, int &Nconv, double &diff)
 
Foprget_fopr ()
 
double flop_count ()
 
- Public Member Functions inherited from Solver
 Solver ()
 
virtual ~Solver ()
 
void set_parameter_verboselevel (const Bridge::VerboseLevel vl)
 

Static Public Attributes

static const std::string class_name = "Solver_GMRES_m_Cmplx"
 

Private Member Functions

void reset_field (const Field &)
 
void solve_init (const Field &, double &)
 
void solve_step (const Field &, double &)
 
void innerprod_c (double &prod_r, double &prod_i, const Field &v, const Field &w)
 
void min_J (std::valarray< dcomplex > &y, std::valarray< dcomplex > &h)
 
int index_ij (const int i, const int j)
 

Private Attributes

Foprm_fopr
 
int m_Niter
 
int m_Nrestart
 
double m_Stop_cond
 
bool m_use_init_guess
 
int m_N_M
 
double m_beta_prev
 
std::vector< Fieldm_v
 
Field m_s
 
Field m_r
 
Field m_x
 
Field m_v_tmp
 
int m_Nrestart_count
 
int m_Nconv_count
 

Additional Inherited Members

- Protected Attributes inherited from Solver
Bridge::VerboseLevel m_vl
 

Detailed Description

GMRES(m) algorithm with complex variables.

This class implements GMRES(m) algorithm for nonhermitian matrix. The product of vectors is treated in complex. See Y.Saad and M.H.Schultz, SIAM J.Sci.Stat.Comput. 7 (1986) 856. 8 Aug 2012 Y.Namekawa YAML is implemented. [14 Nov 2012 Y.Namekawa] Multi-threaded. [17 Jul 2014 Y.Namekawa] Introduce unique_ptr to avoid memory leaks. [21 Mar 2015 Y.Namekawa] Add restart. [22 Feb 2016 Y.Namekawa] Add flop_count. [ 8 Aug 2016 Y.Namekawa] Add use_init_guess. [ 7 Jul 2017 Y.Namekawa] Fix a bug of h[ij], which is kindly reported by Ji-Chong Yang. [ 7 Mar 2019 Y.Namekawa]

Definition at line 41 of file solver_GMRES_m_Cmplx.h.

Constructor & Destructor Documentation

Solver_GMRES_m_Cmplx::Solver_GMRES_m_Cmplx ( Fopr fopr)
inline

Definition at line 66 of file solver_GMRES_m_Cmplx.h.

Solver_GMRES_m_Cmplx::Solver_GMRES_m_Cmplx ( unique_ptr< Fopr > &  fopr)
inline

Definition at line 74 of file solver_GMRES_m_Cmplx.h.

Solver_GMRES_m_Cmplx::~Solver_GMRES_m_Cmplx ( )
inline

Definition at line 82 of file solver_GMRES_m_Cmplx.h.

Member Function Documentation

double Solver_GMRES_m_Cmplx::flop_count ( )
virtual

Implements Solver.

Definition at line 384 of file solver_GMRES_m_Cmplx.cpp.

Fopr* Solver_GMRES_m_Cmplx::get_fopr ( )
inlinevirtual

Implements Solver.

Definition at line 92 of file solver_GMRES_m_Cmplx.h.

int Solver_GMRES_m_Cmplx::index_ij ( const int  i,
const int  j 
)
inlineprivate

Definition at line 108 of file solver_GMRES_m_Cmplx.h.

void Solver_GMRES_m_Cmplx::innerprod_c ( double &  prod_r,
double &  prod_i,
const Field v,
const Field w 
)
private
void Solver_GMRES_m_Cmplx::min_J ( std::valarray< dcomplex > &  y,
std::valarray< dcomplex > &  h 
)
private

Definition at line 330 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::reset_field ( const Field b)
private

Definition at line 223 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::set_parameters ( const Parameters params)
virtual

Implements Solver.

Definition at line 25 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::set_parameters ( const int  Niter,
const int  Nrestart,
const double  Stop_cond 
)
virtual

Implements Solver.

Definition at line 55 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::set_parameters ( const int  Niter,
const int  Nrestart,
const double  Stop_cond,
const bool  use_init_guess 
)
virtual

Implements Solver.

Definition at line 84 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::set_parameters_GMRES_m ( const int  N_M)

Definition at line 115 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::solve ( Field solution,
const Field source,
int &  Nconv,
double &  diff 
)
virtual

Implements Solver.

Definition at line 135 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::solve_init ( const Field b,
double &  rr 
)
private

Definition at line 253 of file solver_GMRES_m_Cmplx.cpp.

void Solver_GMRES_m_Cmplx::solve_step ( const Field b,
double &  rr 
)
private

Definition at line 280 of file solver_GMRES_m_Cmplx.cpp.

Member Data Documentation

const std::string Solver_GMRES_m_Cmplx::class_name = "Solver_GMRES_m_Cmplx"
static

Definition at line 44 of file solver_GMRES_m_Cmplx.h.

double Solver_GMRES_m_Cmplx::m_beta_prev
private

Definition at line 57 of file solver_GMRES_m_Cmplx.h.

Fopr* Solver_GMRES_m_Cmplx::m_fopr
private

Definition at line 47 of file solver_GMRES_m_Cmplx.h.

int Solver_GMRES_m_Cmplx::m_N_M
private

Definition at line 54 of file solver_GMRES_m_Cmplx.h.

int Solver_GMRES_m_Cmplx::m_Nconv_count
private

Definition at line 63 of file solver_GMRES_m_Cmplx.h.

int Solver_GMRES_m_Cmplx::m_Niter
private

Definition at line 49 of file solver_GMRES_m_Cmplx.h.

int Solver_GMRES_m_Cmplx::m_Nrestart
private

Definition at line 50 of file solver_GMRES_m_Cmplx.h.

int Solver_GMRES_m_Cmplx::m_Nrestart_count
private

Definition at line 62 of file solver_GMRES_m_Cmplx.h.

Field Solver_GMRES_m_Cmplx::m_r
private

Definition at line 60 of file solver_GMRES_m_Cmplx.h.

Field Solver_GMRES_m_Cmplx::m_s
private

Definition at line 60 of file solver_GMRES_m_Cmplx.h.

double Solver_GMRES_m_Cmplx::m_Stop_cond
private

Definition at line 51 of file solver_GMRES_m_Cmplx.h.

bool Solver_GMRES_m_Cmplx::m_use_init_guess
private

Definition at line 52 of file solver_GMRES_m_Cmplx.h.

std::vector<Field> Solver_GMRES_m_Cmplx::m_v
private

Definition at line 59 of file solver_GMRES_m_Cmplx.h.

Field Solver_GMRES_m_Cmplx::m_v_tmp
private

Definition at line 60 of file solver_GMRES_m_Cmplx.h.

Field Solver_GMRES_m_Cmplx::m_x
private

Definition at line 60 of file solver_GMRES_m_Cmplx.h.


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