CHROMA
pt_source_const.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Point source construction
4  */
5 
6 #ifndef __pt_source_const_h__
7 #define __pt_source_const_h__
8 
10 #include "io/xml_group_reader.h"
11 
12 namespace Chroma
13 {
14 
15  //! Name and registration
16  /*! @ingroup sources */
17  namespace PointQuarkSourceConstEnv
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  GroupXML_t quark_displacement; /*!< displacement xml */
33  GroupXML_t link_smearing; /*!< link smearing xml */
34 
35  int j_decay; /*!< decay direction */
36  multi1d<int> t_srce; /*!< source location */
37  };
38 
39 
40  //! Point source construction
41  /*! @ingroup sources
42  *
43  * Create a point propagator source
44  */
45  template<typename T>
47  {
48  public:
49  //! Full constructor
50  SourceConst(const Params& p) : params(p) {}
51 
52  //! Construct the source
53  T operator()(const multi1d<LatticeColorMatrix>& u) const;
54 
55  private:
56  //! Hide partial constructor
58 
59  private:
60  Params params; /*!< source params */
61  };
62 
63  } // end namespace
64 
65 
66  //! Reader
67  /*! @ingroup sources */
68  void read(XMLReader& xml, const std::string& path, PointQuarkSourceConstEnv::Params& param);
69 
70  //! Writer
71  /*! @ingroup sources */
72  void write(XMLWriter& xml, const std::string& path, const PointQuarkSourceConstEnv::Params& param);
73 
74 } // end namespace Chroma
75 
76 
77 #endif
T operator()(const multi1d< LatticeColorMatrix > &u) const
Construct the source.
SourceConst(const Params &p)
Full constructor.
Base class for quark source construction.
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.
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
Source construction.
Hold group xml and type id.
void writeXML(XMLWriter &in, const std::string &path) const
Read an XML group as a std::string.