CHROMA
wilson_fermact_params_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Wilson fermion action parameters
3  */
4 
5 #include "chromabase.h"
7 
8 #include "io/param_io.h"
9 
10 namespace Chroma
11 {
12  //! Default constructor
14  {
15  Mass = 0.0;
16  }
17 
18 
19  //! Read parameters
21  {
22  XMLReader paramtop(xml, path);
23 
24  // Read the stuff for the action
25  if (paramtop.count("Mass") != 0)
26  {
27  read(paramtop, "Mass", Mass);
28  if (paramtop.count("Kappa") != 0)
29  {
30  QDPIO::cerr << "Error: found both a Kappa and a Mass tag" << std::endl;
31  QDP_abort(1);
32  }
33  }
34  else if (paramtop.count("Kappa") != 0)
35  {
36  Real Kappa;
37  read(paramtop, "Kappa", Kappa);
38  Mass = kappaToMass(Kappa); // Convert Kappa to Mass
39  }
40  else
41  {
42  QDPIO::cerr << "Error: neither Mass or Kappa found" << std::endl;
43  QDP_abort(1);
44  }
45 
46  // Read optional anisoParam.
47  if (paramtop.count("AnisoParam") != 0)
48  read(paramtop, "AnisoParam", anisoParam);
49  }
50 
51  //! Read parameters
52  void read(XMLReader& xml, const std::string& path, WilsonFermActParams& param)
53  {
54  WilsonFermActParams tmp(xml, path);
55  param = tmp;
56  }
57 
58  //! Writer parameters
59  void write(XMLWriter& xml, const std::string& path, const WilsonFermActParams& param)
60  {
61  push(xml, path);
62 
63  write(xml, "Mass", param.Mass);
64  if (param.anisoParam.anisoP)
65  write(xml, "AnisoParam", param.anisoParam);
66 
67  pop(xml);
68  }
69 }
Primary include file for CHROMA library code.
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.
Real kappaToMass(const Real &Kappa)
Convert a Kappa to a mass.
Definition: param_io.cc:12
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
push(xml_out,"Condensates")
pop(xml_out)
::std::string string
Definition: gtest.h:1979
Various parameter structs and reader/writers.
Params for wilson ferm acts.
WilsonFermActParams()
Default constructor.
Wilson fermion action parameters.