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