Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Overlap_5d.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_OVERLAP_5D_INCLUDED
16 #define FOPR_OVERLAP_5D_INCLUDED
17 
18 #include "fopr_Wilson_eo.h"
19 #include "math_Sign_Zolotarev.h"
20 #include "bridge_complex.h"
21 
22 #include "bridgeIO.h"
23 using Bridge::vout;
24 
26 
39 //- parameters class
40 class Parameters_Fopr_Overlap_5d : virtual public Parameters
41 {
42  public:
44 };
45 //- end
46 
47 class Fopr_Overlap_5d : public Fopr
48 {
49  private:
50  //- parameters common to overlap fermion
51  double m_mq; // quark mass
52  double m_M0; // domain-wall height
53  int m_Np; // number of poles in rational approx.
54  double m_x_min, m_x_max; // valid range of approximate sign function
55  int m_Niter_ms; // max iteration of shiftsolver (dummy)
56  double m_Stop_cond_ms; // stopping condition of shift solver (dummy)
57  std::valarray<int> m_boundary;
58 
59  //- low-mode subtraction
60  int m_Nsbt;
61  std::valarray<double> m_ev;
62  std::valarray<Field> m_vk;
63 
64  //- following parameters are used pnly in this class
65  std::valarray<double> m_cl;
66  std::valarray<double> m_bl;
67  std::valarray<double> m_sigma;
68 
69  std::valarray<double> m_p_sqrt;
70  std::valarray<double> m_q_sqrt;
72  std::valarray<double> m_rl;
73  std::valarray<double> m_sl;
74 
75  std::valarray<double> m_prf;
76  std::valarray<dcomplex> m_u0c_e, m_u0cinv_e;
77  std::valarray<dcomplex> m_u0c_o, m_u0cinv_o;
78 
81  std::string m_mode;
82 
83  public:
85  Fopr(), m_fopr_w(fopr)
86  {
87  m_Nsbt = 0;
88  m_mode = "DdagD_eo";
89  }
90 
91  void set_parameters(const Parameters& params);
92  void set_parameters(const double mq, const double M0, const int Np,
93  const double x_min, const double x_max,
94  const int Niter, const double Stop_cond,
95  const std::valarray<int> bc);
96 
97  void set_config(Field *U)
98  {
99  m_fopr_w->set_config(U);
100  }
101 
102  void set_lowmodes(int Nsbt, std::valarray<double> *, std::valarray<Field> *);
103 
104  void mult(Field& v, const Field& f)
105  {
106  v = mult(f);
107  }
108 
109  void mult_dag(Field& v, const Field& f)
110  {
111  v = mult_dag(f);
112  }
113 
114  const Field mult(const Field& f)
115  {
116  if (m_mode == "D_eo") {
117  return DD_5d_eo(f, 1);
118  } else if (m_mode == "DdagD_eo") {
119  return DdagD_eo(f);
120  } else if (m_mode == "Ddag_eo") {
121  return DD_5d_eo(f, -1);
122  } else {
123  vout.crucial(m_vl, "Fopr_Overlap: mode undefined\n");
124  abort();
125  }
126  }
127 
128  const Field mult_dag(const Field& f)
129  {
130  if (m_mode == "D_eo") {
131  return DD_5d_eo(f, -1);
132  } else if (m_mode == "DdagD_eo") {
133  return DdagD_eo(f);
134  } else if (m_mode == "Ddag_eo") {
135  return DD_5d_eo(f, 1);
136  } else {
137  vout.crucial(m_vl, "Fopr_Overlap: mode undefined\n");
138  abort();
139  }
140  }
141 
142  void set_mode(std::string mode)
143  {
144  m_mode = mode;
145  }
146 
147  std::string get_mode() const
148  {
149  return m_mode;
150  }
151 
152  const Field DdagD_eo(const Field&);
153 
154  const Field DD_5d_eo(const Field& w, const int jd);
155 
156  void Mopr_5d_eo(Field& v, const Field& w, const int ieo);
157 
158  void LUprecond(Field& v, const Field& w, const int ieo);
159 
160  void Proj_H_eo(const int ieo1, const int ieo2,
161  Field& v1, const Field& w1);
162 
163  void Proj_L_mult_eo(const int ieo1, const int ieo2,
164  Field& v1, const Field& w1);
165 
166  void mult_u0inv(Field& v1, const Field& w1, const int ieo);
167 
168  void Calc_Coeff_u0inv();
169  void Solv_Coeff_u0inv(std::valarray<dcomplex>&,
170  const std::valarray<dcomplex>&,
171  const std::valarray<dcomplex>&);
172 
173  void innerprd_c(double& prd_r, double& prd_i,
174  const Field& v, const Field& w);
175 
176  void add_c(Field& v, const Field& w, const double a_r, const double a_i);
177 
178  double norm_c(const std::valarray<dcomplex>&);
179 
180  double innerprd_c(const std::valarray<dcomplex>&,
181  const std::valarray<dcomplex>&);
182 
183  void mult_WdagW(std::valarray<dcomplex>&,
184  const std::valarray<dcomplex>&,
185  const std::valarray<dcomplex>&);
186 
187  int field_nvol() { return m_fopr_w->field_nvol(); }
188  int field_nin() { return m_fopr_w->field_nin(); }
189  int field_nex() { return 2 * m_Np + 1; }
190 };
191 #endif