CHROMA
quda_gcr_params.cc
Go to the documentation of this file.
1 #include "chromabase.h"
3 
4 using namespace QDP;
5 
6 namespace Chroma {
7  GCRInnerSolverParams::GCRInnerSolverParams(XMLReader& xml,
8  const std::string& path)
9  {
10  XMLReader paramtop(xml, path);
11  read(paramtop, "RsdPrecondition", tolPrecondition);
12  read(paramtop, "MaxIterPrecondition", maxIterPrecondition);
13  read(paramtop, "NKrylov", gcrNkrylov);
14  read(paramtop, "VerboseP", verboseInner);
15  read(paramtop, "InvTypePrecondition", invTypePrecondition);
16  read(paramtop, "PrecPrecondition", precPrecondition);
17  read(paramtop, "ReconstructPrecondition", reconstructPrecondition);
18 
19  // Read GCR Specific params
20  // Read optional GCR params otherwise use defaults
21  if( paramtop.count("SchwarzType") > 0 ) {
22  read(paramtop, "SchwarzType", schwarzType);
23  }
24 
25  if( paramtop.count("PreconditionCycle") > 0 ) {
26  read(paramtop, "PreconditionCycle", preconditionCycle);
27  }
28  }
29 
30  void read(XMLReader& xml, const std::string& path,
32  {
33  GCRInnerSolverParams tmp(xml, path);
34  p = tmp;
35  }
36 
37 
38 
39  void write(XMLWriter& xml, const std::string& path,
40  const GCRInnerSolverParams& p) {
41  push(xml, path);
42  write(xml, "RsdPrecondition", p.tolPrecondition);
43  write(xml, "MaxIterPrecondition", p.maxIterPrecondition);
44  write(xml, "NKrylov", p.gcrNkrylov);
45  write(xml, "VerboseP", p.verboseInner);
46  write(xml, "InvTypePrecondition", p.invTypePrecondition);
47  write(xml, "SchwarzType", p.schwarzType);
48  write(xml, "PreconditionCycle", p.preconditionCycle);
49  write(xml, "PrecPrecondition", p.precPrecondition);
50  write(xml, "ReconstructPrecondition", p.reconstructPrecondition);
51  pop(xml);
52 
53  }
54 }
Primary include file for CHROMA library code.
Double tmp
Definition: meslate.cc:60
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void read(XMLReader &xml, const std::string &path, GCRInnerSolverParams &p)
void write(XMLWriter &xml, const std::string &path, const GCRInnerSolverParams &p)
::std::string string
Definition: gtest.h:1979
push(xml_out,"Cooled_Topology")
pop(xml_out)