Bridge++  Ver. 2.0.2
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;
55  std::string m_mode;
56 
58 
59  int m_NinF;
60  int m_Nvol;
61  int m_Nvol2;
62  int m_Ndim;
63 
65 
67 
70 
71  // for convert and reverse
74 
75 
76  // for preconditioning
77  std::vector<real_t> m_dp;
78  std::vector<real_t> m_dm;
79  std::vector<real_t> m_e;
80  std::vector<real_t> m_f;
82 
84  void init(const Parameters& params);
85 
87  void tidyup();
88 
89  public:
92  : AFopr_eo<AFIELD>()
93  { init(params); }
94 
97 
98  void set_parameters(const Parameters& params);
99 
101  void set_parameters(const real_t mq, const real_t M0,
102  const int Ns, const std::vector<int> bc,
103  const real_t b, const real_t c);
104 
106  void set_kernel_parameters(const Parameters& params);
107 
109  void set_precond_parameters();
110 
112  void set_coefficients(const std::vector<real_t> b,
113  const std::vector<real_t> c);
114 
116  bool needs_convert() { return m_foprw->needs_convert(); }
117 
119  void convert(AFIELD&, const Field&);
120 
122  void reverse(Field&, const AFIELD&);
123 
124  void set_config(Field *U) { m_foprw->set_config(U); }
125 
126  void set_config(unique_ptr<Field_G>& U)
127  { m_foprw->set_config(U.get()); }
128 
129  void set_mode(std::string mode);
130 
131  std::string get_mode() const { return m_mode; }
132 
133  // methods for even odd fermion operator
134  void preProp(AFIELD& Be, AFIELD& bo, const AFIELD& b);
135 
136  void postProp(AFIELD& x, const AFIELD& xe, const AFIELD& bo);
137 
138  void mult(AFIELD& v, const AFIELD& w);
139 
140  void mult_dag(AFIELD& v, const AFIELD& w);
141 
142  void mult(AFIELD& v, const AFIELD& w, const std::string mode);
143 
144  void mult_gm5(AFIELD& v, const AFIELD& w);
145 
146  void mult_gm5_4d(AFIELD& v, const AFIELD& w);
147 
148 
149  void DdagD(AFIELD&, const AFIELD&);
150  void D(AFIELD&, const AFIELD&);
151  void Ddag(AFIELD&, const AFIELD&);
152  void H(AFIELD&, const AFIELD&);
153  void Hdag(AFIELD&, const AFIELD&);
154 
155  void D_ee(AFIELD&, const AFIELD&, const int ieo);
156  void D_eo(AFIELD&, const AFIELD&, const int ieo);
157  void Ddag_eo(AFIELD&, const AFIELD&, const int ieo);
158 
159  void mult_gm5R(AFIELD&, const AFIELD&);
160  void mult_R(AFIELD&, const AFIELD&);
161 
162  // preconditioner
163  void L_inv(AFIELD&, const AFIELD&);
164  void U_inv(AFIELD&, const AFIELD&);
165  void Ldag_inv(AFIELD&, const AFIELD&);
166  void Udag_inv(AFIELD&, const AFIELD&);
167 
168  int field_nin() { return m_NinF; }
169  int field_nvol() { return m_Nvol2; }
170  int field_nex() { return m_Ns; }
171 
173  double flop_count() { return flop_count(m_mode); }
174 
176  double flop_count(std::string mode);
177 
178 
179 #ifdef USE_FACTORY
180  private:
181  static AFopr<AFIELD> *create_object_with_params(const Parameters& params)
182  { return new AFopr_Domainwall_eo(params); }
183 
184  public:
185  static bool register_factory()
186  {
188  "Domainwall_eo", create_object_with_params);
189  return init1;
190  }
191 #endif
192 };
193 
194 #endif
AFopr_Domainwall_eo::m_Nvol2
int m_Nvol2
volume size of even or odd vector.
Definition: afopr_Domainwall_eo.h:61
AFopr_Domainwall_eo::preProp
void preProp(AFIELD &Be, AFIELD &bo, const AFIELD &b)
Definition: afopr_Domainwall_eo-tmpl.h:398
AFopr_Domainwall_eo::Udag_inv
void Udag_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:847
bridgeIO.h
AFopr_Domainwall_eo::m_Nvol
int m_Nvol
volume size of even or odd vector.
Definition: afopr_Domainwall_eo.h:60
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:173
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:101
AFopr_Domainwall_eo::H
void H(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:502
AFopr_Domainwall_eo::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:485
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:542
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:725
AFopr_Domainwall_eo::m_y4
AFIELD m_y4
Definition: afopr_Domainwall_eo.h:69
AFopr_Domainwall_eo::m_v1
AFIELD m_v1
Definition: afopr_Domainwall_eo.h:68
AFopr_Domainwall_eo::m_v4
AFIELD m_v4
Definition: afopr_Domainwall_eo.h:69
AFopr_Domainwall_eo::mult_R
void mult_R(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:596
AFopr_Domainwall_eo::m_v2
AFIELD m_v2
woking 5d vectors.
Definition: afopr_Domainwall_eo.h:68
AFopr_Domainwall_eo::m_f
std::vector< real_t > m_f
Definition: afopr_Domainwall_eo.h:80
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:168
AFopr_Domainwall_eo::Ddag_eo
void Ddag_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_eo-tmpl.h:678
AFopr_Domainwall_eo::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: afopr_Domainwall_eo.h:57
AFopr_Domainwall_eo::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:457
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
AFopr_Domainwall_eo::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:522
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:324
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:69
AFopr_Domainwall_eo::m_g
real_t m_g
Definition: afopr_Domainwall_eo.h:81
AFopr_Domainwall_eo::mult_gm5R
void mult_gm5R(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:613
AFopr_Domainwall_eo::set_config
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: afopr_Domainwall_eo.h:124
AFopr_Domainwall_eo::m_w4lex
Field m_w4lex
Definition: afopr_Domainwall_eo.h:72
AFopr_Domainwall_eo::m_dm
std::vector< real_t > m_dm
Definition: afopr_Domainwall_eo.h:78
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:170
AFopr_Domainwall_eo::set_precond_parameters
void set_precond_parameters()
set parameters for preconditioning.
Definition: afopr_Domainwall_eo-tmpl.h:212
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:239
AFopr_Domainwall_eo::m_NinF
int m_NinF
on-site d.o.f.
Definition: afopr_Domainwall_eo.h:59
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:62
AFopr_Domainwall_eo::needs_convert
bool needs_convert()
this class needs convert of fermion field.
Definition: afopr_Domainwall_eo.h:116
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:310
AFopr_Domainwall_eo::mult_gm5
void mult_gm5(AFIELD &v, const AFIELD &w)
multiplies gamma_5 matrix.
Definition: afopr_Domainwall_eo-tmpl.h:564
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:131
AFopr_Domainwall_eo::m_dp
std::vector< real_t > m_dp
Definition: afopr_Domainwall_eo.h:77
AFopr_Domainwall_eo::m_e
std::vector< real_t > m_e
Definition: afopr_Domainwall_eo.h:79
AFopr_Domainwall_eo::Ldag_inv
void Ldag_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:900
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:287
AFopr_Domainwall_eo::L_inv
void L_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:765
AFopr_Domainwall_eo::~AFopr_Domainwall_eo
~AFopr_Domainwall_eo()
destructor.
Definition: afopr_Domainwall_eo.h:96
afopr_eo.h
AFopr_Domainwall_eo::set_config
void set_config(unique_ptr< Field_G > &U)
Definition: afopr_Domainwall_eo.h:126
AFopr_Domainwall_eo::m_mode
std::string m_mode
Definition: afopr_Domainwall_eo.h:55
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:69
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:195
AFopr_Domainwall_eo::D_eo
void D_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_eo-tmpl.h:632
AFopr_Domainwall_eo::U_inv
void U_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_eo-tmpl.h:810
AFopr_Domainwall_eo::m_foprw
AFopr< AFIELD > * m_foprw
Definition: afopr_Domainwall_eo.h:66
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
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:169
AFopr_Domainwall_eo::postProp
void postProp(AFIELD &x, const AFIELD &xe, const AFIELD &bo)
Definition: afopr_Domainwall_eo-tmpl.h:423
AFopr_Domainwall_eo::convert
void convert(AFIELD &, const Field &)
convert Field to AField for this class.
Definition: afopr_Domainwall_eo-tmpl.h:264
AFopr_Domainwall_eo::m_v4lex
AFIELD m_v4lex
Definition: afopr_Domainwall_eo.h:73
AFopr_Domainwall_eo::m_w1
AFIELD m_w1
Definition: afopr_Domainwall_eo.h:68
AFopr_Domainwall_eo::mult_gm5_4d
void mult_gm5_4d(AFIELD &v, const AFIELD &w)
Definition: afopr_Domainwall_eo-tmpl.h:587
AFopr_Domainwall_eo::m_index_eo
Index_eo_Domainwall< AFIELD > * m_index_eo
Definition: afopr_Domainwall_eo.h:64
AFopr_Domainwall_eo::AFopr_Domainwall_eo
AFopr_Domainwall_eo(const Parameters &params)
constructor.
Definition: afopr_Domainwall_eo.h:91
AFopr_Domainwall_eo::tidyup
void tidyup()
final tidyup.
Definition: afopr_Domainwall_eo-tmpl.h:92
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:347
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
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