CHROMA
pt_sink_smearing.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Point sink smearing
4  */
5 
6 #ifndef __pt_sink_smearing_h__
7 #define __pt_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 PointQuarkSinkSmearingEnv
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  GroupXML_t quark_displacement; /*!< displacement xml */
34  GroupXML_t link_smearing; /*!< link smearing xml */
35  };
36 
37 
38  //! Point sink smearing
39  /*! @ingroup sinks
40  *
41  * Create a point propagator sink
42  */
43  template<typename T>
44  class SinkSmear : public QuarkSourceSink<T>
45  {
46  public:
47  //! Full constructor
48  SinkSmear(const Params& p, const multi1d<LatticeColorMatrix>& u) :
49  params(p), u_smr(u)
50  {
52  }
53 
54  //! Smear the sink
55  void operator()(T& obj) const;
56 
57  private:
58  //! Hide partial constructor
59  SinkSmear() {}
60 
61  private:
62  Params params; /*!< sink params */
63  multi1d<LatticeColorMatrix> u_smr; /*!< hold a smeared copy for efficiency */
64  };
65 
66  } // end namespace
67 
68 
69  //! Reader
70  /*! @ingroup sinks */
71  void read(XMLReader& xml, const std::string& path, PointQuarkSinkSmearingEnv::Params& param);
72 
73  //! Writer
74  /*! @ingroup sinks */
75  void write(XMLWriter& xml, const std::string& path, const PointQuarkSinkSmearingEnv::Params& param);
76 
77 } // end namespace Chroma
78 
79 
80 #endif
void operator()(T &obj) const
Smear the sink.
SinkSmear(const Params &p, const multi1d< LatticeColorMatrix > &u)
Full constructor.
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 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.