CHROMA
diluteGrid_source_const.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Random Z(M) source construction using dilution
4  *
5  *
6  */
7 
8 #ifndef __diluteGrid_source_const_h__
9 #define __diluteGrid_source_const_h__
10 
12 #include "io/xml_group_reader.h"
13 
14 namespace Chroma
15 {
16 
17  //! Dilute Z(N) quark source namespace, parameters, and classes
18  /*! @ingroup sources */
19  namespace DiluteGridQuarkSourceConstEnv
20  {
21  bool registerAll();
22 
23  //! Return the name
25 
26  //! Random complex Z(N) sources using dilution
27  /*! @ingroup sources */
28  struct Params
29  {
30  Params();
31  Params(XMLReader& in, const std::string& path);
32  void writeXML(XMLWriter& in, const std::string& path) const;
33 
34  GroupXML_t smr; /*!< xml holding smearing params */
35  GroupXML_t displace; /*!< xml holding displacement params */
36  GroupXML_t link_smear; /*!< link smearing xml */
37 
38  bool smear ; // a flag that tells me to smear or not to smear
39 
40  multi1d<int> spatial_mask_size; /*!< Spatial size of periodic mask */
41  multi1d< multi1d<int> > spatial_mask; /*!< Sites included in site mask */
42  //multi1d<int> color_mask; /*!< Color size of periodic mask */
43  //multi1d<int> spin_mask; /*!< Spin size of periodic mask */
44  int color ; /*!< the color */
45  int spin ; /*!< the spin index */
46  int j_decay; /*!< decay direction */
47  int t_source; /*!< source time slice location */
48  };
49 
50 
51  //! Random complex Z(N) sources using dilution
52  /*! @ingroup sources
53  *
54  * Create a random Z(N) using dilution
55  */
56  template<typename T>
58  {
59  public:
60  //! Full constructor
61  SourceConst(const Params& p) : params(p) {}
62 
63  //! Construct the source
64  T operator()(const multi1d<LatticeColorMatrix>& u) const;
65 
66  private:
67  //! Hide partial constructor
69 
70  private:
71  Params params; /*!< source params */
72  };
73 
74  } // end namespace DiluteGridQuarkSourceConstEnv
75 
76 
77  //! Reader
78  /*! @ingroup sources */
79  void read(XMLReader& xml, const std::string& path, DiluteGridQuarkSourceConstEnv::Params& param);
80 
81  //! Writer
82  /*! @ingroup sources */
83  void write(XMLWriter& xml, const std::string& path, const DiluteGridQuarkSourceConstEnv::Params& param);
84 
85 } // end namespace Chroma
86 
87 
88 #endif
Random complex Z(N) sources using dilution.
T operator()(const multi1d< LatticeColorMatrix > &u) const
Construct the source.
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.
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.
Random complex Z(N) sources using dilution.
void writeXML(XMLWriter &in, const std::string &path) const
Hold group xml and type id.
Read an XML group as a std::string.