CHROMA
syssolver_mdwf_params.cc
Go to the documentation of this file.
2 #include "chromabase.h"
3 #include "chroma_config.h"
4 
5 
6 
7 using namespace QDP;
8 
9 namespace Chroma {
10 
11  SysSolverMDWFParams::SysSolverMDWFParams(XMLReader& xml,
12  const std::string& path)
13  {
14  XMLReader paramtop(xml, path);
15 
16  read(paramtop, "MaxIter", MaxIter);
17  if( paramtop.count("MaxIterRestart") > 0 ) {
18  read(paramtop, "MaxIterRestart", MaxIterRestart);
19  }
20  else {
21  MaxIterRestart = MaxIter;
22  }
23 
24 
25  read(paramtop, "RsdTarget", RsdTarget);
26  if( paramtop.count("RsdTargetRestart") > 0 ) {
27  read(paramtop, "RsdTargetRestart", RsdTargetRestart);
28  }
29  else {
30  RsdTargetRestart = RsdTarget;
31  }
32 
33  read(paramtop, "N5", N5);
34  read(paramtop, "Mass", Mass);
35  read(paramtop, "OverMass", OverMass);
36  if( (paramtop.count("c5") == 0) && (paramtop.count("b5") == 0) ) {
37  // No b5 and no c5 -- use shamir defaults
38  b5=Real(1);
39  c5=Real(0);
40  }
41  else {
42  read(paramtop, "b5", b5);
43  read(paramtop, "c5", c5);
44  }
45 
46  if ( paramtop.count("AnisoParam") > 0 ) {
47  read(paramtop, "AnisoParam", anisoParam);
48  }
49  }
50 
51  void read(XMLReader& xml, const std::string& path,
53  {
54  SysSolverMDWFParams tmp(xml, path);
55  p = tmp;
56  }
57 
58  void write(XMLWriter& xml, const std::string& path,
59  const SysSolverMDWFParams& p) {
60  push(xml, path);
61  write(xml, "MaxIter", p.MaxIter);
62  write(xml, "RsdTarget", p.RsdTarget);
63  write(xml, "MaxIterRestart", p.MaxIterRestart);
64  write(xml, "RsdTargetRestart", p.RsdTargetRestart);
65 
66  write(xml, "N5", p.N5);
67  write(xml, "Mass", p.Mass);
68  write(xml, "OverMass", p.OverMass);
69 
70  write(xml, "b5", p.b5);
71  write(xml, "c5", p.c5);
72  write(xml, "AnisoParam", p.anisoParam);
73 
74  pop(xml);
75 
76  }
77 
78 
79 
80 }
Primary include file for CHROMA library code.
Real Mass
Double tmp
Definition: meslate.cc:60
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void write(XMLWriter &xml, const std::string &path, const SysSolverMDWFParams &p)
void read(XMLReader &xml, const std::string &path, SysSolverMDWFParams &p)
::std::string string
Definition: gtest.h:1979
push(xml_out,"Cooled_Topology")
pop(xml_out)