Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Clover_eo.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVER_EO_INCLUDED
15 #define FOPR_CLOVER_EO_INCLUDED
16 
17 #include "fopr_Wilson_eo.h"
18 #include "fopr_CloverTerm_eo.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
23 
25 
40 class Fopr_Clover_eo : public Fopr_eo
41 {
42  public:
43  static const std::string class_name;
44 
45  private:
48 
49  double m_kappa;
50  double m_cSW;
51  std::vector<int> m_boundary;
52 
53  std::string m_mode;
54 
57 
60 
63 
64  void (Fopr_Clover_eo::*m_mult)(Field&, const Field&);
65  void (Fopr_Clover_eo::*m_mult_dag)(Field&, const Field&);
66  void (Fopr_Clover_eo::*m_preProp)(Field&, Field&, const Field&);
67  void (Fopr_Clover_eo::*m_postProp)(Field&, const Field&, const Field&);
68 
69  public:
70  Fopr_Clover_eo(const std::string repr) { init(repr); }
71 
73 
74  void set_parameters(const Parameters& params);
75  void set_parameters(const double kappa, const double cSW,
76  const std::vector<int> bc);
77 
78  void set_config(Field *U);
79 
81  {
82  set_config(U.get());
83  }
84 
85  void set_mode(const std::string mode)
86  {
87  m_mode = mode;
88 
89  if (m_mode == "D") {
94  } else if (m_mode == "Ddag") {
99  } else if (m_mode == "DdagD") {
102  } else if (m_mode == "DDdag") {
105  } else if (m_mode == "H") {
108  } else {
109  vout.crucial("Error at %s: undefined mode = %s\n", class_name.c_str(), mode.c_str());
110  exit(EXIT_FAILURE);
111  }
112  }
113 
114  std::string get_mode() const
115  { return m_mode; }
116 
117  void mult(Field& v, const Field& f)
118  { (this->*m_mult)(v, f); }
119 
120  void mult_dag(Field& v, const Field& f)
121  { (this->*m_mult_dag)(v, f); }
122 
123  //- method for even odd fermion operator
124  void preProp(Field& Be, Field& bo, const Field& b)
125  { (this->*m_preProp)(Be, bo, b); }
126 
127  void postProp(Field& x, const Field& xe, const Field& bo)
128  { (this->*m_postProp)(x, xe, bo); }
129 
130  void prePropD(Field&, Field&, const Field&);
131  void postPropD(Field&, const Field&, const Field&);
132  void prePropDag(Field&, Field&, const Field&);
133  void postPropDag(Field&, const Field&, const Field&);
134 
135  const Field_F mult_csw_inv(const Field_F&, const int ieo);
136 
137  void D(Field& v, const Field& f);
138  void Ddag(Field& v, const Field& f);
139  void DdagD(Field& v, const Field& f);
140  void DDdag(Field& v, const Field& f);
141  void H(Field& v, const Field& f);
142  void mult_gm5(Field& v, const Field& f);
143  void MeoMoe(Field& v, const Field& f);
144 
145  // ieo=0: even <-- odd
146  // ieo=1: odd <-- even
147  void Meo(Field&, const Field&, const int ieo);
148  void Meo_gm5(Field_F&, const Field_F&, const int ieo);
149  void Mdageo(Field_F&, const Field_F&, const int ieo);
150 
151  void mult_isigma(Field_F& w, const Field_F& f,
152  const int mu, const int nu);
153 
154  inline std::vector<double> csmatrix(const int& site)
155  { return m_fopr_csw->csmatrix(site); }
156 
157  int field_nvol() { return m_Nvol; }
158  int field_nin() { return 2 * m_Nc * m_Nd; }
159  int field_nex() { return 1; }
160 
162  double flop_count();
163 
164  private:
165  void init(const std::string repr);
166  void tidyup();
167 
168 #ifdef USE_FACTORY
169  private:
170  static Fopr *create_object_with_repr(const std::string& repr)
171  {
172  return new Fopr_Clover_eo(repr);
173  }
174 
175  public:
176  static bool register_factory()
177  {
178  return Fopr::Factory_string::Register("Clover_eo", create_object_with_repr);
179  }
180 #endif
181 };
182 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
void mult_isigma(Field_F &w, const Field_F &f, const int mu, const int nu)
std::vector< double > csmatrix(const int &site)
void MeoMoe(Field &v, const Field &f)
void set_parameters(const Parameters &params)
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
std::string get_mode() const
only for Fopr_Overlap
double flop_count()
this returns the number of floating point operations.
double m_cSW
clover coefficient.
void postProp(Field &x, const Field &xe, const Field &bo)
Container of Field-type object.
Definition: field.h:45
int field_nvol()
returns the volume for which the fermion operator is defined.
std::vector< int > m_boundary
boundary condition.
void init(const std::string repr)
void(Fopr_Clover_eo::* m_preProp)(Field &, Field &, const Field &)
void Mdageo(Field_F &, const Field_F &, const int ieo)
std::vector< double > csmatrix(const int &)
void(Fopr_Clover_eo::* m_mult)(Field &, const Field &)
Class for parameters.
Definition: parameters.h:46
std::string m_mode
Even-odd site index.
Definition: index_eo.h:40
void H(Field &v, const Field &f)
Field_F m_vF3
working field.
void prePropDag(Field &, Field &, const Field &)
Wilson-type fermion field.
Definition: field_F.h:37
void DdagD(Field &v, const Field &f)
void postPropDag(Field &, const Field &, const Field &)
static const std::string class_name
void Meo(Field &, const Field &, const int ieo)
void(Fopr_Clover_eo::* m_mult_dag)(Field &, const Field &)
SU(N) gauge field.
Definition: field_G.h:38
Field m_w1
working field.
void DDdag(Field &v, const Field &f)
void Meo_gm5(Field_F &, const Field_F &, const int ieo)
Even-odd Clover fermion operator.
pointer get() const
Base class of fermion operator family.
Definition: fopr_eo.h:34
void set_config(unique_ptr< Field_G > &U)
Fopr_Clover_eo(const std::string repr)
Fopr_Wilson_eo * m_fopr_w
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void preProp(Field &Be, Field &bo, const Field &b)
double m_kappa
hopping parameter.
void set_config(Field *U)
setting pointer to the gauge configuration.
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void D(Field &v, const Field &f)
Fopr_CloverTerm_eo * m_fopr_csw
void Ddag(Field &v, const Field &f)
void(Fopr_Clover_eo::* m_postProp)(Field &, const Field &, const Field &)
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Field_G * m_Ueo
const Field_F mult_csw_inv(const Field_F &, const int ieo)
Base class of fermion operator family.
Definition: fopr.h:46
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void prePropD(Field &, Field &, const Field &)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void postPropD(Field &, const Field &, const Field &)