CHROMA
sh_source_const.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Shell source construction
4  */
5 
6 #ifndef __sh_source_const_h__
7 #define __sh_source_const_h__
8 
10 #include "io/xml_group_reader.h"
11 
12 namespace Chroma
13 {
14 
15 
16  //! Name and registration
17  /*! @ingroup sources */
18  namespace ShellQuarkSourceConstEnv
19  {
20  bool registerAll();
21 
22  //! Return the name
24 
25 
26  //! Point source parameters
27  /*! @ingroup sources */
28  struct Params
29  {
30  Params();
31  Params(XMLReader& in, const std::string& path);
32  void writeXML(XMLWriter& out, const std::string& path) const;
33 
34  bool quark_smear_lastP; /*!< Flag controlling order of smearing */
35 
36  GroupXML_t quark_smearing; /*!< xml std::string holding smearing params */
37  GroupXML_t quark_displacement; /*!< displacement xml */
38  GroupXML_t link_smearing; /*!< link smearing xml */
39 
40  int j_decay; /*!< Decay direction */
41  multi1d<int> t_srce; /*!< source location */
42  };
43 
44 
45  //! Shell source construction
46  /*! @ingroup sources
47  *
48  * Create a shell quark source
49  */
50  template<typename T>
52  {
53  public:
54  //! Full constructor
55  SourceConst(const Params& p) : params(p) {}
56 
57  //! Construct the source
58  T operator()(const multi1d<LatticeColorMatrix>& u) const;
59 
60  private:
61  //! Hide partial constructor
63 
64  private:
65  Params params; /*!< source params */
66  };
67 
68  } // end namespace ShellQuarkSourceConstEnv
69 
70 
71  //! Reader
72  /*! @ingroup sources */
73  void read(XMLReader& xml, const std::string& path, ShellQuarkSourceConstEnv::Params& param);
74 
75  //! Writer
76  /*! @ingroup sources */
77  void write(XMLWriter& xml, const std::string& path, const ShellQuarkSourceConstEnv::Params& param);
78 
79 
80 } // end namespace Chroma
81 
82 
83 #endif
Base class for quark source construction.
SourceConst(const Params &p)
Full constructor.
T operator()(const multi1d< LatticeColorMatrix > &u) const
Construct the source.
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.
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 * out
Constructor.
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Source construction.
Hold group xml and type id.
void writeXML(XMLWriter &out, const std::string &path) const
Read an XML group as a std::string.