Bridge++  Ver. 1.3.x
fopr_Wilson_General_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_GENERAL_IMPL_INCLUDED
15 #define FOPR_WILSON_GENERAL_IMPL_INCLUDED
16 
17 #include "fopr_Wilson_General.h"
18 
19 #include "gammaMatrixSet.h"
20 #include "shiftField_lex.h"
21 
22 #include "threadManager_OpenMP.h"
23 
24 #include "bridgeIO.h"
25 using Bridge::vout;
26 
28 
37 {
38  public:
39  static const std::string class_name;
40 
41  private:
42  // lattice parameters
43  int m_Nc, m_Nd, m_Nvc, m_Ndf;
44  int m_Nx, m_Ny, m_Nz, m_Nt;
45  int m_Nvol, m_Ndim;
46 
47  // physical parameters
49  double m_nu_s, m_r_s;
50  std::vector<int> m_boundary;
51  std::vector<double> m_boundary2;
52 
53  const Field_G *m_U;
54  std::vector<GammaMatrix> m_GM;
55 
57 
58  std::string m_mode;
59  std::string m_repr;
60 
62 
68 
69  public:
72 
73  void init(std::string repr);
74 
75  void tidyup();
76 
77  void set_parameters(const double kappa_s, const double kappa_t,
78  const double nu_s, const double r_s,
79  const std::vector<int> bc);
80 
81  void set_config(Field *U)
82  { m_U = (Field_G *)U; }
83 
84  void set_mode(std::string mode);
85 
86  std::string get_mode() const;
87 
88  inline void mult(Field& v, const Field& f)
89  { (this->*m_mult)(v, f); }
90 
91  inline void mult_dag(Field& v, const Field& f)
92  { (this->*m_mult_dag)(v, f); }
93 
94  inline void mult_gm5(Field& v, const Field& f)
95  { (this->*m_gm5)(v, f); }
96 
97  inline void D(Field& v, const Field& f)
98  { (this->*m_D)(v, f); }
99 
100  inline void Ddag(Field& w, const Field& f)
101  {
102  mult_gm5(w, f);
103  D(m_w1, w);
104  mult_gm5(w, m_w1);
105  }
106 
107  inline void DdagD(Field& w, const Field& f)
108  {
109  D(m_w1, f);
110 
111  // Ddag(w, m_w1);
112  mult_gm5(w, m_w1);
113  D(m_w1, w);
114  mult_gm5(w, m_w1);
115  }
116 
117  inline void DDdag(Field& w, const Field& f)
118  {
119  // Ddag(m_w1, f);
120  mult_gm5(m_w1, f);
121  D(w, m_w1);
122  mult_gm5(m_w1, w);
123 
124  D(w, m_w1);
125  }
126 
127  inline void H(Field& w, const Field& f)
128  {
129  D(m_w1, f);
130  mult_gm5(w, m_w1);
131  }
132 
133  inline void mult_undef(Field&, const Field& f)
134  {
135  vout.crucial(m_vl, "%s: mode undefined.\n", class_name.c_str());
136  exit(EXIT_FAILURE);
137  }
138 
139  inline void D_ex(Field& v, const int ex1,
140  const Field& f, const int ex2)
141  { (this->*m_D_ex)(v, ex1, f, ex2); }
142 
143  const Field_F mult_gm5p(int mu, const Field_F& w)
144  {
145  mult_gm5p(mu, m_w1, w);
146  return (Field_F)m_w1;
147  }
148 
149  void mult_gm5p(int mu, Field&, const Field&);
150 
151  // void gm5p(Field_F& v, const int mu, const Field_F& w);
152 
153  void proj_chiral(Field& w, const int ex1,
154  const Field& v, const int ex2, const int ipm);
155 
156  void mult_up(int mu, Field&, const Field&);
157  void mult_dn(int mu, Field&, const Field&);
158 
159 
160  double flop_count();
161 
162  // inline void fprop_normalize(Field& v)
163  // { v *= (2.0 * m_kappa); }
164  //
165  // inline void fopr_normalize(Field& v)
166  // { v *= 1.0 / (2.0 * m_kappa); }
167 
168  // const double get_fprop_normfactor(){ return 2.0 * m_kappa; }
169  // const double get_fopr_normfactor(){ return 1.0/(2.0 * m_kappa); }
170 
171  private:
172  // prohibit copy
175 
183  const Field&, const int);
184 
185  void D_chiral(Field&, const Field&);
186  void D_dirac(Field&, const Field&);
187  void gm5_chiral(Field&, const Field&);
188  void gm5_dirac(Field&, const Field&);
189 
190  void D_ex_chiral(Field&, const int ex1, const Field&, const int ex2);
191  void D_ex_dirac(Field&, const int ex1, const Field&, const int ex2);
192 
193  void mult_p(int mu, Field_F&, const Field_F&);
194  void mult_m(int mu, Field_F&, const Field_F&);
195 
196  void mult_x_plus(Field&, const Field&);
197  void mult_x_minus(Field&, const Field&);
198  void mult_y_plus(Field&, const Field&);
199  void mult_y_minus(Field&, const Field&);
200  void mult_z_plus(Field&, const Field&);
201  void mult_z_minus(Field&, const Field&);
202 
203  void mult_t_plus_dirac(Field&, const Field&);
204  void mult_t_minus_dirac(Field&, const Field&);
205  void mult_t_plus_chiral(Field&, const Field&);
206  void mult_t_minus_chiral(Field&, const Field&);
207 
208  void daxpy(Field&, double, const Field&);
209  void daypx(Field&, double, const Field&);
210  void scal(Field&, double);
211  void clear(Field&);
212 
213  // member data for threading
214  int m_Mz, m_Mt;
217 
218  struct mult_arg
219  {
220  int isite;
222  int kz0, kz1, kt0, kt1;
223  };
224  std::vector<mult_arg> m_arg;
225 
226  // member functions for threading
227  void setup_thread();
228  void mult_x_plus1_thread(int, double *, const double *);
229  void mult_x_plus2_thread(int, double *, const double *);
230  void mult_x_plus_bulk_thread(int, double *, const double *);
231  void mult_x_minus1_thread(int, double *, const double *);
232  void mult_x_minus2_thread(int, double *, const double *);
233  void mult_x_minus_bulk_thread(int, double *, const double *);
234  void mult_y_plus1_thread(int, double *, const double *);
235  void mult_y_plus2_thread(int, double *, const double *);
236  void mult_y_plus_bulk_thread(int, double *, const double *);
237  void mult_y_minus1_thread(int, double *, const double *);
238  void mult_y_minus2_thread(int, double *, const double *);
239  void mult_y_minus_bulk_thread(int, double *, const double *);
240  void mult_z_plus1_thread(int, double *, const double *);
241  void mult_z_plus2_thread(int, double *, const double *);
242  void mult_z_plus_bulk_thread(int, double *, const double *);
243  void mult_z_minus1_thread(int, double *, const double *);
244  void mult_z_minus2_thread(int, double *, const double *);
245  void mult_z_minus_bulk_thread(int, double *, const double *);
246  void mult_t_plus1_dirac_thread(int, double *, const double *);
247  void mult_t_plus2_dirac_thread(int, double *, const double *);
248  void mult_t_plus_bulk_dirac_thread(int, double *, const double *);
249  void mult_t_minus1_dirac_thread(int, double *, const double *);
250  void mult_t_minus2_dirac_thread(int, double *, const double *);
251  void mult_t_minus_bulk_dirac_thread(int, double *, const double *);
252  void mult_t_plus1_chiral_thread(int, double *, const double *);
253  void mult_t_plus2_chiral_thread(int, double *, const double *);
254  void mult_t_plus_bulk_chiral_thread(int, double *, const double *);
255  void mult_t_minus1_chiral_thread(int, double *, const double *);
256  void mult_t_minus2_chiral_thread(int, double *, const double *);
257  void mult_t_minus_bulk_chiral_thread(int, double *, const double *);
258 
259  void daxpy_thread(int, double *, double, const double *);
260  void daypx_thread(int, double *, double, const double *);
261  void scal_thread(int, double *, double);
262  void clear_thread(int, double *);
263 
264  void gm5_dirac_thread(int, double *, const double *);
265  void gm5_chiral_thread(int, double *, const double *);
266 
267  //- for derivatives
268  // void mult_xpu(Field&, const Field&);
269  // void mult_ypu(Field&, const Field&);
270  // void mult_zpu(Field&, const Field&);
271  // void mult_tpu_dirac(Field&, const Field&);
272  // void mult_tpu_chiral(Field&, const Field&);
273 };
274 #endif
void mult_p(int mu, Field_F &, const Field_F &)
void mult_t_plus_bulk_chiral_thread(int, double *, const double *)
BridgeIO vout
Definition: bridgeIO.cpp:278
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult)(Field &, const Field &)
std::vector< GammaMatrix > m_GM
gamma matrices.
Container of Field-type object.
Definition: field.h:39
double * vcp1_x_plus
arrays for data transfer.
double m_nu_s
spatial anisotropy parameter.
void daypx_thread(int, double *, double, const double *)
void set_parameters(const double kappa_s, const double kappa_t, const double nu_s, const double r_s, const std::vector< int > bc)
std::vector< double > m_boundary2
b.c. for each node.
Wilson-type fermion field.
Definition: field_F.h:37
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_gm5)(Field &, const Field &)
const Field_F mult_gm5p(int mu, const Field_F &w)
SU(N) gauge field.
Definition: field_G.h:38
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult_t_minus)(Field &, const Field &)
std::vector< int > m_boundary
boundary condition.
void daxpy_thread(int, double *, double, const double *)
void mult_t_minus_bulk_dirac_thread(int, double *, const double *)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:48
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult_dag)(Field &, const Field &)
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
VerboseLevel
Definition: bridgeIO.h:39
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult_t_plus)(Field &, const Field &)
void mult_t_minus_bulk_chiral_thread(int, double *, const double *)
Fopr_Wilson_General_impl(const Fopr_Wilson_General::Fopr_Wilson_General_impl &)
void mult_m(int mu, Field_F &, const Field_F &)
Fopr_Wilson_General_impl & operator=(const Fopr_Wilson_General::Fopr_Wilson_General_impl &)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_D_ex)(Field &, const int, const Field &, const int)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_D)(Field &, const Field &)