Bridge++  Ver.2.1.3
afopr_Domainwall_eo.h
Go to the documentation of this file.
1 
14 #ifndef AFOPR_DOMAINWALL_EO_INCLUDED
15 #define AFOPR_DOMAINWALL_EO_INCLUDED
16 
17 #include <vector>
18 #include <string>
19 
20 #include "lib/Fopr/afopr_eo.h"
22 #include "lib/IO/bridgeIO.h"
23 using Bridge::vout;
24 
25 class Field;
26 class Field_G;
27 template<typename AFIELD>
29 
31 
40 template<typename AFIELD>
41 class AFopr_Domainwall_eo : public AFopr_eo<AFIELD>
42 {
43  public:
44  typedef typename AFIELD::real_t real_t;
45  static const std::string class_name;
46 
47  private:
48  // parameters common to overlap fermion
51  int m_Ns;
52  std::vector<int> m_boundary;
53  std::vector<real_t> m_b;
54  std::vector<real_t> m_c;
56  std::string m_repr;
57  std::string m_kernel_type;
59 
60  std::string m_mode;
61 
62  int m_NinF;
63  int m_Nvol;
64  int m_Nvol2;
65  int m_Ndim;
66 
68 
70 
73 
74  // for convert and reverse
77 
78  // for preconditioning
79  std::vector<real_t> m_dp;
80  std::vector<real_t> m_dm;
81  std::vector<real_t> m_e;
82  std::vector<real_t> m_f;
84 
86  void init(const Parameters& params);
87 
89  void tidyup();
90 
91  public:
94  : AFopr_eo<AFIELD>()
95  { init(params); }
96 
99 
100  void set_parameters(const Parameters& params);
101 
103  void set_parameters(const real_t mq, const real_t M0,
104  const int Ns, const std::vector<int> bc,
105  const real_t b, const real_t c,
106  const real_t alpha);
107 
109  void get_parameters(Parameters& params) const;
110 
112  void set_kernel_parameters(const Parameters& params);
113 
115  void set_precond_parameters();
116 
118  void set_coefficients(const std::vector<real_t> b,
119  const std::vector<real_t> c);
120 
122  bool needs_convert() { return m_foprw->needs_convert(); }
123 
125  void convert(AFIELD&, const Field&);
126 
128  void reverse(Field&, const AFIELD&);
129 
130  void set_config(Field *U) { m_foprw->set_config(U); }
131 
132  void set_config(unique_ptr<Field_G>& U)
133  { m_foprw->set_config(U.get()); }
134 
135  void set_mode(std::string mode);
136 
137  std::string get_mode() const { return m_mode; }
138 
139  // methods for even odd fermion operator
140  void preProp(AFIELD& Be, AFIELD& bo, const AFIELD& b);
141 
142  void postProp(AFIELD& x, const AFIELD& xe, const AFIELD& bo);
143 
144  void mult(AFIELD& v, const AFIELD& w);
145 
146  void mult_dag(AFIELD& v, const AFIELD& w);
147 
148  void mult(AFIELD& v, const AFIELD& w, const std::string mode);
149 
150  void mult_dag(AFIELD& v, const AFIELD& w, const std::string mode);
151 
152  void mult_gm5(AFIELD& v, const AFIELD& w);
153 
154  void mult_gm5_4d(AFIELD& v, const AFIELD& w);
155 
156 
157  void DdagD(AFIELD&, const AFIELD&);
158  void D(AFIELD&, const AFIELD&);
159  void Ddag(AFIELD&, const AFIELD&);
160  void H(AFIELD&, const AFIELD&);
161  void Hdag(AFIELD&, const AFIELD&);
162 
163  void D_ee(AFIELD&, const AFIELD&, const int ieo);
164  void D_eo(AFIELD&, const AFIELD&, const int ieo);
165  void Ddag_eo(AFIELD&, const AFIELD&, const int ieo);
166  void Ddag_ee(AFIELD&, const AFIELD&, const int ieo);
167 
168  void mult_gm5R(AFIELD&, const AFIELD&);
169  void mult_R(AFIELD&, const AFIELD&);
170 
171  // preconditioner
172  void L_inv(AFIELD&, const AFIELD&);
173  void U_inv(AFIELD&, const AFIELD&);
174  void Ldag_inv(AFIELD&, const AFIELD&);
175  void Udag_inv(AFIELD&, const AFIELD&);
176 
177  int field_nin() { return m_NinF; }
178  int field_nvol() { return m_Nvol2; }
179  int field_nex() { return m_Ns; }
180 
182  double flop_count() { return flop_count(m_mode); }
183 
185  double flop_count(std::string mode);
186 
187 
188 #ifdef USE_FACTORY
189  private:
190  static AFopr<AFIELD> *create_object_with_params(const Parameters& params)
191  { return new AFopr_Domainwall_eo(params); }
192 
193  public:
194  static bool register_factory()
195  {
197  "Domainwall_eo", create_object_with_params);
198  return init1;
199  }
200 #endif
201 };
202 
203 #endif
AFopr_Domainwall_eo::m_Nvol2
int m_Nvol2
volume size of even or odd vector.
Definition: afopr_Domainwall_eo.h:64
AFopr_Domainwall_eo::preProp
void preProp(AFIELD &Be, AFIELD &bo, const AFIELD &b)
Definition: afopr_Domainwall_eo-tmpl.h:522
AFopr_Domainwall_eo::Udag_inv
void Udag_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:1116
bridgeIO.h
AFopr_Domainwall_eo::m_Nvol
int m_Nvol
volume size of even or odd vector.
Definition: afopr_Domainwall_eo.h:63
AFopr_Domainwall_eo::init
void init(const Parameters &params)
initial setup.
Definition: afopr_Domainwall_eo-tmpl.h:27
AFopr_Domainwall_eo::flop_count
double flop_count()
this returns the number of floating point number operations.
Definition: afopr_Domainwall_eo.h:182
AFopr_Domainwall_eo::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Domainwall_eo-tmpl.h:102
AFopr_Domainwall_eo::H
void H(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:627
AFopr_Domainwall_eo::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:610
AFopr
Definition: afopr.h:48
AFopr_Domainwall_eo::m_boundary
std::vector< int > m_boundary
boundary conditions
Definition: afopr_Domainwall_eo.h:52
AFopr_Domainwall_eo::Hdag
void Hdag(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:667
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_eo
Base class of fermion operator family.
Definition: afopr_eo.h:35
AFopr_Domainwall_eo::D_ee
void D_ee(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_eo-tmpl.h:892
AFopr_Domainwall_eo::m_y4
AFIELD m_y4
Definition: afopr_Domainwall_eo.h:72
AFopr_Domainwall_eo::m_v1
AFIELD m_v1
Definition: afopr_Domainwall_eo.h:71
AFopr_Domainwall_eo::m_kernel_type
std::string m_kernel_type
Wilson kernel type.
Definition: afopr_Domainwall_eo.h:57
AFopr_Domainwall_eo::m_v4
AFIELD m_v4
Definition: afopr_Domainwall_eo.h:72
AFopr_Domainwall_eo::mult_R
void mult_R(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:721
AFopr_Domainwall_eo::m_v2
AFIELD m_v2
woking 5d vectors.
Definition: afopr_Domainwall_eo.h:71
AFopr_Domainwall_eo::m_f
std::vector< real_t > m_f
Definition: afopr_Domainwall_eo.h:82
AFopr_Domainwall_eo::field_nin
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Definition: afopr_Domainwall_eo.h:177
AFopr_Domainwall_eo::Ddag_eo
void Ddag_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_eo-tmpl.h:822
AFopr_Domainwall_eo::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: afopr_Domainwall_eo.h:58
AFopr_Domainwall_eo::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:582
AFopr_Domainwall_eo::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:647
AFopr_Domainwall_eo::mult
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field (2nd argument)
Definition: afopr_Domainwall_eo-tmpl.h:392
AFopr_Domainwall_eo::get_parameters
void get_parameters(Parameters &params) const
set parameters of kernel operaotr.
Definition: afopr_Domainwall_eo-tmpl.h:167
Field::real_t
double real_t
Definition: field.h:51
AFopr_Domainwall_eo
Domain-wall fermion operator with even-odd site index.
Definition: afopr_Domainwall_eo.h:41
AFopr_Domainwall_eo::m_t4
AFIELD m_t4
woking 4d vectors.
Definition: afopr_Domainwall_eo.h:72
AFopr_Domainwall_eo::m_g
real_t m_g
Definition: afopr_Domainwall_eo.h:83
AFopr_Domainwall_eo::mult_gm5R
void mult_gm5R(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:738
AFopr_Domainwall_eo::set_config
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: afopr_Domainwall_eo.h:130
AFopr_Domainwall_eo::m_w4lex
Field m_w4lex
Definition: afopr_Domainwall_eo.h:75
AFopr_Domainwall_eo::Ddag_ee
void Ddag_ee(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_eo-tmpl.h:953
AFopr_Domainwall_eo::m_alpha
real_t m_alpha
Neff's improving parameter.
Definition: afopr_Domainwall_eo.h:55
AFopr_Domainwall_eo::m_dm
std::vector< real_t > m_dm
Definition: afopr_Domainwall_eo.h:80
AFopr_Domainwall_eo::field_nex
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Definition: afopr_Domainwall_eo.h:179
AFopr_Domainwall_eo::set_precond_parameters
void set_precond_parameters()
set parameters for preconditioning.
Definition: afopr_Domainwall_eo-tmpl.h:269
AFopr_Domainwall_eo::set_coefficients
void set_coefficients(const std::vector< real_t > b, const std::vector< real_t > c)
set coefficients if they depend in s.
Definition: afopr_Domainwall_eo-tmpl.h:307
AFopr_Domainwall_eo::m_NinF
int m_NinF
on-site d.o.f.
Definition: afopr_Domainwall_eo.h:62
AFopr_Domainwall_eo::class_name
static const std::string class_name
Definition: afopr_Domainwall_eo.h:45
AFopr_Domainwall_eo::m_Ns
int m_Ns
size of fifth-dimension
Definition: afopr_Domainwall_eo.h:51
AFopr_Domainwall_eo::m_Ndim
int m_Ndim
spacetime dimensions
Definition: afopr_Domainwall_eo.h:65
AFopr_Domainwall_eo::needs_convert
bool needs_convert()
this class needs convert of fermion field.
Definition: afopr_Domainwall_eo.h:122
AFopr_Domainwall_eo::m_b
std::vector< real_t > m_b
Definition: afopr_Domainwall_eo.h:53
AFopr_Domainwall_eo::set_mode
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: afopr_Domainwall_eo-tmpl.h:378
AFopr_Domainwall_eo::mult_gm5
void mult_gm5(AFIELD &v, const AFIELD &w)
multiplies gamma_5 matrix.
Definition: afopr_Domainwall_eo-tmpl.h:689
AFopr_Domainwall_eo::m_mq
real_t m_mq
quark mass
Definition: afopr_Domainwall_eo.h:49
AFopr_Domainwall_eo::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Domainwall_eo.h:137
real_t
double real_t
Definition: bridgeACC_AField_double.cpp:14
AFopr_Domainwall_eo::m_dp
std::vector< real_t > m_dp
Definition: afopr_Domainwall_eo.h:79
AFopr_Domainwall_eo::m_e
std::vector< real_t > m_e
Definition: afopr_Domainwall_eo.h:81
AFopr_Domainwall_eo::Ldag_inv
void Ldag_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:1187
AFopr_Domainwall_eo::m_M0
real_t m_M0
domain-wall height
Definition: afopr_Domainwall_eo.h:50
AFopr_Domainwall_eo::reverse
void reverse(Field &, const AFIELD &)
reverse AField to Field.
Definition: afopr_Domainwall_eo-tmpl.h:355
AFopr_Domainwall_eo::L_inv
void L_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:1014
AFopr_Domainwall_eo::m_repr
std::string m_repr
gamma matrix representation
Definition: afopr_Domainwall_eo.h:56
AFopr_Domainwall_eo::~AFopr_Domainwall_eo
~AFopr_Domainwall_eo()
destructor.
Definition: afopr_Domainwall_eo.h:98
afopr_eo.h
AFopr_Domainwall_eo::set_config
void set_config(unique_ptr< Field_G > &U)
Definition: afopr_Domainwall_eo.h:132
AFopr_Domainwall_eo::m_mode
std::string m_mode
Definition: afopr_Domainwall_eo.h:60
AFopr_Domainwall_eo::m_c
std::vector< real_t > m_c
Definition: afopr_Domainwall_eo.h:54
AFopr_Domainwall_eo::m_w4
AFIELD m_w4
Definition: afopr_Domainwall_eo.h:72
commonParameters.h
AFopr_Domainwall_eo::set_kernel_parameters
void set_kernel_parameters(const Parameters &params)
set parameters of kernel operaotr.
Definition: afopr_Domainwall_eo-tmpl.h:252
AFopr_Domainwall_eo::D_eo
void D_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_eo-tmpl.h:757
AFopr_Domainwall_eo::U_inv
void U_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:1059
AFopr_Domainwall_eo::m_foprw
AFopr< AFIELD > * m_foprw
Definition: afopr_Domainwall_eo.h:69
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:45
Field_G
SU(N) gauge field.
Definition: field_G.h:38
AFopr_Domainwall_eo::field_nvol
int field_nvol()
returns the volume for which the fermion operator is defined.
Definition: afopr_Domainwall_eo.h:178
AFopr_Domainwall_eo::postProp
void postProp(AFIELD &x, const AFIELD &xe, const AFIELD &bo)
Definition: afopr_Domainwall_eo-tmpl.h:549
AFopr_Domainwall_eo::convert
void convert(AFIELD &, const Field &)
convert Field to AField for this class.
Definition: afopr_Domainwall_eo-tmpl.h:332
AFopr_Domainwall_eo::m_v4lex
AFIELD m_v4lex
Definition: afopr_Domainwall_eo.h:76
AFopr_Domainwall_eo::m_w1
AFIELD m_w1
Definition: afopr_Domainwall_eo.h:71
AFopr_Domainwall_eo::mult_gm5_4d
void mult_gm5_4d(AFIELD &v, const AFIELD &w)
Definition: afopr_Domainwall_eo-tmpl.h:712
AFopr_Domainwall_eo::m_index_eo
Index_eo_Domainwall< AFIELD > * m_index_eo
Definition: afopr_Domainwall_eo.h:67
AFopr_Domainwall_eo::AFopr_Domainwall_eo
AFopr_Domainwall_eo(const Parameters &params)
constructor.
Definition: afopr_Domainwall_eo.h:93
AFopr_Domainwall_eo::tidyup
void tidyup()
final tidyup.
Definition: afopr_Domainwall_eo-tmpl.h:93
AFopr_Domainwall_eo::mult_dag
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult(Field&, const Field&).
Definition: afopr_Domainwall_eo-tmpl.h:429
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:572
AFopr_Domainwall_eo::real_t
AFIELD::real_t real_t
Definition: afopr_Domainwall_eo.h:44
Index_eo_Domainwall
Definition: afopr_Domainwall_eo.h:28