CHROMA
pt_source_smearing.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Point source construction
4  */
5 
6 #ifndef __pt_source_smearing_h__
7 #define __pt_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 PointQuarkSourceSmearingEnv
18  {
19  bool registerAll();
20 
21  //! Return the name
23 
24  //! Point sink 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  GroupXML_t quark_displacement; /*!< displacement xml */
33  GroupXML_t link_smearing; /*!< link smearing xml */
34 
35  int j_decay; /*!< decay direction */
36  };
37 
38 
39  //! Point source smearing
40  /*! @ingroup sources
41  *
42  * Point source smearing. Really not a smearing; however, there can be
43  * displacements which use smeared links
44  */
45  template<typename T>
46  class SourceSmear : public QuarkSourceSink<T>
47  {
48  public:
49  //! Full constructor
50  SourceSmear(const Params& p, const multi1d<LatticeColorMatrix>& u) :
51  params(p), u_smr(u)
52  {
54  }
55 
56  //! Construct the source
57  void operator()(T& obj) const;
58 
59  private:
60  //! Hide partial constructor
62 
63  private:
64  Params params; /*!< source params */
65  multi1d<LatticeColorMatrix> u_smr; /*!< hold a smeared copy for efficiency */
66  };
67 
68 
69  } // end namespace Chroma
70 
71 
72  //! Reader
73  /*! @ingroup sources */
74  void read(XMLReader& xml, const std::string& path, PointQuarkSourceSmearingEnv::Params& param);
75 
76  //! Writer
77  /*! @ingroup sources */
78  void write(XMLWriter& xml, const std::string& path, const PointQuarkSourceSmearingEnv::Params& param);
79 
80 } // end namespace Chroma
81 
82 
83 #endif
SourceSmear(const Params &p, const multi1d< LatticeColorMatrix > &u)
Full constructor.
void operator()(T &obj) const
Construct the source.
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
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.