Bridge++  Version 1.5.4
 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 "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
42 class Fopr_Clover : public Fopr
43 {
44  public:
45  static const std::string class_name;
46 
47  private:
48  double m_kappa;
49  double m_cSW;
50  std::vector<int> m_boundary;
51  std::string m_repr;
52  std::string m_mode;
53 
55 
58  const Field_G *m_U;
59 
60  // Fopr_Clover_imp* m_imp; //!< pimple prescription
62 
63  public:
65  : Fopr()
66  {
67  init("Dirac");
68  }
69 
70  Fopr_Clover(const std::string repr)
71  : Fopr()
72  {
73  init(repr);
74  }
75 
77  {
78  tidyup();
79  }
80 
81  void set_parameters(const Parameters& params);
82  void set_parameters(const double kappa, const double cSW, const std::vector<int> bc);
83 
84  void set_config(Field *U)
85  {
86  m_U = (Field_G *)U;
87  m_fopr_w->set_config(U);
89  }
90 
92  {
93  m_U = U.get();
94  m_fopr_w->set_config(U.get());
96  }
97 
98  void set_mode(const std::string mode)
99  {
100  m_mode = mode;
101  }
102 
103  std::string get_mode() const
104  {
105  return m_mode;
106  }
107 
108  void mult(Field& v, const Field& f)
109  {
110  if (m_mode == "D") {
111  D(v, f);
112  } else if (m_mode == "Ddag") {
113  Ddag(v, f);
114  } else if (m_mode == "DdagD") {
115  DdagD(v, f);
116  } else if (m_mode == "DDdag") {
117  DDdag(v, f);
118  } else if (m_mode == "H") {
119  H(v, f);
120  } else {
121  vout.crucial(m_vl, "Error at %s: undefined mode = %s.\n", class_name.c_str(), m_mode.c_str());
122  exit(EXIT_FAILURE);
123  }
124  }
125 
126  void mult_dag(Field& v, const Field& f)
127  {
128  if (m_mode == "D") {
129  Ddag(v, f);
130  } else if (m_mode == "DdagD") {
131  DdagD(v, f);
132  } else if (m_mode == "Ddag") {
133  D(v, f);
134  } else if (m_mode == "H") {
135  H(v, f);
136  } else {
137  vout.crucial(m_vl, "Error at %s: undefined mode = %s.\n", class_name.c_str(), m_mode.c_str());
138  exit(EXIT_FAILURE);
139  }
140  }
141 
142  void D(Field&, const Field&);
143  void Ddag(Field&, const Field&);
144  void DdagD(Field&, const Field&);
145  void DDdag(Field&, const Field&);
146  void H(Field&, const Field&);
147 
148  void mult_gm5(Field& v, const Field& w)
149  {
150  m_fopr_w->mult_gm5(v, w);
151  }
152 
153  void mult_up(const int mu, Field& v, const Field& w)
154  {
155  m_fopr_w->mult_up(mu, v, w);
156  }
157 
158  void mult_dn(const int mu, Field& v, const Field& w)
159  {
160  m_fopr_w->mult_dn(mu, v, w);
161  }
162 
163  void mult_isigma(Field_F&, const Field_F&,
164  const int mu, const int nu);
165 
166  int field_nvol() { return m_Nvol; }
167  int field_nin() { return 2 * m_Nc * m_Nd; }
168  int field_nex() { return 1; }
169 
171  double flop_count();
172 
173  private:
174  void init(const std::string repr);
175  void tidyup();
176 
177 #ifdef USE_FACTORY
178  private:
179  static Fopr *create_object()
180  {
181  return new Fopr_Clover();
182  }
183 
184  static Fopr *create_object_with_arg(const std::string& repr)
185  {
186  return new Fopr_Clover(repr);
187  }
188 
189  public:
190  static bool register_factory()
191  {
192  bool init1 = Fopr::Factory_noarg::Register("Clover", create_object);
193  bool init2 = Fopr::Factory_string::Register("Clover", create_object_with_arg);
194 
195  return init1 && init2;
196  }
197 #endif
198 };
199 #endif
void DDdag(Field &, const Field &)
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_config(Field *U)
setting pointer to the gauge configuration.
void set_config(unique_ptr< Field_G > &U)
Definition: fopr_Clover.h:91
const Field_G * m_U
gauge configuration (pointer)
Definition: fopr_Clover.h:58
void tidyup()
Definition: fopr_Clover.cpp:48
void mult_up(const int mu, Field &v, const Field &w)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
Definition: fopr_Clover.h:153
void set_config(Field *U)
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:45
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Definition: fopr_Clover.h:108
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void DdagD(Field &, const Field &)
Fopr_Clover(const std::string repr)
Definition: fopr_Clover.h:70
void mult_dn(const int mu, Field &v, const Field &w)
Definition: fopr_Clover.h:158
Class for parameters.
Definition: parameters.h:46
std::vector< int > m_boundary
boundary conditions
Definition: fopr_Clover.h:50
void H(Field &, const Field &)
std::string m_mode
mode of multiplication
Definition: fopr_Clover.h:52
Wilson-type fermion field.
Definition: field_F.h:37
Clover fermion operator.
Definition: fopr_Clover.h:42
std::string m_repr
gamma matrix representation
Definition: fopr_Clover.h:51
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
void mult_dn(const int mu, Field &w, const Field &f)
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: fopr_Clover.h:84
SU(N) gauge field.
Definition: field_G.h:38
double m_cSW
clover coefficient
Definition: fopr_Clover.h:49
double m_kappa
hopping parameter
Definition: fopr_Clover.h:48
Bridge::VerboseLevel m_vl
Definition: fopr.h:127
Fopr_Wilson * m_fopr_w
Wilson fermion kernel.
Definition: fopr_Clover.h:56
static const std::string class_name
Definition: fopr_Clover.h:45
pointer get() const
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Definition: fopr_Clover.h:168
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
Definition: fopr_Clover.h:148
void D(Field &, const Field &)
Field m_v1
Definition: fopr_Clover.h:61
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Definition: fopr_Clover.h:167
void mult_up(const int mu, Field &w, const Field &f)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_Clover.h:98
Fopr_CloverTerm * m_fopr_csw
Clover term operator.
Definition: fopr_Clover.h:57
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
Definition: fopr_Clover.h:126
int m_NinF
internal parameters
Definition: fopr_Clover.h:54
void Ddag(Field &, const Field &)
int field_nvol()
returns the volume for which the fermion operator is defined.
Definition: fopr_Clover.h:166
Field m_v2
working field.
Definition: fopr_Clover.h:61
Base class of fermion operator family.
Definition: fopr.h:46
double flop_count()
this returns the number of floating point operations.
std::string get_mode() const
only for Fopr_Overlap
Definition: fopr_Clover.h:103
void init(const std::string repr)
Definition: fopr_Clover.cpp:25
void set_parameters(const Parameters &params)
Definition: fopr_Clover.cpp:56