CHROMA
syssolver_OPTeigbicg_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 SysSolverOptEigBiCGParams::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, SysSolverOptEigBiCGParams::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, SysSolverOptEigBiCGParams& param)
37  {
38  XMLReader paramtop(xml, path);
39 
40  param.defaults();
41 
42  read(paramtop, "RsdCG", param.RsdCG);
43  read(paramtop, "MaxCG", param.MaxCG);
44 
45  if( paramtop.count("PrintLevel") > 0 ) {
46  read(paramtop, "PrintLevel", param.PrintLevel);
47  }
48 
49  read(paramtop, "Nmax", param.Nmax);
50  read(paramtop, "Neig", param.Neig);
51  if(paramtop.count("Neig_max")!=0){
52  read(paramtop, "Neig_max", param.Neig_max);
53  }
54 
55  if( paramtop.count("esize") > 0 ) {
56  read(paramtop, "esize", param.esize);
57  }
58 
59  read(paramtop, "eigen_id", param.eigen_id);
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  read(paramtop, "cleanUpEvecs", param.cleanUpEvecs);
70 
71  if(paramtop.count("FileIO")!=0){
72  read(paramtop, "FileIO", param.file);
73  }
74 
75  if( paramtop.count("sort_option") > 0 ) {
76  read(paramtop, "sort_option", param.sort_option);
77  }
78 
79  if( paramtop.count("epsi") > 0 )
80  read(paramtop, "epsi", param.epsi);
81 
82  if( paramtop.count("ConvTestOpt")>0 )
83  read(paramtop, "ConvTestOpt", param.ConvTestOpt);
84 
85  }
86 
87  // Writer parameters
88  void write(XMLWriter& xml, const std::string& path, const SysSolverOptEigBiCGParams& param)
89  {
90  push(xml, path);
91 
92 // int version = 1;
93 // write(xml, "version", version);
94  write(xml, "invType", "OPT_EIG_CG_INVERTER");
95  write(xml, "RsdCG", param.RsdCG);
96  write(xml, "MaxCG", param.MaxCG);
97  write(xml, "Nmax", param.Nmax);
98  write(xml, "Neig", param.Neig);
99  write(xml, "Neig_max", param.Neig_max);
100  write(xml, "restartTol", param.restartTol);
101 
102  write(xml, "NormAest", param.NormAest);
103  write(xml, "cleanUpEvecs", param.cleanUpEvecs);
104  write(xml, "eigen_id", param.eigen_id);
105 
106  write(xml, "sort_option", param.sort_option);
107  write(xml, "epsi", param.epsi);
108  write(xml, "ConvTestOpt", param.ConvTestOpt);
109 
110  write(xml, "FileIO",param.file);
111 
112  pop(xml);
113  }
114 
115  //! Default constructor
117  {
118  defaults();
119  }
120 
121  //! Read parameters
123  {
124  read(xml, path, *this);
125  }
126 
127 }
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.
struct Chroma::SysSolverOptEigBiCGParams::File_t file
Solve a biCG system.