Bridge++  Ver. 1.3.x
fopr_Wilson_General_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_IMPL_INCLUDED
15 #define FOPR_WILSON_IMPL_INCLUDED
16 
17 #include "fopr_Wilson_General.h"
18 
19 #include "gammaMatrixSet.h"
20 #include "shiftField_lex.h"
21 
22 #include "channel.h"
23 
24 #include "mat_SU_N.h"
25 #include "vec_SU_N.h"
26 
27 #include "bridgeIO.h"
28 using Bridge::vout;
29 
31 
40 {
41  public:
42  static const std::string class_name;
43 
44  private:
45 
46  // lattice parameters
47  int m_Nc, m_Nd, m_Nvc, m_Ndf;
48  int m_Nx, m_Ny, m_Nz, m_Nt;
49  int m_Nvol, m_Ndim;
50 
51  // physical parameters
52  double m_kappa_s;
53  double m_kappa_t;
54  double m_nu_s;
55  double m_r_s;
56  std::vector<int> m_boundary;
57  std::vector<double> m_boundary2;
58 
59  const Field_G *m_U;
60  std::vector<GammaMatrix> m_GM;
61 
63 
64  std::string m_mode;
65  std::string m_repr;
66 
67  Field m_w1, m_w2;
68 
70  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
71  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
72  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
73  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
74 
75  // use async data transfer
76  std::vector<int> m_npe;
77  std::vector<Channel *> m_fw_send;
78  std::vector<Channel *> m_fw_recv;
79  std::vector<Channel *> m_bw_send;
80  std::vector<Channel *> m_bw_recv;
81 
82  public:
84 
85  void init(std::string repr);
86 
87  void tidyup();
88 
89  void set_parameters(const double kappa_s, const double kappa_t,
90  const double nu_s, const double r_s,
91  const std::vector<int> bc);
92 
93  void set_config(Field *U)
94  { m_U = (Field_G *)U; }
95 
96  void set_mode(std::string mode);
97 
98  std::string get_mode() const;
99 
100  inline void mult(Field& v, const Field& f)
101  { (this->*m_mult)(v, f); }
102 
103  inline void mult_dag(Field& v, const Field& f)
104  { (this->*m_mult_dag)(v, f); }
105 
106  inline void mult_gm5(Field& v, const Field& f)
107  { (this->*m_gm5)(v, f); }
108 
109  inline void D(Field& v, const Field& f)
110  { (this->*m_D)(v, f); }
111 
112  inline void Ddag(Field& w, const Field& f)
113  {
114  mult_gm5(w, f);
115  D(m_w1, w);
116  mult_gm5(w, m_w1);
117  }
118 
119  inline void DdagD(Field& w, const Field& f)
120  {
121  D(m_w1, f);
122  mult_gm5(w, m_w1);
123  D(m_w1, w);
124  mult_gm5(w, m_w1);
125  }
126 
127  inline void DDdag(Field& w, const Field& f)
128  {
129  mult_gm5(m_w1, f);
130  D(w, m_w1);
131  mult_gm5(m_w1, w);
132  D(w, m_w1);
133  }
134 
135  inline void H(Field& w, const Field& f)
136  {
137  D(m_w1, f);
138  mult_gm5(w, m_w1);
139  }
140 
141  inline void mult_undef(Field&, const Field& f)
142  {
143  vout.crucial(m_vl, "%s: mode undefined.\n", class_name.c_str());
144  exit(EXIT_FAILURE);
145  }
146 
147  inline void D_ex(Field& v, const int ex1,
148  const Field& f, const int ex2)
149  { (this->*m_D_ex)(v, ex1, f, ex2); }
150 
151  const Field_F mult_gm5p(int mu, const Field_F& w)
152  {
153  mult_gm5p(mu, m_w1, w);
154  return (Field_F)m_w1;
155  }
156 
157  void mult_gm5p(int mu, Field&, const Field&);
158 
159  void proj_chiral(Field& w, const int ex1,
160  const Field& v, const int ex2, const int ipm);
161 
162  void mult_up(int mu, Field&, const Field&);
163  void mult_dn(int mu, Field&, const Field&);
164 
165  double flop_count();
166 
167  // void fprop_normalize(Field& v);
168  // void fopr_normalize(Field& v);
169  // const double get_fprop_normfactor() { return 2.0 * m_kappa; }
170  // const double get_fopr_normfactor() { return 1.0 / (2.0 * m_kappa); }
171 
172  private:
173  // prohibit copy
176 
184  const Field&, const int);
185 
186  void D_chiral(Field&, const Field&);
187  void D_dirac(Field&, const Field&);
188  void gm5_chiral(Field&, const Field&);
189  void gm5_dirac(Field&, const Field&);
190 
191  void D_ex_chiral(Field&, const int ex1, const Field&, const int ex2);
192  void D_ex_dirac(Field&, const int ex1, const Field&, const int ex2);
193 
194  void mult_p(int mu, Field_F&, const Field_F&);
195  void mult_m(int mu, Field_F&, const Field_F&);
196 
197  void mult_xp(Field&, const Field&);
198  void mult_xm(Field&, const Field&);
199  void mult_yp(Field&, const Field&);
200  void mult_ym(Field&, const Field&);
201  void mult_zp(Field&, const Field&);
202  void mult_zm(Field&, const Field&);
203 
204  void mult_tp_dirac(Field&, const Field&);
205  void mult_tm_dirac(Field&, const Field&);
206  void mult_tp_chiral(Field&, const Field&);
207  void mult_tm_chiral(Field&, const Field&);
208 
209  void daypx(Field&, double, const Field&);
210  void clear(Field&);
211 
212  // member data for threading
213  int m_Mz, m_Mt;
214  int m_Nthread, m_Ntask;
215  int m_Ntask_z, m_Ntask_t;
216 
217  struct mult_arg
218  {
219  int isite;
221  int kz0, kz1, kt0, kt1;
222  };
223  std::vector<mult_arg> m_arg;
224 
225  // member functions for threading
226  void setup_thread();
227  void mult_xp1_thread(int, double *, const double *);
228  void mult_xp2_thread(int, double *, const double *);
229  void mult_xpb_thread(int, double *, const double *);
230  void mult_xm1_thread(int, double *, const double *);
231  void mult_xm2_thread(int, double *, const double *);
232  void mult_xmb_thread(int, double *, const double *);
233  void mult_yp1_thread(int, double *, const double *);
234  void mult_yp2_thread(int, double *, const double *);
235  void mult_ypb_thread(int, double *, const double *);
236  void mult_ym1_thread(int, double *, const double *);
237  void mult_ym2_thread(int, double *, const double *);
238  void mult_ymb_thread(int, double *, const double *);
239  void mult_zp1_thread(int, double *, const double *);
240  void mult_zp2_thread(int, double *, const double *);
241  void mult_zpb_thread(int, double *, const double *);
242  void mult_zm1_thread(int, double *, const double *);
243  void mult_zm2_thread(int, double *, const double *);
244  void mult_zmb_thread(int, double *, const double *);
245  void mult_tp1_dirac_thread(int, double *, const double *);
246  void mult_tp2_dirac_thread(int, double *, const double *);
247  void mult_tpb_dirac_thread(int, double *, const double *);
248  void mult_tm1_dirac_thread(int, double *, const double *);
249  void mult_tm2_dirac_thread(int, double *, const double *);
250  void mult_tmb_dirac_thread(int, double *, const double *);
251  void mult_tp1_chiral_thread(int, double *, const double *);
252  void mult_tp2_chiral_thread(int, double *, const double *);
253  void mult_tpb_chiral_thread(int, double *, const double *);
254  void mult_tm1_chiral_thread(int, double *, const double *);
255  void mult_tm2_chiral_thread(int, double *, const double *);
256  void mult_tmb_chiral_thread(int, double *, const double *);
257  void daypx_thread(int, double *, double, const double *);
258  void clear_thread(int, double *);
259  void gm5_dirac_thread(int, double *, const double *);
260  void gm5_chiral_thread(int, double *, const double *);
261 };
262 #endif
void mult_p(int mu, Field_F &, const Field_F &)
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 m_nu_s
spatial anisotropy parameter.
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult_tp)(Field &, const Field &)
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_tm)(Field &, const Field &)
std::vector< int > m_boundary
boundary condition.
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)
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 &)