CHROMA
sh_sink_smearing.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Shell sink smearing
4  */
5 
6 #ifndef __sh_sink_smearing_h__
7 #define __sh_sink_smearing_h__
8 
10 #include "io/xml_group_reader.h"
11 
12 namespace Chroma
13 {
14 
15  //! Name and registration
16  /*! @ingroup sinks */
17  namespace ShellQuarkSinkSmearingEnv
18  {
19  bool registerAll();
20 
21  //! Return the name
23 
24 
25  //! Point sink parameters
26  /*! @ingroup sinks */
27  struct Params
28  {
29  Params();
30  Params(XMLReader& in, const std::string& path);
31  void writeXML(XMLWriter& in, const std::string& path) const;
32 
33  bool quark_smear_firstP; /*!< Flag controlling order of smearing */
34 
35  GroupXML_t quark_smearing; /*!< xml std::string holding smearing params */
36  GroupXML_t quark_displacement; /*!< displacement xml */
37  GroupXML_t link_smearing; /*!< link smearing xml */
38  };
39 
40 
41 
42  //! Shell sink smearing
43  /*! @ingroup sinks
44  *
45  * Sink smeared quark
46  */
47  template<typename T>
48  class SinkSmear : public QuarkSourceSink<T>
49  {
50  public:
51  //! Full constructor
52  SinkSmear(const Params& p, const multi1d<LatticeColorMatrix>& u) :
53  params(p), u_smr(u)
54  {
56  }
57 
58  //! Smear the sink
59  void operator()(T& obj) const;
60 
61  private:
62  //! Hide partial constructor
63  SinkSmear() {}
64 
65  private:
66  Params params; /*!< sink params */
67  multi1d<LatticeColorMatrix> u_smr; /*!< hold a smeared copy for efficiency */
68  };
69 
70 
71  } // end namespace
72 
73 
74  //! Reader
75  /*! @ingroup sinks */
76  void read(XMLReader& xml, const std::string& path, ShellQuarkSinkSmearingEnv::Params& param);
77 
78  //! Writer
79  /*! @ingroup sinks */
80  void write(XMLWriter& xml, const std::string& path, const ShellQuarkSinkSmearingEnv::Params& param);
81 
82 
83 } // end namespace Chroma
84 
85 
86 #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.
SinkSmear(const Params &p, const multi1d< LatticeColorMatrix > &u)
Full constructor.
void operator()(T &obj) const
Smear the sink.
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
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
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.