Bridge++  Ver. 2.0.2
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:
44 
45  double m_kappa_s;
46  double m_kappa_t;
47  double m_nu_s;
48  double m_r_s;
49  double m_cSW_s;
50  double m_cSW_t;
51  std::vector<int> m_boundary;
52  std::string m_repr;
53  std::string m_mode;
54 
56 
59  const Field_G *m_U;
60 
61  // Fopr_Clover_imp* m_imp; //!< pimple prescription
63 
64  public:
67  : m_vl(CommonParameters::Vlevel())
68  {
69  init("Dirac");
70  }
71 
73  Fopr_CloverGeneral(const std::string repr)
74  : m_vl(CommonParameters::Vlevel())
75  {
76  init(repr);
77  }
78 
80  : m_vl(CommonParameters::Vlevel())
81  {
82  std::string repr = params.get_string("gamma_matrix_type");
83  init(repr);
84  set_parameters(params);
85  }
86 
88  {
89  tidyup();
90  }
91 
92  void set_parameters(const Parameters& params);
93  void set_parameters(const double kappa_s, const double kappa_t,
94  const double nu_s, const double r_s,
95  const double cSW_s, const double cSW_t,
96  const std::vector<int> bc);
97 
98  void get_parameters(Parameters& params) const;
99 
100  void set_config(Field *U)
101  {
102  m_U = (Field_G *)U;
103  m_fopr_w->set_config(U);
105  }
106 
107  void set_mode(const std::string mode);
108 
109  std::string get_mode() const
110  {
111  return m_mode;
112  }
113 
114  void mult(Field& v, const Field& f)
115  {
116  if (m_mode == "D") {
117  D(v, f);
118  } else if (m_mode == "Ddag") {
119  Ddag(v, f);
120  } else if (m_mode == "DdagD") {
121  DdagD(v, f);
122  } else if (m_mode == "DDdag") {
123  DDdag(v, f);
124  } else if (m_mode == "H") {
125  H(v, f);
126  } else {
127  vout.crucial(m_vl, "Error at %s: undefined mode = %s.\n", class_name.c_str(), m_mode.c_str());
128  exit(EXIT_FAILURE);
129  }
130  }
131 
132  void mult_dag(Field& v, const Field& f)
133  {
134  if (m_mode == "D") {
135  Ddag(v, f);
136  } else if (m_mode == "DdagD") {
137  DdagD(v, f);
138  } else if (m_mode == "Ddag") {
139  D(v, f);
140  } else if (m_mode == "H") {
141  H(v, f);
142  } else {
143  vout.crucial(m_vl, "Error at %s: undefined mode = %s.\n", class_name.c_str(), m_mode.c_str());
144  exit(EXIT_FAILURE);
145  }
146  }
147 
148  void D(Field&, const Field&);
149  void Ddag(Field&, const Field&);
150  void DdagD(Field&, const Field&);
151  void DDdag(Field&, const Field&);
152  void H(Field&, const Field&);
153 
154  void mult_gm5(Field& v, const Field& w)
155  {
156  m_fopr_w->mult_gm5(v, w);
157  }
158 
159  void mult_up(const int mu, Field& v, const Field& w)
160  {
161  m_fopr_w->mult_up(mu, v, w);
162  }
163 
164  void mult_dn(const int mu, Field& v, const Field& w)
165  {
166  m_fopr_w->mult_dn(mu, v, w);
167  }
168 
169  void mult_isigma(Field_F&, const Field_F&,
170  const int mu, const int nu);
171 
172  int field_nvol() { return m_Nvol; }
173  int field_nin() { return 2 * m_Nc * m_Nd; }
174  int field_nex() { return 1; }
175 
177  double flop_count();
178 
179  private:
180  void init(const std::string repr);
181  void tidyup();
182 
183 #ifdef USE_FACTORY
184  private:
185  static Fopr *create_object()
186  {
187  return new Fopr_CloverGeneral();
188  }
189 
190  static Fopr *create_object_with_arg(const std::string& repr)
191  {
192  return new Fopr_CloverGeneral(repr);
193  }
194 
195  static Fopr *create_object_with_params(const Parameters& params)
196  {
197  return new Fopr_CloverGeneral(params);
198  }
199 
200  public:
201  static bool register_factory()
202  {
203  bool init = true;
204  init &= Fopr::Factory_noarg::Register("CloverGeneral", create_object);
205  init &= Fopr::Factory_string::Register("CloverGeneral", create_object_with_arg);
206  init &= Fopr::Factory_params::Register("CloverGeneral", create_object_with_params);
207  return init;
208  }
209 #endif
210 };
211 #endif
Fopr_CloverGeneral::m_Nc
int m_Nc
Definition: fopr_CloverGeneral.h:55
bridgeIO.h
Org::Fopr_WilsonGeneral::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_WilsonGeneral_impl.h:96
Fopr_CloverGeneral::m_Nvol
int m_Nvol
Definition: fopr_CloverGeneral.h:55
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr
Definition: afopr.h:48
Fopr_CloverGeneral::mult
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field.
Definition: fopr_CloverGeneral.h:114
Fopr_CloverGeneral::set_mode
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_CloverGeneral.cpp:144
Fopr_CloverGeneral::m_v2
Field m_v2
working field.
Definition: fopr_CloverGeneral.h:62
Fopr_CloverGeneral::Fopr_CloverGeneral
Fopr_CloverGeneral(const Parameters &params)
Definition: fopr_CloverGeneral.h:79
Parameters
Class for parameters.
Definition: parameters.h:46
Fopr_CloverGeneral::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverGeneral.cpp:56
Fopr_CloverGeneral::m_Nd
int m_Nd
Definition: fopr_CloverGeneral.h:55
Fopr_CloverGeneral::H
void H(Field &, const Field &)
Definition: fopr_CloverGeneral.cpp:198
Fopr_CloverGeneral::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_CloverGeneral.h:172
Fopr_CloverGeneral::Fopr_CloverGeneral
DEPRECATED Fopr_CloverGeneral()
Definition: fopr_CloverGeneral.h:66
Org::Fopr_WilsonGeneral::mult_up
void mult_up(const int mu, Field &w, const Field &f)
upward nearest neighbor hopping term.
Definition: fopr_WilsonGeneral_impl.cpp:272
fopr_CloverTerm_General.h
Fopr_CloverGeneral::~Fopr_CloverGeneral
~Fopr_CloverGeneral()
Definition: fopr_CloverGeneral.h:87
Fopr_CloverGeneral::m_r_s
double m_r_s
spatial Wilson parameter
Definition: fopr_CloverGeneral.h:48
Fopr_CloverGeneral::m_kappa_t
double m_kappa_t
temporal hopping parameter
Definition: fopr_CloverGeneral.h:46
Fopr_CloverGeneral::m_v1
Field m_v1
Definition: fopr_CloverGeneral.h:62
Org::Fopr_WilsonGeneral::mult_dn
void mult_dn(const int mu, Field &w, const Field &f)
downward nearest neighbor hopping term.
Definition: fopr_WilsonGeneral_impl.cpp:305
Fopr_CloverGeneral::m_cSW_t
double m_cSW_t
temporal clover coefficient
Definition: fopr_CloverGeneral.h:50
Fopr_CloverGeneral::Ddag
void Ddag(Field &, const Field &)
Definition: fopr_CloverGeneral.cpp:169
Org::Fopr_CloverTerm_General
Definition: fopr_CloverTerm_General_impl.h:44
Fopr_CloverGeneral::mult_dag
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult.
Definition: fopr_CloverGeneral.h:132
Fopr_CloverGeneral::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverGeneral.cpp:89
Fopr_CloverGeneral::Fopr_CloverGeneral
DEPRECATED Fopr_CloverGeneral(const std::string repr)
Definition: fopr_CloverGeneral.h:73
Fopr_CloverGeneral::tidyup
void tidyup()
Definition: fopr_CloverGeneral.cpp:48
Fopr_CloverGeneral::m_U
const Field_G * m_U
gauge configuration (pointer)
Definition: fopr_CloverGeneral.h:59
Fopr_CloverGeneral::m_NinF
int m_NinF
internal parameters
Definition: fopr_CloverGeneral.h:55
Fopr_CloverGeneral::class_name
static const std::string class_name
Definition: fopr_CloverGeneral.h:40
Fopr_CloverGeneral::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_CloverGeneral.h:173
Fopr_CloverGeneral::m_fopr_csw
Fopr_CloverTerm_General * m_fopr_csw
Clover term operator.
Definition: fopr_CloverGeneral.h:58
Fopr_CloverGeneral::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_CloverGeneral.h:174
Fopr_CloverGeneral::m_kappa_s
double m_kappa_s
spatial hopping parameter
Definition: fopr_CloverGeneral.h:45
Fopr_CloverGeneral::m_nu_s
double m_nu_s
spatial anisotopy parameter
Definition: fopr_CloverGeneral.h:47
Fopr_CloverGeneral::mult_isigma
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
Definition: fopr_CloverGeneral.cpp:206
Fopr_CloverGeneral::m_cSW_s
double m_cSW_s
spatial clover coefficient
Definition: fopr_CloverGeneral.h:49
Fopr_CloverGeneral
Clover general fermion operator.
Definition: fopr_CloverGeneral.h:37
Fopr_CloverGeneral::mult_gm5
void mult_gm5(Field &v, const Field &w)
multiplies gamma_5 matrix.
Definition: fopr_CloverGeneral.h:154
Fopr_CloverGeneral::m_Ndim
int m_Ndim
Definition: fopr_CloverGeneral.h:55
Fopr_CloverGeneral::mult_dn
void mult_dn(const int mu, Field &v, const Field &w)
downward nearest neighbor hopping term.
Definition: fopr_CloverGeneral.h:164
Fopr_CloverGeneral::m_repr
std::string m_repr
gamma matrix representation
Definition: fopr_CloverGeneral.h:52
Fopr_CloverGeneral::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_CloverGeneral.h:100
Org::Fopr_WilsonGeneral
Definition: fopr_WilsonGeneral_impl.h:36
Fopr_CloverGeneral::m_fopr_w
Fopr_WilsonGeneral * m_fopr_w
Wilson fermion kernel.
Definition: fopr_CloverGeneral.h:57
Org::Fopr_CloverTerm_General::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_CloverTerm_General_impl.cpp:94
Fopr_CloverGeneral::get_mode
std::string get_mode() const
Definition: fopr_CloverGeneral.h:109
Fopr_CloverGeneral::m_boundary
std::vector< int > m_boundary
boundary conditions
Definition: fopr_CloverGeneral.h:51
Fopr_CloverGeneral::init
void init(const std::string repr)
Definition: fopr_CloverGeneral.cpp:25
fopr_WilsonGeneral.h
Fopr_CloverGeneral::DdagD
void DdagD(Field &, const Field &)
Definition: fopr_CloverGeneral.cpp:178
Fopr_CloverGeneral::DDdag
void DDdag(Field &, const Field &)
Definition: fopr_CloverGeneral.cpp:188
Field_F
Wilson-type fermion field.
Definition: field_F.h:37
Parameters::get_string
string get_string(const string &key) const
Definition: parameters.cpp:221
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Fopr_CloverGeneral::m_mode
std::string m_mode
mode of multiplication
Definition: fopr_CloverGeneral.h:53
Field
Container of Field-type object.
Definition: field.h:46
Fopr_CloverGeneral::mult_up
void mult_up(const int mu, Field &v, const Field &w)
upward nearest neighbor hopping term.
Definition: fopr_CloverGeneral.h:159
Fopr_CloverGeneral::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: fopr_CloverGeneral.cpp:214
Fopr_CloverGeneral::D
void D(Field &, const Field &)
Definition: fopr_CloverGeneral.cpp:156
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Fopr_CloverGeneral::m_vl
Bridge::VerboseLevel m_vl
Definition: fopr_CloverGeneral.h:43
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Org::Fopr_WilsonGeneral::mult_gm5
void mult_gm5(Field &v, const Field &f)
multiplies gamma_5 matrix.
Definition: fopr_WilsonGeneral_impl.cpp:204