CHROMA
syssolver_eigcg_params.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Solve a CG1 system
4  */
5 
6 #ifndef __syssolver_eigcg_params_h__
7 #define __syssolver_eigcg_params_h__
8 
9 #include "chromabase.h"
10 
11 
12 namespace Chroma
13 {
14 
15  //! Params for EigCG inverter
16  /*! \ingroup invert */
18  {
20  SysSolverEigCGParams(XMLReader& in, const std::string& path);
21 
22  std::string invType ; /*!< The type of inverter to use */
23 
24  Real RsdCG ; /*!< CG residual */
25  int MaxCG ; /*!< Maximum CG iterations */
26  int PrintLevel ; /*!< Debugg level */
27  int Neig ; /*!< number of eigenvectors to compute */
28  int Nmax ; /*!< number of basis vectors */
29  int esize ; /*!< 2 <= esize <= 2*Neig + 1 */
30  int Neig_max ; /*!< maximum number of eigenvectors to be refined*/
31 
32  Real restartTol ; /*!< CG restart tolerence: restart when
33  |res|<restartTol*|b-A x(0)| */
34 
35  int updateRestartTol ; /*!< Whether to update restartTol from eresids
36  * Expensive. Requires computation of residuals
37  * =0 Never update restartTol
38  * =1 Compute all eigenresiduals and update
39  * when ncurEvals=ldh for the first time
40  * =2 Update based on up to 10 eres picked from
41  * ncurEvals, on every rhs that adds evecs
42  * =3 Compute all eres and update on every rhs
43  * that adds evecs--unnecessarily expensive
44  * If updateRestartTol>0 Cholesky is not used */
45  Real NormAest ; /* an estimate of the norm2 of the Matrix */
46 
47 
48  //The next two work only with old version of EigCG where the vPrecCG exists
49  int vPrecCGvecs ; /*!< number of vectors for preconditioned CG (if <=0 do regular CG) */
50  int vPrecCGvecStart ; /*!< first std::vector used inpreconditioned CG */
51 
52 
53  bool cleanUpEvecs ; /*!< clean up evecs upon destruction of SystemSolver */
54  std::string eigen_id ; /*!< named buffer holding the eigenvectors */
55 
56  struct File_t
57  {
58  bool read ;
59  bool write ;
61  QDP_volfmt_t file_volfmt;
62  } file;
63 
64  void defaults(){
65  RsdCG = 1.0e-8;
66  MaxCG = 1000;
67  PrintLevel=2;
68  restartTol = zero;
69  updateRestartTol = 1;
70  Neig =0 ;
71  Neig_max =0 ;
72  esize = 4 ;
73  NormAest = 25.0 ;
74 
75  cleanUpEvecs=false;
76  eigen_id="NULL";
77 
78  //IO control
80  file.file_volfmt = QDPIO_SINGLEFILE ;
81 
82  file.read = false;
83  file.write = false;
84 
85  //These work only with old version of EigCG where the vPrecCG exists
86  vPrecCGvecs = 0;
87  vPrecCGvecStart =0;
88  }
89 
90  };
91 
92 
93  // Reader/writers
94  /*! \ingroup invert */
95  void read(XMLReader& xml, const std::string& path, SysSolverEigCGParams& param);
96 
97  /*! \ingroup invert */
98  void write(XMLWriter& xml, const std::string& path, const SysSolverEigCGParams& param);
99 
100 } // End namespace
101 
102 #endif
103 
Primary include file for CHROMA library code.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Double zero
Definition: invbicg.cc:106
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Params for EigCG inverter.
SysSolverEigCGParams()
Default constructor.
struct Chroma::SysSolverEigCGParams::File_t file