Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_eo_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_EO_IMPL_IMP_INCLUDED
15 #define FOPR_WILSON_EO_IMPL_IMP_INCLUDED
16 
17 #include "Fopr/fopr_eo.h"
18 #include "Field/index_eo.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
34 namespace Imp {
35  class Fopr_Wilson_eo : public Fopr_eo
36  {
37  public:
38  static const std::string class_name;
39 
40  private:
41  int m_Nc, m_Nd, m_Nvc, m_Ndf;
43  int m_Nx, m_Ny, m_Nz, m_Nt, m_Nx2;
44 
45  double m_kappa;
46  std::vector<int> m_boundary;
47  std::vector<double> m_boundary_each_node;
48 
49  std::string m_mode;
50  std::string m_repr;
51 
55 
56  std::vector<int> m_yzt_eo;
58 
60  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
61  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
62  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
63  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
64 
65  void (Fopr_Wilson_eo::*m_gm5)(Field&, const Field&);
67  void (Fopr_Wilson_eo::*m_mult_tp)(Field&, const Field&, const int ieo);
68  void (Fopr_Wilson_eo::*m_mult_tm)(Field&, const Field&, const int ieo);
69 
70  void (Fopr_Wilson_eo::*m_mult)(Field&, const Field&);
71  void (Fopr_Wilson_eo::*m_mult_dag)(Field&, const Field&);
72  void (Fopr_Wilson_eo::*m_D)(Field&, const Field&);
73  void (Fopr_Wilson_eo::*m_preProp)(Field&, Field&, const Field&);
74  void (Fopr_Wilson_eo::*m_postProp)(Field&, const Field&, const Field&);
75 
76  public:
78  { init("Dirac"); }
79 
80  Fopr_Wilson_eo(const std::string repr)
81  { init(repr); }
82 
84  { tidyup(); }
85 
86  void set_parameters(const Parameters& params);
87  void set_parameters(const double kappa, const std::vector<int> bc);
88 
89  void set_config(Field *U);
90 
92  { return set_config(U.get()); }
93 
94  void set_mode(const std::string mode);
95  std::string get_mode() const;
96 
97  // method for even odd fermion operator
98  void preProp(Field& Be, Field& bo, const Field& b)
99  { (this->*m_preProp)(Be, bo, b); }
100 
101  void postProp(Field& x, const Field& xe, const Field& bo)
102  { (this->*m_postProp)(x, xe, bo); }
103 
104  void prePropD(Field&, Field&, const Field&);
105  void postPropD(Field&, const Field&, const Field&);
106  void prePropDag(Field&, Field&, const Field&);
107  void postPropDag(Field&, const Field&, const Field&);
108 
109  void mult(Field& v, const Field& f)
110  { (this->*m_mult)(v, f); }
111 
112  void mult_dag(Field& v, const Field& f)
113  { (this->*m_mult_dag)(v, f); }
114 
115  void D(Field& v, const Field& f);
116  void Ddag(Field& v, const Field& f);
117  void DdagD(Field& v, const Field& f);
118  void DDdag(Field& v, const Field& f);
119  void H(Field& v, const Field& f);
120 
121  // ieo=0: even <-- odd
122  // ieo=1: odd <-- even
123 
124  void Meo(Field&, const Field&, const int ieo);
125  void Mdageo(Field&, const Field&, const int ieo);
126  void MeoMoe(Field&, const Field&);
127  void Meo_gm5(Field&, const Field&, const int ieo);
128 
129  void mult_gm5(Field&, const Field&);
130  void mult_gm5(Field&);
131  void gm5_dirac(Field&, const Field&);
132  void gm5_chiral(Field&, const Field&);
133  void gm5_self_dirac(Field&);
134  void gm5_self_chiral(Field&);
135 
137  void gm5p(const int mu, Field&, const Field& v);
138 
139  int field_nvol() { return m_Nvol2; }
140  int field_nin() { return m_Nvc * m_Nd; }
141  int field_nex() { return 1; }
142 
144  double flop_count();
145 
146  private:
147  void init(const std::string);
148  void tidyup();
149 
150  void mult_xp(Field&, const Field&, const int ieo);
151  void mult_xm(Field&, const Field&, const int ieo);
152  void mult_yp(Field&, const Field&, const int ieo);
153  void mult_ym(Field&, const Field&, const int ieo);
154  void mult_zp(Field&, const Field&, const int ieo);
155  void mult_zm(Field&, const Field&, const int ieo);
156  void mult_tp_dirac(Field&, const Field&, const int ieo);
157  void mult_tm_dirac(Field&, const Field&, const int ieo);
158  void mult_tp_chiral(Field&, const Field&, const int ieo);
159  void mult_tm_chiral(Field&, const Field&, const int ieo);
160 
161  void clear_impl(Field&);
162  void scal_impl(Field&, const double);
163 
164  // member data for threading
165  int m_Mz, m_Mt;
168 
169  struct mult_arg
170  {
171  int isite;
173  int kz0, kz1, kt0, kt1;
174  };
175  std::vector<mult_arg> m_arg;
176 
177  // member functions for threading
178  void setup_thread();
179 
180  void mult_xp1_thread(const int, double *, const double *, const int);
181  void mult_xp2_thread(const int, double *, const double *, const int);
182  void mult_xpb_thread(const int, double *, const double *, const int);
183 
184  void mult_xm1_thread(const int, double *, const double *, const int);
185  void mult_xm2_thread(const int, double *, const double *, const int);
186  void mult_xmb_thread(const int, double *, const double *, const int);
187 
188  void mult_yp1_thread(const int, double *, const double *, const int);
189  void mult_yp2_thread(const int, double *, const double *, const int);
190  void mult_ypb_thread(const int, double *, const double *, const int);
191 
192  void mult_ym1_thread(const int, double *, const double *, const int);
193  void mult_ym2_thread(const int, double *, const double *, const int);
194  void mult_ymb_thread(const int, double *, const double *, const int);
195 
196  void mult_zp1_thread(const int, double *, const double *, const int);
197  void mult_zp2_thread(const int, double *, const double *, const int);
198  void mult_zpb_thread(const int, double *, const double *, const int);
199 
200  void mult_zm1_thread(const int, double *, const double *, const int);
201  void mult_zm2_thread(const int, double *, const double *, const int);
202  void mult_zmb_thread(const int, double *, const double *, const int);
203 
204  void mult_tp1_dirac_thread(const int, double *, const double *, const int);
205  void mult_tp2_dirac_thread(const int, double *, const double *, const int);
206  void mult_tpb_dirac_thread(const int, double *, const double *, const int);
207 
208  void mult_tm1_dirac_thread(const int, double *, const double *, const int);
209  void mult_tm2_dirac_thread(const int, double *, const double *, const int);
210  void mult_tmb_dirac_thread(const int, double *, const double *, const int);
211 
212  void mult_tp1_chiral_thread(const int, double *, const double *, const int);
213  void mult_tp2_chiral_thread(const int, double *, const double *, const int);
214  void mult_tpb_chiral_thread(const int, double *, const double *, const int);
215 
216  void mult_tm1_chiral_thread(const int, double *, const double *, const int);
217  void mult_tm2_chiral_thread(const int, double *, const double *, const int);
218  void mult_tmb_chiral_thread(const int, double *, const double *, const int);
219 
220  void scal_thread(const int, double *, const double);
221  void clear_thread(const int, double *);
222 
223  void gm5_dirac_thread(const int, double *, const double *);
224  void gm5_chiral_thread(const int, double *, const double *);
225  void gm5_dirac_thread(const int, double *);
226  void gm5_chiral_thread(const int, double *);
227 
228 #ifdef USE_FACTORY
229  private:
230  static Fopr *create_object()
231  {
232  return new Fopr_Wilson_eo();
233  }
234 
235  static Fopr *create_object_with_repr(const std::string& repr)
236  {
237  return new Fopr_Wilson_eo(repr);
238  }
239 
240  public:
241  static bool register_factory()
242  {
243  bool init1 = Fopr::Factory_noarg::Register("Wilson_eo/Imp", create_object);
244  bool init2 = Fopr::Factory_string::Register("Wilson_eo/Imp", create_object_with_repr);
245 
246  return init1 && init2;
247  }
248 #endif
249  };
250 }
251 #endif /* FOPR_WILSON_EO_IMPL_IMP_INCLUDED */
void mult_zp2_thread(const int, double *, const double *, const int)
Fopr_Wilson_eo(const std::string repr)
void set_config(unique_ptr< Field_G > &U)
void mult_xm(Field &, const Field &, const int ieo)
void postPropD(Field &, const Field &, const Field &)
void mult_tm_dirac(Field &, const Field &, const int ieo)
void mult_tp1_dirac_thread(const int, double *, const double *, const int)
BridgeIO vout
Definition: bridgeIO.cpp:503
void mult_zpb_thread(const int, double *, const double *, const int)
void(Fopr_Wilson_eo::* m_mult_tp)(Field &, const Field &, const int ieo)
void mult_ymb_thread(const int, double *, const double *, const int)
void mult_ym(Field &, const Field &, const int ieo)
void mult_xp(Field &, const Field &, const int ieo)
void mult_yp(Field &, const Field &, const int ieo)
void gm5_chiral_thread(const int, double *, const double *)
void mult_zm2_thread(const int, double *, const double *, const int)
void clear_thread(const int, double *)
void DDdag(Field &v, const Field &f)
void gm5p(const int mu, Field &, const Field &v)
gamma_5 (1 - gamma_mu) v(x + mu) used in force calculation.
void(Fopr_Wilson_eo::* m_mult)(Field &, const Field &)
void gm5_dirac(Field &, const Field &)
Container of Field-type object.
Definition: field.h:45
void mult_xp2_thread(const int, double *, const double *, const int)
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void scal_impl(Field &, const double)
void DdagD(Field &v, const Field &f)
void Mdageo(Field &, const Field &, const int ieo)
void(Fopr_Wilson_eo::* m_D)(Field &, const Field &)
std::vector< double > m_boundary_each_node
b.c. for each node.
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void mult_tmb_chiral_thread(const int, double *, const double *, const int)
Class for parameters.
Definition: parameters.h:46
void mult_zp1_thread(const int, double *, const double *, const int)
void mult_zm(Field &, const Field &, const int ieo)
Even-odd site index.
Definition: index_eo.h:40
void mult_tp2_dirac_thread(const int, double *, const double *, const int)
void set_config(Field *U)
setting pointer to the gauge configuration.
void(Fopr_Wilson_eo::* m_postProp)(Field &, const Field &, const Field &)
void MeoMoe(Field &, const Field &)
std::vector< int > m_yzt_eo
void mult_xp1_thread(const int, double *, const double *, const int)
void mult_tp_dirac(Field &, const Field &, const int ieo)
void mult_ym1_thread(const int, double *, const double *, const int)
void Ddag(Field &v, const Field &f)
void Meo(Field &, const Field &, const int ieo)
void(Fopr_Wilson_eo::* m_gm5)(Field &, const Field &)
void gm5_dirac_thread(const int, double *, const double *)
void(Fopr_Wilson_eo::* m_gm5_self)(Field &)
void mult_xm1_thread(const int, double *, const double *, const int)
void mult_tpb_dirac_thread(const int, double *, const double *, const int)
void(Fopr_Wilson_eo::* m_mult_dag)(Field &, const Field &)
void mult_tm2_dirac_thread(const int, double *, const double *, const int)
void mult_tp2_chiral_thread(const int, double *, const double *, const int)
void mult_yp1_thread(const int, double *, const double *, const int)
Field m_w2
working field.
SU(N) gauge field.
Definition: field_G.h:38
void init(const std::string)
void mult_tm_chiral(Field &, const Field &, const int ieo)
void mult_zmb_thread(const int, double *, const double *, const int)
double flop_count()
this returns the number of floating point operations of Meo.
void mult_xm2_thread(const int, double *, const double *, const int)
double * vcp1_xp
arrays for data transfer.
pointer get() const
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void gm5_chiral(Field &, const Field &)
Base class of fermion operator family.
Definition: fopr_eo.h:34
void preProp(Field &Be, Field &bo, const Field &b)
Field_G * m_U
dummy: pointing m_Ueo.
void mult_tm1_dirac_thread(const int, double *, const double *, const int)
void mult_tpb_chiral_thread(const int, double *, const double *, const int)
void mult_tp_chiral(Field &, const Field &, const int ieo)
std::string m_repr
Dirac matrix representation.
void prePropDag(Field &, Field &, const Field &)
void mult_yp2_thread(const int, double *, const double *, const int)
void mult_tp1_chiral_thread(const int, double *, const double *, const int)
int field_nvol()
returns the volume for which the fermion operator is defined.
void(Fopr_Wilson_eo::* m_preProp)(Field &, Field &, const Field &)
void Meo_gm5(Field &, const Field &, const int ieo)
void D(Field &v, const Field &f)
std::vector< mult_arg > m_arg
std::vector< int > m_boundary
boundary condition.
void mult_tm2_chiral_thread(const int, double *, const double *, const int)
void mult_tm1_chiral_thread(const int, double *, const double *, const int)
std::string get_mode() const
only for Fopr_Overlap
void mult_gm5(Field &, const Field &)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void prePropD(Field &, Field &, const Field &)
void mult_zp(Field &, const Field &, const int ieo)
void mult_xmb_thread(const int, double *, const double *, const int)
void H(Field &v, const Field &f)
double m_kappa
hopping parameter.
void(Fopr_Wilson_eo::* m_mult_tm)(Field &, const Field &, const int ieo)
std::string m_mode
mult mode.
Base class of fermion operator family.
Definition: fopr.h:46
void mult_xpb_thread(const int, double *, const double *, const int)
void postPropDag(Field &, const Field &, const Field &)
void scal_thread(const int, double *, const double)
void mult_ym2_thread(const int, double *, const double *, const int)
void postProp(Field &x, const Field &xe, const Field &bo)
void set_parameters(const Parameters &params)
static const std::string class_name
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void mult_tmb_dirac_thread(const int, double *, const double *, const int)
void mult_ypb_thread(const int, double *, const double *, const int)
void mult_zm1_thread(const int, double *, const double *, const int)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).