CHROMA
sh_source_smearing.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Shell source smearing
4  */
5 
6 #ifndef __sh_source_smearing_h__
7 #define __sh_source_smearing_h__
8 
10 #include "io/xml_group_reader.h"
11 
12 namespace Chroma
13 {
14 
15  //! Name and registration
16  /*! @ingroup sources */
17  namespace ShellQuarkSourceSmearingEnv
18  {
19  bool registerAll();
20 
21  //! Return the name
23 
24  //! Point source parameters
25  /*! @ingroup sources */
26  struct Params
27  {
28  Params();
29  Params(XMLReader& in, const std::string& path);
30  void writeXML(XMLWriter& in, const std::string& path) const;
31 
32  bool quark_smear_lastP; /*!< Flag controlling order of smearing */
33 
34  GroupXML_t quark_smearing; /*!< xml std::string holding smearing params */
35  GroupXML_t quark_displacement; /*!< displacement xml */
36  GroupXML_t link_smearing; /*!< link smearing xml */
37 
38  int j_decay; /*!< Decay direction */
39  };
40 
41 
42  //! Shell source smearing
43  /*! @ingroup sources
44  *
45  * A shell source smearing of a quark.
46  */
47  template<typename T>
48  class SourceSmearing : public QuarkSourceSink<T>
49  {
50  public:
51  //! Full constructor
52  SourceSmearing(const Params& p, const multi1d<LatticeColorMatrix>& u) :
53  params(p), u_smr(u)
54  {
56  }
57 
58  //! Construct the source
59  void operator()(T& obj) const;
60 
61  private:
62  //! Hide partial constructor
64 
65  private:
66  Params params; /*!< source params */
67  multi1d<LatticeColorMatrix> u_smr; /*!< hold a smeared copy for efficiency */
68  };
69 
70  } // end namespace
71 
72 
73  //! Reader
74  /*! @ingroup sources */
75  void read(XMLReader& xml, const std::string& path, ShellQuarkSourceSmearingEnv::Params& param);
76 
77  //! Writer
78  /*! @ingroup sources */
79  void write(XMLWriter& xml, const std::string& path, const ShellQuarkSourceSmearingEnv::Params& param);
80 
81 } // end namespace Chroma
82 
83 
84 #endif
Base class for quark source and sink smearing.
virtual void create(multi1d< LatticeColorMatrix > &u, const GroupXML_t &link_smearing)
Potentially smear the gauge field.
void operator()(T &obj) const
Construct the source.
SourceSmearing(const Params &p, const multi1d< LatticeColorMatrix > &u)
Full constructor.
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.
Handle< MapObject< int, EVPair< LatticeColorVector > > > obj
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
LinOpSysSolverMGProtoClover::T T
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Quark source or sink smearing.
Hold group xml and type id.
void writeXML(XMLWriter &in, const std::string &path) const
Read an XML group as a std::string.