CHROMA
no_quark_smearing.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief No quark smearing
3  */
4 
5 #include "chromabase.h"
6 
9 
10 namespace Chroma
11 {
12 
13  // Read parameters
14  void read(XMLReader& xml, const std::string& path, NoQuarkSmearingEnv::Params& param)
15  {
17  param = tmp;
18  }
19 
20  //! Parameters for running code
21  void write(XMLWriter& xml, const std::string& path, const NoQuarkSmearingEnv::Params& param)
22  {
23  param.writeXML(xml, path);
24  }
25 
26 
27  //! Hooks to register the class
28  namespace NoQuarkSmearingEnv
29  {
30  namespace
31  {
32  //! Callback function
33  QuarkSmearing<LatticePropagator>* createProp(XMLReader& xml_in,
34  const std::string& path)
35  {
36  return new QuarkSmear<LatticePropagator>(Params(xml_in, path));
37  }
38 
39  //! Callback function
40  QuarkSmearing<LatticeStaggeredPropagator>* createStagProp(XMLReader& xml_in,
41  const std::string& path)
42  {
43  return new QuarkSmear<LatticeStaggeredPropagator>(Params(xml_in, path));
44  }
45 
46  //! Callback function
47  QuarkSmearing<LatticeFermion>* createFerm(XMLReader& xml_in,
48  const std::string& path)
49  {
50  return new QuarkSmear<LatticeFermion>(Params(xml_in, path));
51  }
52 
53  //! Callback function
54  QuarkSmearing<LatticeColorVector>* createColorVec(XMLReader& xml_in,
55  const std::string& path)
56  {
57  return new QuarkSmear<LatticeColorVector>(Params(xml_in, path));
58  }
59 
60  //! Local registration flag
61  bool registered = false;
62 
63  //! Name to be used
64  const std::string name = "NONE";
65  }
66 
67  //! Return the name
68  std::string getName() {return name;}
69 
70  //! Register all the factories
71  bool registerAll()
72  {
73  bool success = true;
74  if (! registered)
75  {
76  success &= Chroma::ThePropSmearingFactory::Instance().registerObject(name, createProp);
77  success &= Chroma::TheStagPropSmearingFactory::Instance().registerObject(name, createStagProp);
78  success &= Chroma::TheFermSmearingFactory::Instance().registerObject(name, createFerm);
79  success &= Chroma::TheColorVecSmearingFactory::Instance().registerObject(name, createColorVec);
80  registered = true;
81  }
82  return success;
83  }
84 
85 
86  //! Parameters for running code
87  Params::Params(XMLReader& xml, const std::string& path)
88  {
89  }
90 
91 
92  //! Parameters for running code
93  void Params::writeXML(XMLWriter& xml, const std::string& path) const
94  {
95  push(xml, path);
96 
97  write(xml, "wvf_kind", NoQuarkSmearingEnv::getName());
98 
99  pop(xml);
100  }
101 
102 
103  //! Do not smear the quark
104  template<>
105  void
107  const multi1d<LatticeColorMatrix>& u) const {}
108 
109  //! Do not smear the quark
110  template<>
111  void
112  QuarkSmear<LatticeStaggeredPropagator>::operator()(LatticeStaggeredPropagator& quark,
113  const multi1d<LatticeColorMatrix>& u) const {}
114 
115  //! Do no smear the quark
116  template<>
117  void
119  const multi1d<LatticeColorMatrix>& u) const {}
120 
121  //! Do not smear the color-std::vector
122  template<>
123  void
125  const multi1d<LatticeColorMatrix>& u) const {}
126 
127  } // end namespace
128 } // end namespace Chroma
129 
Primary include file for CHROMA library code.
void operator()(T &quark, const multi1d< LatticeColorMatrix > &u) const
Smear the quark.
Base class for quark smearing.
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.
static bool registered
Local registration flag.
const std::string name
Name to be used.
CreateFermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFerm(XMLReader &xml, const std::string &path)
bool registerAll()
Register all the factories.
std::string getName()
Return the name.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
push(xml_out,"Condensates")
pop(xml_out)
::std::string string
Definition: gtest.h:1979
No quark smearing.
Factory for producing quark smearing objects.
Params for No quark smearing.
void writeXML(XMLWriter &in, const std::string &path) const
Parameters for running code.