CHROMA
norm_sh_sink_smearing.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief NormShell sink smearing
4  */
5 
6 #ifndef __norm_sh_sink_smearing_h__
7 #define __norm_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 NormShellQuarkSinkSmearingEnv
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  int Nhits ;
39  bool site_normalized ; // not implemented
40  };
41 
42 
43 
44  //! NormShell sink smearing
45  /*! @ingroup sinks
46  *
47  * Sink smeared quark
48  */
49  template<typename T>
50  class SinkSmear : public QuarkSourceSink<T>
51  {
52  public:
53  //! Full constructor
54  SinkSmear(const Params& p, const multi1d<LatticeColorMatrix>& u) :
55  params(p), u_smr(u)
56  {
58  }
59 
60  //! Smear the sink
61  void operator()(T& obj) const;
62 
63  private:
64  //! Hide partial constructor
65  SinkSmear() {}
66 
67  private:
68  Params params; /*!< sink params */
69  multi1d<LatticeColorMatrix> u_smr; /*!< hold a smeared copy for efficiency */
70  };
71 
72 
73  } // end namespace
74 
75 
76  //! Reader
77  /*! @ingroup sinks */
78  void read(XMLReader& xml, const std::string& path, NormShellQuarkSinkSmearingEnv::Params& param);
79 
80  //! Writer
81  /*! @ingroup sinks */
82  void write(XMLWriter& xml, const std::string& path, const NormShellQuarkSinkSmearingEnv::Params& param);
83 
84 
85 } // end namespace Chroma
86 
87 
88 #endif
SinkSmear(const Params &p, const multi1d< LatticeColorMatrix > &u)
Full constructor.
void operator()(T &obj) const
Smear the sink.
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.