CHROMA
sh_zN_grid_source_const.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Shell source construction
4  * this source implements a ZN (were N = Nc) for baryonic states
5  * It also works on mesoning 2 quark states.
6  * The idea is to increase statistics with a grid source construction
7  * This trick has been used by the Kentucky group.
8  * I think all I am doing is implementing what they have already done.
9  * I know that there are many grid sources in Chroma but
10  * I what one that works as I want...
11  */
12 
13 #ifndef __sh_zN_grid_source_const_h__
14 #define __sh_zN_grid_source_const_h__
15 
17 #include "io/xml_group_reader.h"
18 
19 namespace Chroma
20 {
21 
22  //! Name and registration
23  /*! @ingroup sources */
24  namespace ShellZnGridQuarkSourceConstEnv
25  {
26  bool registerAll();
27 
28  //! Return the name
30 
31  //! Point source parameters
32  /*! @ingroup sources */
33  struct Params
34  {
35  Params();
36  Params(XMLReader& in, const std::string& path);
37  void writeXML(XMLWriter& out, const std::string& path) const;
38 
39  bool quark_smear_lastP; /*!< Flag controlling order of smearing */
40 
41  GroupXML_t quark_smearing; /*!< xml std::string holding smearing params */
42  GroupXML_t quark_displacement; /*!< displacement xml */
43  GroupXML_t link_smearing; /*!< link smearing xml */
44 
45  int j_decay; /*!< Decay direction */
46 
47  multi1d<int> t_srce; /*!< source location */
48  multi1d<int> grd ; /*!< grid spacing negative means no grid in this direction. */
49  multi1d<multi1d<int> > moms ; /*!< If not empty add a linear combination of momenta to the source */
50  Seed ran_seed; /*!< Set the seed to this value */
51  };
52 
53 
54  //! Shell source construction
55  /*! @ingroup sources
56  *
57  * Create a shell quark source
58  */
59  template<typename T>
61  {
62  public:
63  //! Full constructor
64  SourceConst(const Params& p) : params(p) {}
65 
66  //! Construct the source
67  T operator()(const multi1d<LatticeColorMatrix>& u) const;
68 
69  private:
70  //! Hide partial constructor
72 
73  private:
74  Params params; /*!< source params */
75  };
76 
77  } // end namespace ShellQuarkSourceConstEnv
78 
79 
80  //! Reader
81  /*! @ingroup sources */
82  void read(XMLReader& xml, const std::string& path, ShellZnGridQuarkSourceConstEnv::Params& param);
83 
84  //! Writer
85  /*! @ingroup sources */
86  void write(XMLWriter& xml, const std::string& path, const ShellZnGridQuarkSourceConstEnv::Params& param);
87 
88 
89 } // end namespace Chroma
90 
91 
92 #endif
Base class for quark source construction.
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.
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.