Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Clover.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVER_INCLUDED
15 #define FOPR_CLOVER_INCLUDED
16 
17 #include "fopr_Wilson.h"
18 #include "fopr_CloverTerm.h"
19 
20 #include "bridgeIO.h"
21 using Bridge::vout;
22 
24 
39 //- parameters class
40 class Parameters_Fopr_Clover : virtual public Parameters
41 {
42  public:
44 };
45 //- end
46 
47 class Fopr_Clover : public Fopr
48 {
49  private:
50  double m_kappa;
51  double m_cSW;
52  std::valarray<int> m_boundary;
53  std::string m_repr;
54  std::string m_mode;
55 
57 
60  const Field_G *m_U;
61 
62  // Fopr_Clover_imp* m_imp; //!< pimple prescription
63 
64  public:
65 
67  : Fopr()
68  {
69  init("Dirac");
70  }
71 
72  Fopr_Clover(std::string repr)
73  : Fopr()
74  {
75  init(repr);
76  }
77 
79  {
80  tidyup();
81  }
82 
83  void set_parameters(const Parameters& params);
84  void set_parameters(double kappa, double cSW, std::valarray<int> bc);
85 
86  void set_config(Field *U)
87  {
88  m_U = (Field_G *)U;
89  m_fopr_w->set_config(U);
91  }
92 
93  void set_mode(std::string mode)
94  {
95  m_mode = mode;
96  }
97 
98  std::string get_mode() const
99  {
100  return m_mode;
101  }
102 
103  const Field mult(const Field& f)
104  {
105  Field v(f.nin(), f.nvol(), f.nex());
106 
107  mult(v, f);
108  return v;
109  }
110 
111  const Field mult_dag(const Field& f)
112  {
113  Field v(f.nin(), f.nvol(), f.nex());
114 
115  mult_dag(v, f);
116  return v;
117  }
118 
119  void mult(Field& v, const Field& f)
120  {
121  if (m_mode == "D") {
122  D(v, f);
123  } else if (m_mode == "DdagD") {
124  DdagD(v, f);
125  } else if (m_mode == "Ddag") {
126  Ddag(v, f);
127  } else if (m_mode == "H") {
128  H(v, f);
129  } else {
130  vout.crucial(m_vl, "Fopr_Clover: undefined mode = %s.\n", m_mode.c_str());
131  abort();
132  }
133  }
134 
135  void mult_dag(Field& v, const Field& f)
136  {
137  if (m_mode == "D") {
138  Ddag(v, f);
139  } else if (m_mode == "DdagD") {
140  DdagD(v, f);
141  } else if (m_mode == "Ddag") {
142  D(v, f);
143  } else if (m_mode == "H") {
144  H(v, f);
145  } else {
146  vout.crucial(m_vl, "Fopr_Clover: undefined mode = %s.\n", m_mode.c_str());
147  abort();
148  }
149  }
150 
151  void DdagD(Field&, const Field&);
152  void D(Field&, const Field&);
153  void Ddag(Field&, const Field&);
154  void H(Field&, const Field&);
155 
156  void mult_gm5(Field& v, const Field& w)
157  {
158  m_fopr_w->mult_gm5(v, w);
159  }
160 
161  const Field mult_gm5(const Field& w)
162  {
163  return m_fopr_w->mult_gm5(w);
164  }
165 
166  void mult_up(int mu, Field& v, const Field& w)
167  {
168  m_fopr_w->mult_up(mu, v, w);
169  }
170 
171  void mult_dn(int mu, Field& v, const Field& w)
172  {
173  m_fopr_w->mult_dn(mu, v, w);
174  }
175 
176  void mult_isigma(Field_F&, const Field_F&,
177  const int mu, const int nu);
178 
179  int field_nvol() { return m_Nvol; }
180  int field_nin() { return 2 * m_Nc * m_Nd; }
181  int field_nex() { return 1; }
182 
183  private:
184 
185  void init(std::string repr);
186  void tidyup();
187 };
188 #endif