CHROMA
multi_syssolver_mdagm_cg_chrono_clover.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Solve a MdagM*psi=chi linear system by CG2
3  */
4 
7 
9 
10 namespace Chroma
11 {
12 
13 
14  //! CG2 system solver namespace
15  namespace MdagMMultiSysSolverCGChronoCloverEnv
16  {
17  //! Callback function
19  const std::string& path,
20  Handle< FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > > state,
22  {
24  }
25 
26  //! Name to be used
27  const std::string name("CG_CHRONO_CLOVER_INVERTER");
28 
29  //! Local registration flag
30  static bool registered = false;
31 
32  //! Register all the factories
33  bool registerAll()
34  {
35  bool success = true;
36  if (! registered)
37  {
39  registered = true;
40  }
41  return success;
42  }
43  }
44 
45 
47  const std::string& path)
48  {
49  XMLReader paramtop(xml, path);
50  try {
51  read(paramtop, "CloverParams", clovParams);
52  read(paramtop, "MaxIter", MaxIter);
53  read(paramtop, "MaxChrono", MaxChrono);
54  read(paramtop, "Delta", Delta);
55  read(paramtop, "CutoffRsd", CutoffRsd);
56  read(paramtop, "RsdTarget", RsdTarget);
57  }
58  catch(const std::string e ) {
59  QDPIO::cout << "Caught: " << e << std::endl;
60  throw;
61  }
62  }
63 
64  void read(XMLReader& xml, const std::string& path,
66  {
68  p = tmp;
69  }
70 
71  void write(XMLWriter& xml, const std::string& path,
73  push(xml, path);
74  write(xml, "CloverParams", p.clovParams);
75  write(xml, "MaxIter", p.MaxIter);
76  write(xml, "MaxChrono", p.MaxChrono);
77  write(xml, "Delta", p.Delta);
78  write(xml, "CutoffRsd", p.CutoffRsd);
79  write(xml, "RsdTarget", p.RsdTarget);
80 
81 
82  pop(xml);
83 
84  }
85 
86 }
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
Solve a CG2 system. Here, the operator is NOT assumed to be hermitian.
static T & Instance()
Definition: singleton.h:432
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.
Register MdagM system solvers.
Solve a MdagM*psi=chi linear system by CG2 using CG.
Factory for producing system solvers for MdagM*psi = chi.
MdagMMultiSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
Callback function.
const std::string name("CG_CHRONO_CLOVER_INVERTER")
Name to be used.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
push(xml_out,"Condensates")
pop(xml_out)
A(A, psi, r, Ncb, PLUS)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979