CHROMA
eoprec_parwilson_fermact_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Even-odd preconditioned Wilson fermion action with parity breaking term
3  */
4 
5 #include "chromabase.h"
8 
11 
12 #include "io/param_io.h" // to get kappaToMass
13 
14 namespace Chroma
15 {
16  //! Hooks to register the class with the fermact factory
17  namespace EvenOddPrecParWilsonFermActEnv
18  {
19  //! Callback function
20  WilsonTypeFermAct<LatticeFermion,
21  multi1d<LatticeColorMatrix>,
22  multi1d<LatticeColorMatrix> >* createFermAct4D(XMLReader& xml_in,
23  const std::string& path)
24  {
26  EvenOddPrecParWilsonFermActParams(xml_in, path));
27  }
28 
29  //! Callback function
30  /*! Differs in return type */
31  FermionAction<LatticeFermion,
32  multi1d<LatticeColorMatrix>,
33  multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
34  const std::string& path)
35  {
36  return createFermAct4D(xml_in, path);
37  }
38 
39  //! Name to be used
40  const std::string name = "PARWILSON";
41 
42  //! Local registration flag
43  static bool registered = false;
44 
45  //! Register all the factories
46  bool registerAll()
47  {
48  bool success = true;
49  if (! registered)
50  {
51  success &= Chroma::TheFermionActionFactory::Instance().registerObject(name, createFermAct);
53  registered = true;
54  }
55  return success;
56  }
57  }
58 
59 
60  //! Read parameters
62  {
63  XMLReader paramtop(xml, path);
64 
65  read(paramtop, "H", H);
66 
67  // Read the stuff for the action
68  if (paramtop.count("Mass") != 0)
69  {
70  read(paramtop, "Mass", Mass);
71  if (paramtop.count("Kappa") != 0)
72  {
73  QDPIO::cerr << "Error: found both a Kappa and a Mass tag" << std::endl;
74  QDP_abort(1);
75  }
76  }
77  else if (paramtop.count("Kappa") != 0)
78  {
79  Real Kappa;
80  read(paramtop, "Kappa", Kappa);
81  Mass = kappaToMass(Kappa); // Convert Kappa to Mass
82  }
83  else
84  {
85  QDPIO::cerr << "Error: neither Mass or Kappa found" << std::endl;
86  QDP_abort(1);
87  }
88 
89 
90  }
91 
92  //! Read parameters
93  void read(XMLReader& xml, const std::string& path, EvenOddPrecParWilsonFermActParams& param)
94  {
96  param = tmp;
97  }
98 
99 
100 
101  //! Produce a linear operator for this action
102  /*!
103  * The operator acts on the odd subset
104  *
105  * \param state gauge field (Read)
106  */
107  EvenOddPrecConstDetLinearOperator<LatticeFermion,
108  multi1d<LatticeColorMatrix>,
109  multi1d<LatticeColorMatrix> >*
111  {
113  }
114 
115 }
Primary include file for CHROMA library code.
Even-odd preconditioned linear operator.
Even-odd preconditioned Wilson fermion action with parity breaking term.
EvenOddPrecConstDetLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
EvenOddPrecParWilsonFermActParams param
Even-odd preconditioned Wilson fermion linear operator with parity breaking term.
Support class for fermion actions and linear operators.
Definition: state.h:94
Base class for quadratic matter actions (e.g., fermions)
Definition: fermact.h:53
Class for counted reference semantics.
Definition: handle.h:33
static T & Instance()
Definition: singleton.h:432
Wilson-like fermion actions.
Definition: fermact.orig.h:344
Even-odd preconditioned Wilson fermion action with parity breaking term.
Even-odd preconditioned Wilson fermion linear operator with parity breaking term.
All ferm create-state method.
Fermion action factories.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
Real kappaToMass(const Real &Kappa)
Convert a Kappa to a mass.
Definition: param_io.cc:12
Handle< CreateFermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateFermState readers.
WilsonTypeFermAct< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct4D(XMLReader &xml_in, const std::string &path)
Callback function.
bool registerAll()
Register all the factories.
static bool registered
Local registration flag.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979
Various parameter structs and reader/writers.