CHROMA
jacobi_quark_smearing.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Jacobi smearing of color std::vector
3  */
4 
5 #include "chromabase.h"
6 
10 
11 namespace Chroma
12 {
13 
14  // Read parameters
15  void read(XMLReader& xml, const std::string& path, JacobiQuarkSmearingEnv::Params& param)
16  {
18  param = tmp;
19  }
20 
21  //! Parameters for running code
22  void write(XMLWriter& xml, const std::string& path, const JacobiQuarkSmearingEnv::Params& param)
23  {
24  param.writeXML(xml, path);
25  }
26 
27 
28  //! Hooks to register the class
29  namespace JacobiQuarkSmearingEnv
30  {
31  namespace
32  {
33  //! Callback function
34  QuarkSmearing<LatticePropagator>* createProp(XMLReader& xml_in,
35  const std::string& path)
36  {
37  return new QuarkSmear<LatticePropagator>(Params(xml_in, path));
38  }
39 
40  //! Callback function
41  QuarkSmearing<LatticeStaggeredPropagator>* createStagProp(XMLReader& xml_in,
42  const std::string& path)
43  {
44  return new QuarkSmear<LatticeStaggeredPropagator>(Params(xml_in, path));
45  }
46 
47  //! Callback function
48  QuarkSmearing<LatticeFermion>* createFerm(XMLReader& xml_in,
49  const std::string& path)
50  {
51  return new QuarkSmear<LatticeFermion>(Params(xml_in, path));
52  }
53 
54  //! Callback function
55  QuarkSmearing<LatticeColorVector>* createColorVec(XMLReader& xml_in,
56  const std::string& path)
57  {
58  return new QuarkSmear<LatticeColorVector>(Params(xml_in, path));
59  }
60 
61  //! Local registration flag
62  bool registered = false;
63 
64  //! Name to be used
65  const std::string name = "GAUGE_INV_JACOBI";
66  }
67 
68  //! Return the name
69  std::string getName() {return name;}
70 
71  //! Register all the factories
72  bool registerAll()
73  {
74  bool success = true;
75  if (! registered)
76  {
77  success &= Chroma::ThePropSmearingFactory::Instance().registerObject(name, createProp);
78  success &= Chroma::TheStagPropSmearingFactory::Instance().registerObject(name, createStagProp);
79  success &= Chroma::TheFermSmearingFactory::Instance().registerObject(name, createFerm);
80  success &= Chroma::TheColorVecSmearingFactory::Instance().registerObject(name, createColorVec);
81  registered = true;
82  }
83  return success;
84  }
85 
86 
87  //! Parameters for running code
88  Params::Params(XMLReader& xml, const std::string& path)
89  {
90  XMLReader paramtop(xml, path);
91 
92  read(paramtop, "wvf_param", kappa);
93  read(paramtop, "wvfIntPar", iter);
94  read(paramtop, "no_smear_dir", no_smear_dir);
95  }
96 
97 
98  //! Parameters for running code
99  void Params::writeXML(XMLWriter& xml, const std::string& path) const
100  {
101  push(xml, path);
102 
103  write(xml, "wvf_kind", JacobiQuarkSmearingEnv::getName());
104  write(xml, "wvf_param", kappa);
105  write(xml, "wvfIntPar", iter);
106  write(xml, "no_smear_dir", no_smear_dir);
107 
108  pop(xml);
109  }
110 
111 
112  //! Smear the quark
113  template<>
114  void
116  const multi1d<LatticeColorMatrix>& u) const
117  {
119  }
120 
121  //! Smear the quark
122  template<>
123  void
124  QuarkSmear<LatticeStaggeredPropagator>::operator()(LatticeStaggeredPropagator& quark,
125  const multi1d<LatticeColorMatrix>& u) const
126  {
128  }
129 
130  //! Smear the quark
131  template<>
132  void
134  const multi1d<LatticeColorMatrix>& u) const
135  {
137  }
138 
139  //! Smear the color-std::vector
140  template<>
141  void
143  const multi1d<LatticeColorMatrix>& u) const
144  {
146  }
147 
148  } // end namespace
149 } // end namespace Chroma
150 
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.
void jacobiSmear(const multi1d< LatticeColorMatrix > &u, T &chi, const Real &kappa, int iter, int no_smear_dir)
Do a covariant Jacobi smearing of a lattice field.
Definition: jacobi_smear.cc:23
Params params
Jacobi smearing of color std::vector and propagator.
Jacobi smearing of color std::vector.
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)
std::string getName()
Return the name.
bool registerAll()
Register all the factories.
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
Factory for producing quark smearing objects.
Params for Jacobi quark smearing.
void writeXML(XMLWriter &in, const std::string &path) const
Parameters for running code.