Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_TMWilson.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_TMWILSON_INCLUDED
16 #define FOPR_TMWILSON_INCLUDED
17 
18 #include "fopr_Wilson.h"
19 
20 #include "bridgeIO.h"
21 using Bridge::vout;
22 
24 
33 //- parameters class
34 class Parameters_Fopr_TMWilson : virtual public Parameters
35 {
36  public:
38 };
39 //- end
40 
41 class Fopr_TMWilson : public Fopr
42 {
43  private:
44  int m_Nvol, m_Ndim;
45  double m_kappa, m_tw_mass;
46  std::valarray<int> m_boundary;
47 
49  std::string m_mode;
50  std::string m_repr;
51 
52  void (Fopr_TMWilson::*m_mult) (Field&, const Field&);
53  void (Fopr_TMWilson::*m_mult_dag) (Field&, const Field&);
54 
55  const Field_G *m_U;
56 
57  public:
59  : Fopr()
60  {
63  m_boundary.resize(m_Ndim);
64  m_U = 0;
67  m_repr = "Dirac";
69  }
70 
71  Fopr_TMWilson(std::string repr)
72  : Fopr()
73  {
76  m_boundary.resize(m_Ndim);
77  m_U = 0;
80  m_repr = repr;
82  }
83 
85  {
86  delete m_fopr_w;
87  }
88 
89  void set_parameters(const Parameters& params);
90  void set_parameters(double kappa, double tw_mass, std::valarray<int> bc);
91 
92  void set_config(Field *U)
93  {
94  m_U = (Field_G *)U;
95  m_fopr_w->set_config(U);
96  }
97 
98  const Field mult(const Field& f)
99  {
100  Field v(f.nin(), f.nvol(), f.nex());
101 
102  mult(v, f);
103  return v;
104  }
105 
106  const Field mult_dag(const Field& f)
107  {
108  Field v(f.nin(), f.nvol(), f.nex());
109 
110  mult_dag(v, f);
111  return v;
112  }
113 
114  void mult(Field& v, const Field& f)
115  {
116  (this->*m_mult)(v, f);
117  }
118 
119  void mult_dag(Field& v, const Field& f)
120  {
121  (this->*m_mult_dag)(v, f);
122  }
123 
124  void set_mode(std::string mode)
125  {
126  m_mode = mode;
127 
128  if (m_mode == "D") {
131  } else if (m_mode == "Ddag") {
134  } else if (m_mode == "DdagD") {
137  } else if (m_mode == "H") {
140  } else {
141  vout.crucial(m_vl, "Fopr_TMWilson: input mode is undefined.\n");
142  abort();
143  }
144  }
145 
146  std::string get_mode() const
147  {
148  return m_mode;
149  }
150 
151  const Field mult_gm5(const Field& f)
152  {
153  Field v(f.nin(), f.nvol(), f.nex());
154 
155  mult_gm5(v, f);
156  return v;
157  }
158 
159  void mult_gm5(Field& v, const Field& f)
160  {
161  m_fopr_w->mult_gm5(v, f);
162  }
163 
164  void D(Field&, const Field&);
165  void DdagD(Field&, const Field&);
166  void Ddag(Field&, const Field&);
167  void H(Field&, const Field&);
168  void Hdag(Field&, const Field&);
169 
170  void mult_undef(Field&, const Field&)
171  {
172  vout.crucial(m_vl, "Fopr_TMWilson: input mode is undefined.\n");
173  abort();
174  }
175 
176  const Field_F mult_gm5p(int mu, const Field_F& w)
177  {
178  return m_fopr_w->mult_gm5p(mu, w);
179  }
180 
182  {
184  }
185 
187  {
189  }
190 
191  int field_nvol() { return m_fopr_w->field_nvol(); }
192  int field_nin() { return m_fopr_w->field_nin(); }
193  int field_nex() { return m_fopr_w->field_nex(); }
194 };
195 #endif