CHROMA
syssolver_eigcg_params.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Params of EigCG inverter
3  */
4 
6 #include "io/qprop_io.h"
7 
8 namespace Chroma
9 {
10 
11  //! File output
12  void write(XMLWriter& xml, const std::string& path, const SysSolverEigCGParams::File_t& input){
13  push(xml, path);
14 
15  write(xml, "read", input.read);
16  write(xml, "write", input.write);
17  write(xml, "file_name", input.file_name);
18  write(xml, "file_volfmt", input.file_volfmt);
19 
20  pop(xml);
21  }
22 
23 
24  //! File output
25  void read(XMLReader& xml, const std::string& path, SysSolverEigCGParams::File_t& input){
26  XMLReader inputtop(xml, path);
27 
28  read(inputtop, "read", input.read);
29  read(inputtop, "write", input.write);
30  read(inputtop, "file_name", input.file_name);
31  read(inputtop, "file_volfmt", input.file_volfmt);
32  }
33 
34 
35  // Read parameters
36  void read(XMLReader& xml, const std::string& path, SysSolverEigCGParams& param)
37  {
38  XMLReader paramtop(xml, path);
39 
40  param.defaults();
41 
42  read(paramtop, "invType", param.invType);
43 
44  read(paramtop, "RsdCG", param.RsdCG);
45  read(paramtop, "MaxCG", param.MaxCG);
46 
47  if( paramtop.count("PrintLevel") > 0 ) {
48  read(paramtop, "PrintLevel", param.PrintLevel);
49  }
50 
51  read(paramtop, "Nmax", param.Nmax);
52  read(paramtop, "Neig", param.Neig);
53  if(paramtop.count("Neig_max")!=0){
54  read(paramtop, "Neig_max", param.Neig_max);
55  }
56 
57  if( paramtop.count("esize") > 0 ) {
58  read(paramtop, "esize", param.esize);
59  }
60 
61  if( paramtop.count("restartTol") > 0 ) {
62  read(paramtop, "restartTol", param.restartTol);
63  }
64 
65  if( paramtop.count("NormAest") > 0 ) {
66  read(paramtop, "NormAest", param.NormAest);
67  }
68 
69  if( paramtop.count("updateRestartTol") > 0 ) {
70  read(paramtop, "updateRestartTol", param.updateRestartTol);
71  }
72 
73  if(paramtop.count("vPrecCGvecs")!=0){
74  read(paramtop, "vPrecCGvecs", param.vPrecCGvecs);
75  read(paramtop, "vPrecCGvecStart", param.vPrecCGvecStart);
76  }
77 
78  read(paramtop, "cleanUpEvecs", param.cleanUpEvecs);
79  read(paramtop, "eigen_id", param.eigen_id);
80 
81  if(paramtop.count("FileIO")!=0){
82  read(paramtop, "FileIO", param.file);
83  }
84 
85  }
86 
87  // Writer parameters
88  void write(XMLWriter& xml, const std::string& path, const SysSolverEigCGParams& param)
89  {
90  push(xml, path);
91 
92 // int version = 1;
93 // write(xml, "version", version);
94 
95  write(xml, "invType", param.invType);
96  write(xml, "RsdCG", param.RsdCG);
97  write(xml, "MaxCG", param.MaxCG);
98  write(xml, "Nmax", param.Nmax);
99  write(xml, "Neig", param.Neig);
100  write(xml, "Neig_max", param.Neig_max);
101  write(xml, "restartTol", param.restartTol);
102  write(xml, "updateRestartTol", param.updateRestartTol);
103  write(xml, "NormAest", param.NormAest);
104  write(xml, "vPrecCGvecs", param.vPrecCGvecs);
105  write(xml, "vPrecCGvecs", param.vPrecCGvecStart);
106  write(xml, "cleanUpEvecs", param.cleanUpEvecs);
107  write(xml, "eigen_id", param.eigen_id);
108 
109  write(xml, "FileIO",param.file);
110 
111  pop(xml);
112  }
113 
114  //! Default constructor
116  {
117  defaults();
118  }
119 
120  //! Read parameters
122  {
123  read(xml, path, *this);
124  }
125 
126 }
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
push(xml_out,"Condensates")
pop(xml_out)
::std::string string
Definition: gtest.h:1979
Routines associated with Chroma propagator IO.
Params for EigCG inverter.
SysSolverEigCGParams()
Default constructor.
struct Chroma::SysSolverEigCGParams::File_t file
Solve a CG1 system.