Bridge++  Ver. 2.0.2
ASolver_MG< AFIELD > Class Template Reference

#include <asolver_MG.h>

Inheritance diagram for ASolver_MG< AFIELD >:
ASolver< AFIELD >

Public Types

typedef AFIELD::real_t real_t
 
using AFIELD_f = AField< float, AFIELD::IMPL >
 
- Public Types inherited from ASolver< AFIELD >
enum  InitialGuess { RHS, GIVEN, ZERO }
 
typedef AFIELD::real_t real_t
 

Public Member Functions

 ASolver_MG ()
 constructor. More...
 
 ~ASolver_MG ()
 destructor. More...
 
void set_parameters (const Parameters &params)
 setting parameters by a Parameter object. More...
 
void set_parameters_level0 (const Parameters &params)
 setting parameters by a Parameter object. More...
 
void set_parameters_level1 (const Parameters &params)
 setting parameters by a Parameter object. More...
 
void set_parameters (const int Niter, const real_t Stop_cond, const std::vector< int > &sap_block_size, const int nvec)
 setting parameters. More...
 
void set_parameters (const int Niter, const real_t Stop_cond, const std::string &outer_vlevel, const std::vector< int > &sap_block_size, const int nvec, const int nsetup, const int coarse_niter, const real_t coarse_stop_cond, const std::string &coarse_vlevel, const int smoother_niter, const real_t smoother_stop_cond)
 
void run_setup ()
 setup More...
 
void run_setup (std::vector< AFIELD_f > &testvec_work)
 
void run_setup_initial (std::vector< AFIELD_f > &testvec_work)
 
void run_setup_iterative (int niter, std::vector< AFIELD_f > &testvec_work)
 
void solve (AFIELD &xq, const AFIELD &b, int &nconv, real_t &diff)
 solver main. More...
 
AFopr< AFIELD > * get_fopr ()
 returns the pointer to the fermion operator. More...
 
AFopr< AFIELD > * get_foprD ()
 
AFopr_dd< AFIELD_f > * get_foprF ()
 
AFopr_dd< AFIELD_f > * get_fopr_smoother ()
 
AFopr_dd< AFIELD_f > * new_fopr_smoother (const Parameters &param) const
 
AFopr< AFIELD_f > * get_fopr_coarse ()
 
void set_foprD (AFopr< AFIELD > *foprD)
 
void set_foprF (AFopr_dd< AFIELD_f > *foprF)
 
void set_fopr_smoother (AFopr_dd< AFIELD_f > *foprF)
 
void set_lattice (const vector< int > &sap_block_size)
 
void init_solver (std::string mode)
 
void init_solver ()
 
double flop_count ()
 returns the floating point operation count. More...
 
double flop_count_setup ()
 returns the floating point operation count [setup]. More...
 
void reset_flop_count ()
 
bool use_fopr_for_smoother () const
 
const std::string class_name
 
- Public Member Functions inherited from ASolver< AFIELD >
 ASolver ()
 
virtual ~ASolver ()
 
void set_parameter_verboselevel (const Bridge::VerboseLevel vl)
 
virtual void set_init_mode (const InitialGuess init_guess)
 

Static Public Attributes

static const std::string class_name = "ASolver_MG"
 

Protected Member Functions

void init_coarse_grid ()
 
void init (void)
 
void tidyup (void)
 
void solve_MG_init (real_t &rrp, real_t &rr)
 
void solve_MG_step (real_t &rrp, real_t &rr)
 

Protected Attributes

unique_ptr< APrecond_MG< AFIELD, AFIELD_f > > m_prec_mg
 
std::vector< int > m_sap_block_size
 
AFopr< AFIELD > * m_afopr_fineD
 
AFopr_dd< AFIELD_f > * m_afopr_fineF
 
AFopr_dd< AFIELD_f > * m_afopr_smoother
 
unique_ptr< AFopr< AFIELD_f > > m_afopr_coarse
 
unique_ptr< ASolver< AFIELD_f > > m_asolver_coarse
 
unique_ptr< ASolver< AFIELD_f > > m_asolver_smoother
 
unique_ptr< ASolver< AFIELD > > m_outer_solver
 
unique_ptr< MultiGrid< AFIELD_f, AFIELD_f > > m_multigrid
 
int m_Niter
 maximum iteration number. More...
 
real_t m_Stop_cond
 stopping criterion (squared). More...
 
int m_Nconv
 iteratoin number to calculate flop More...
 
int m_nvec
 number of testvectors More...
 
int m_nsetup
 setup iterations More...
 
int m_smoother_niter
 
int m_smoother_stop_cond
 
Parameters m_params_asolver_coarse
 parameters for coarse grid solver More...
 
Parameters m_params_asolver_outer
 parameters for outer solver More...
 
std::string m_mode
 
int m_nconv
 set "D" for colver (default), "DdagD" for domainwall More...
 
AFIELD m_vec_work
 calling constructor without fermion operator is forbidden. More...
 
std::vector< int > m_coarse_lattice
 
unique_ptr< Timerm_timer_gramschmidt
 
unique_ptr< Timerm_timer_generate_coarse_op
 
- Protected Attributes inherited from ASolver< AFIELD >
Bridge::VerboseLevel m_vl
 

Static Protected Attributes

static constexpr int m_min_res_iter = 6
 

Detailed Description

template<typename AFIELD>
class ASolver_MG< AFIELD >

Definition at line 34 of file asolver_MG.h.

Member Typedef Documentation

◆ AFIELD_f

template<typename AFIELD >
using ASolver_MG< AFIELD >::AFIELD_f = AField<float, AFIELD::IMPL>

Definition at line 38 of file asolver_MG.h.

◆ real_t

template<typename AFIELD >
typedef AFIELD::real_t ASolver_MG< AFIELD >::real_t

Definition at line 37 of file asolver_MG.h.

Constructor & Destructor Documentation

◆ ASolver_MG()

template<typename AFIELD >
ASolver_MG< AFIELD >::ASolver_MG ( )
inline

constructor.

Definition at line 107 of file asolver_MG.h.

◆ ~ASolver_MG()

template<typename AFIELD >
ASolver_MG< AFIELD >::~ASolver_MG ( )
inline

destructor.

Definition at line 114 of file asolver_MG.h.

Member Function Documentation

◆ class_name()

const std::string ASolver_MG< AField_d >::class_name

Definition at line 71 of file asolver_MG.cpp.

◆ flop_count()

template<typename AFIELD >
double ASolver_MG< AFIELD >::flop_count
virtual

returns the floating point operation count.

Reimplemented from ASolver< AFIELD >.

Definition at line 596 of file asolver_MG-tmpl.h.

◆ flop_count_setup()

template<typename AFIELD >
double ASolver_MG< AFIELD >::flop_count_setup ( )

returns the floating point operation count [setup].

◆ get_fopr()

template<typename AFIELD >
AFopr<AFIELD>* ASolver_MG< AFIELD >::get_fopr ( )
inlinevirtual

returns the pointer to the fermion operator.

Reimplemented from ASolver< AFIELD >.

Definition at line 144 of file asolver_MG.h.

◆ get_fopr_coarse()

template<typename AFIELD >
AFopr<AFIELD_f>* ASolver_MG< AFIELD >::get_fopr_coarse ( )
inline

Definition at line 151 of file asolver_MG.h.

◆ get_fopr_smoother()

template<typename AFIELD >
AFopr_dd<AFIELD_f>* ASolver_MG< AFIELD >::get_fopr_smoother ( )
inline

Definition at line 147 of file asolver_MG.h.

◆ get_foprD()

template<typename AFIELD >
AFopr<AFIELD>* ASolver_MG< AFIELD >::get_foprD ( )
inline

Definition at line 145 of file asolver_MG.h.

◆ get_foprF()

template<typename AFIELD >
AFopr_dd<AFIELD_f>* ASolver_MG< AFIELD >::get_foprF ( )
inline

Definition at line 146 of file asolver_MG.h.

◆ init()

template<typename AFIELD >
void ASolver_MG< AFIELD >::init ( void  )
protected

Definition at line 43 of file asolver_MG-tmpl.h.

◆ init_coarse_grid()

template<typename AFIELD >
void ASolver_MG< AFIELD >::init_coarse_grid
protected

Definition at line 282 of file asolver_MG-tmpl.h.

◆ init_solver() [1/2]

template<typename AFIELD >
void ASolver_MG< AFIELD >::init_solver ( )
inline

Definition at line 166 of file asolver_MG.h.

◆ init_solver() [2/2]

template<typename AFIELD >
void ASolver_MG< AFIELD >::init_solver ( std::string  mode)

Definition at line 249 of file asolver_MG-tmpl.h.

◆ new_fopr_smoother()

template<typename AFIELD >
AFopr_dd< typename ASolver_MG< AFIELD >::AFIELD_f > * ASolver_MG< AFIELD >::new_fopr_smoother ( const Parameters param) const

Definition at line 186 of file asolver_MG-tmpl.h.

◆ reset_flop_count()

template<typename AFIELD >
void ASolver_MG< AFIELD >::reset_flop_count

Definition at line 587 of file asolver_MG-tmpl.h.

◆ run_setup() [1/2]

template<typename AFIELD >
void ASolver_MG< AFIELD >::run_setup

setup

Definition at line 412 of file asolver_MG-tmpl.h.

◆ run_setup() [2/2]

template<typename AFIELD >
void ASolver_MG< AFIELD >::run_setup ( std::vector< AFIELD_f > &  testvec_work)

Definition at line 381 of file asolver_MG-tmpl.h.

◆ run_setup_initial()

template<typename AFIELD >
void ASolver_MG< AFIELD >::run_setup_initial ( std::vector< AFIELD_f > &  testvec_work)

Definition at line 441 of file asolver_MG-tmpl.h.

◆ run_setup_iterative()

template<typename AFIELD >
void ASolver_MG< AFIELD >::run_setup_iterative ( int  niter,
std::vector< AFIELD_f > &  testvec_work 
)

Definition at line 511 of file asolver_MG-tmpl.h.

◆ set_fopr_smoother()

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_fopr_smoother ( AFopr_dd< AFIELD_f > *  foprF)

Definition at line 232 of file asolver_MG-tmpl.h.

◆ set_foprD()

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_foprD ( AFopr< AFIELD > *  foprD)

Definition at line 198 of file asolver_MG-tmpl.h.

◆ set_foprF()

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_foprF ( AFopr_dd< AFIELD_f > *  foprF)

Definition at line 216 of file asolver_MG-tmpl.h.

◆ set_lattice()

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_lattice ( const vector< int > &  sap_block_size)

Definition at line 342 of file asolver_MG-tmpl.h.

◆ set_parameters() [1/3]

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_parameters ( const int  Niter,
const real_t  Stop_cond,
const std::string &  outer_vlevel,
const std::vector< int > &  sap_block_size,
const int  nvec,
const int  nsetup,
const int  coarse_niter,
const real_t  coarse_stop_cond,
const std::string &  coarse_vlevel,
const int  smoother_niter,
const real_t  smoother_stop_cond 
)

Definition at line 128 of file asolver_MG-tmpl.h.

◆ set_parameters() [2/3]

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_parameters ( const int  Niter,
const real_t  Stop_cond,
const std::vector< int > &  sap_block_size,
const int  nvec 
)

setting parameters.

◆ set_parameters() [3/3]

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_parameters ( const Parameters params)
virtual

setting parameters by a Parameter object.

Implements ASolver< AFIELD >.

Definition at line 63 of file asolver_MG-tmpl.h.

◆ set_parameters_level0()

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_parameters_level0 ( const Parameters params)

setting parameters by a Parameter object.

Definition at line 99 of file asolver_MG-tmpl.h.

◆ set_parameters_level1()

template<typename AFIELD >
void ASolver_MG< AFIELD >::set_parameters_level1 ( const Parameters params)

setting parameters by a Parameter object.

Definition at line 107 of file asolver_MG-tmpl.h.

◆ solve()

template<typename AFIELD >
void ASolver_MG< AFIELD >::solve ( AFIELD xq,
const AFIELD b,
int &  nconv,
real_t diff 
)
virtual

solver main.

Reimplemented from ASolver< AFIELD >.

Definition at line 578 of file asolver_MG-tmpl.h.

◆ solve_MG_init()

template<typename AFIELD >
void ASolver_MG< AFIELD >::solve_MG_init ( real_t rrp,
real_t rr 
)
protected

◆ solve_MG_step()

template<typename AFIELD >
void ASolver_MG< AFIELD >::solve_MG_step ( real_t rrp,
real_t rr 
)
protected

◆ tidyup()

template<typename AFIELD >
void ASolver_MG< AFIELD >::tidyup ( void  )
protected

Definition at line 56 of file asolver_MG-tmpl.h.

◆ use_fopr_for_smoother()

template<typename AFIELD >
bool ASolver_MG< AFIELD >::use_fopr_for_smoother

Definition at line 174 of file asolver_MG-tmpl.h.

Member Data Documentation

◆ class_name

template<typename AFIELD >
const std::string ASolver_MG< AFIELD >::class_name = "ASolver_MG"
static

Definition at line 54 of file asolver_MG.h.

◆ m_afopr_coarse

template<typename AFIELD >
unique_ptr<AFopr<AFIELD_f> > ASolver_MG< AFIELD >::m_afopr_coarse
protected

Definition at line 68 of file asolver_MG.h.

◆ m_afopr_fineD

template<typename AFIELD >
AFopr<AFIELD>* ASolver_MG< AFIELD >::m_afopr_fineD
protected

Definition at line 63 of file asolver_MG.h.

◆ m_afopr_fineF

template<typename AFIELD >
AFopr_dd<AFIELD_f>* ASolver_MG< AFIELD >::m_afopr_fineF
protected

Definition at line 64 of file asolver_MG.h.

◆ m_afopr_smoother

template<typename AFIELD >
AFopr_dd<AFIELD_f>* ASolver_MG< AFIELD >::m_afopr_smoother
protected

Definition at line 65 of file asolver_MG.h.

◆ m_asolver_coarse

template<typename AFIELD >
unique_ptr<ASolver<AFIELD_f> > ASolver_MG< AFIELD >::m_asolver_coarse
protected

Definition at line 71 of file asolver_MG.h.

◆ m_asolver_smoother

template<typename AFIELD >
unique_ptr<ASolver<AFIELD_f> > ASolver_MG< AFIELD >::m_asolver_smoother
protected

Definition at line 72 of file asolver_MG.h.

◆ m_coarse_lattice

template<typename AFIELD >
std::vector<int> ASolver_MG< AFIELD >::m_coarse_lattice
protected

Definition at line 193 of file asolver_MG.h.

◆ m_min_res_iter

template<typename AFIELD >
constexpr int ASolver_MG< AFIELD >::m_min_res_iter = 6
staticconstexprprotected

Definition at line 85 of file asolver_MG.h.

◆ m_mode

template<typename AFIELD >
std::string ASolver_MG< AFIELD >::m_mode
protected

Definition at line 93 of file asolver_MG.h.

◆ m_multigrid

template<typename AFIELD >
unique_ptr<MultiGrid<AFIELD_f, AFIELD_f> > ASolver_MG< AFIELD >::m_multigrid
protected

Definition at line 76 of file asolver_MG.h.

◆ m_Nconv

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_Nconv
protected

iteratoin number to calculate flop

Definition at line 80 of file asolver_MG.h.

◆ m_nconv

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_nconv
protected

set "D" for colver (default), "DdagD" for domainwall

to remember convergence iteration to provide flop count.

Definition at line 96 of file asolver_MG.h.

◆ m_Niter

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_Niter
protected

maximum iteration number.

Definition at line 78 of file asolver_MG.h.

◆ m_nsetup

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_nsetup
protected

setup iterations

Definition at line 83 of file asolver_MG.h.

◆ m_nvec

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_nvec
protected

number of testvectors

Definition at line 82 of file asolver_MG.h.

◆ m_outer_solver

template<typename AFIELD >
unique_ptr<ASolver<AFIELD> > ASolver_MG< AFIELD >::m_outer_solver
protected

Definition at line 73 of file asolver_MG.h.

◆ m_params_asolver_coarse

template<typename AFIELD >
Parameters ASolver_MG< AFIELD >::m_params_asolver_coarse
protected

parameters for coarse grid solver

Definition at line 89 of file asolver_MG.h.

◆ m_params_asolver_outer

template<typename AFIELD >
Parameters ASolver_MG< AFIELD >::m_params_asolver_outer
protected

parameters for outer solver

Definition at line 90 of file asolver_MG.h.

◆ m_prec_mg

template<typename AFIELD >
unique_ptr<APrecond_MG<AFIELD, AFIELD_f> > ASolver_MG< AFIELD >::m_prec_mg
protected

Definition at line 59 of file asolver_MG.h.

◆ m_sap_block_size

template<typename AFIELD >
std::vector<int> ASolver_MG< AFIELD >::m_sap_block_size
protected

Definition at line 60 of file asolver_MG.h.

◆ m_smoother_niter

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_smoother_niter
protected

Definition at line 86 of file asolver_MG.h.

◆ m_smoother_stop_cond

template<typename AFIELD >
int ASolver_MG< AFIELD >::m_smoother_stop_cond
protected

Definition at line 87 of file asolver_MG.h.

◆ m_Stop_cond

template<typename AFIELD >
real_t ASolver_MG< AFIELD >::m_Stop_cond
protected

stopping criterion (squared).

Definition at line 79 of file asolver_MG.h.

◆ m_timer_generate_coarse_op

template<typename AFIELD >
unique_ptr<Timer> ASolver_MG< AFIELD >::m_timer_generate_coarse_op
protected

Definition at line 196 of file asolver_MG.h.

◆ m_timer_gramschmidt

template<typename AFIELD >
unique_ptr<Timer> ASolver_MG< AFIELD >::m_timer_gramschmidt
protected

Definition at line 195 of file asolver_MG.h.

◆ m_vec_work

template<typename AFIELD >
AFIELD ASolver_MG< AFIELD >::m_vec_work
protected

calling constructor without fermion operator is forbidden.

working vectors.

Definition at line 102 of file asolver_MG.h.


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