Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_SF.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_WILSON_SF_INCLUDED
16 #define FOPR_WILSON_SF_INCLUDED
17 
18 #include "fopr_Wilson.h"
19 
20 #include "field_F_SF.h"
21 
22 //#include "index_lex.h"
23 //#include "shiftField_lex.h"
24 
25 #include "bridgeIO.h"
26 using Bridge::vout;
27 
28 //- parameters class
29 class Parameters_Fopr_Wilson_SF : virtual public Parameters
30 {
31  public:
33 };
34 
36 
58 class Fopr_Wilson_SF : public Fopr
59 {
60  private:
62  double m_kappa;
63  std::valarray<int> m_boundary;
64  std::string m_mode;
65 
67  const Field_G *m_U;
68 
69  // Index_lex m_idx;
70  // ShiftField_lex m_shift;
71 
72  /*
74  Communicator* comm;
76  int Svol;
78  int m_Nc2;
79  */
80 
83 
84  public:
85 
87  {
92  m_NinF = 2 * m_Nc * m_Nd;
93 
94  m_boundary.resize(m_Ndim);
95  m_U = 0;
96  m_fopr_w = new Fopr_Wilson;
97 
98  /*
99  comm = Communicator::init();
100  m_Nc2 = 2*m_Nc;
101  int Nt = CommonParameters::Nt();
102  Svol=m_Nvol/Nt;
103  */
104  }
105 
106  void set_parameters(const Parameters& params);
107  void set_parameters(const double kappa, const std::valarray<int> bc);
108 
109  void set_config(Field *U)
110  {
111  m_U = (Field_G *)U;
112  m_fopr_w->set_config(U);
113  }
114 
116  {
117  delete m_fopr_w;
118  }
119 
120  const Field mult(const Field& f)
121  {
122  Field v(f.nin(), f.nvol(), f.nex());
123 
124  mult(v, f);
125  return v;
126  }
127 
128  const Field mult_dag(const Field& f)
129  {
130  Field v(f.nin(), f.nvol(), f.nex());
131 
132  mult_dag(v, f);
133  return v;
134  }
135 
136  void mult(Field& v, const Field& f)
137  {
138  if (m_mode == "D") {
139  D(v, f);
140  } else if (m_mode == "DdagD") {
141  DdagD(v, f);
142  } else if (m_mode == "Ddag") {
143  Ddag(v, f);
144  } else if (m_mode == "H") {
145  H(v, f);
146  } else {
147  vout.crucial(m_vl, "Fopr_Wilson_SF: mode undefined.\n");
148  abort();
149  }
150  }
151 
152  void mult_dag(Field& v, const Field& f)
153  {
154  if (m_mode == "D") {
155  Ddag(v, f);
156  } else if (m_mode == "DdagD") {
157  DdagD(v, f);
158  } else if (m_mode == "Ddag") {
159  D(v, f);
160  } else if (m_mode == "H") {
161  H(v, f);
162  } else {
163  vout.crucial(m_vl, "Fopr_Wilson_SF: mode undefined.\n");
164  abort();
165  }
166  }
167 
168  void set_mode(std::string mode)
169  {
170  m_mode = mode;
171  }
172 
173  std::string get_mode() const
174  {
175  return m_mode;
176  }
177 
178  const Field_F DdagD(const Field_F&);
179  const Field_F D(const Field_F&);
180  const Field_F Ddag(const Field_F&);
181  const Field_F H(const Field_F&);
182 
183  const Field mult_gm5(const Field& w)
184  {
185  return m_fopr_w->mult_gm5(w);
186  }
187 
188  void DdagD(Field&, const Field&);
189  void D(Field&, const Field&);
190  void Ddag(Field&, const Field&);
191  void H(Field&, const Field&);
192 
193  void mult_gm5(Field& v, const Field& w)
194  {
195  m_fopr_w->mult_gm5(v, w);
196  }
197 
198  const Field_F mult_gm5p(int mu, const Field_F& w);
199 
200  int field_nvol() { return CommonParameters::Nvol(); }
201  int field_nin()
202  {
204  }
205 
206  int field_nex() { return 1; }
207 
208  private:
209 
210  // A function to set the fermion field to zero at the t=0 boundary.
211  // void set_boundary_zero(Field&);
212 };
213 #endif