Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Staggered_eo.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_STAGGERED_EO_INCLUDED
15 #define FOPR_STAGGERED_EO_INCLUDED
16 
17 #include "fopr.h"
18 #include "field_F_1spinor.h"
19 
20 #include "shiftField_eo.h"
21 
22 #include "bridgeIO.h"
23 using Bridge::vout;
24 
25 //- parameters class
27 {
28  public:
30 };
31 //- end
32 
34 
46 class Fopr_Staggered_eo : public Fopr
47 {
48  private:
50  double m_mq;
52  std::valarray<int> m_boundary;
55  std::string m_mode;
56 
59 
60  public:
61 
63  : Fopr()
64  {
66  m_Nvol2 = m_Nvol / 2;
68  m_boundary.resize(m_Ndim);
70  m_Ueo = new Field_G(m_Nvol, m_Ndim);
71  tr = new Field_F_1spinor(m_Nvol2, 1);
72  tr2 = new Field_F_1spinor(m_Nvol2, 1);
74  }
75 
77  {
78  delete tr2;
79  delete tr;
80  delete m_Ueo;
81  }
82 
83  void set_parameters(const Parameters& params);
84  void set_parameters(const double mq, const std::valarray<int> bc);
85 
86  void set_config(Field *Ueo)
87  {
89  }
90 
91  void set_mode(std::string mode)
92  {
93  m_mode = mode;
94  }
95 
96  std::string get_mode() const
97  {
98  return m_mode;
99  }
100 
101  const Field mult(const Field& f)
102  {
103  if (m_mode == "Dee") {
104  return MeoMoe(f);
105  } else if (m_mode == "Meo") {
106  return (Field)Meo(f, 0);
107  } else if (m_mode == "Moe") {
108  return (Field)Meo(f, 1);
109  } else {
110  vout.crucial(m_vl, "Fopr_Staggered_eo: mode undefined.");
111  abort();
112  }
113  }
114 
115  void mult(Field& w, const Field& f)
116  {
117  if (m_mode == "Dee") {
118  w = MeoMoe(f);
119  } else if (m_mode == "Meo") {
120  w = Meo(f, 0);
121  } else if (m_mode == "Moe") {
122  w = Meo(f, 1);
123  } else {
124  vout.crucial(m_vl, "Fopr_Staggered_eo: mode undeifined.\n");
125  abort();
126  }
127  }
128 
129  const Field MeoMoe(const Field& f)
130  {
131  Field v(f);
132 
133  v -= Meo(Meo(f, 1), 0);
134  return v;
135  }
136 
137  // const Field D(const Field&);
138  // const Field H(const Field&);
139 
140  const Field Meo(const Field&, const int ieo);
141 
142  // ieo=0: even <-- odd
143  // ieo=1: odd <-- even
144 
145  void mult_staggered_phase(Field&, int mu, int ieo);
146 
147  const Field Meo_gm5(const Field&, const int ieo);
148  const Field mult_gm5(const Field&);
149 
151  {
152  v *= 1.0 / m_mq;
153  }
154 
156  {
157  v *= m_mq;
158  }
159 
160  int field_nvol() { return CommonParameters::Nvol() / 2; }
161  int field_nin() { return 2 * CommonParameters::Nc(); }
162  int field_nex() { return 1; }
163 
164  private:
165  void set_staggered_phase();
166  void set_staggered_config(Field_G *Ueo);
167  void mult_xp(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
168  void mult_xm(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
169  void mult_yp(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
170  void mult_ym(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
171  void mult_zp(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
172  void mult_zm(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
173  void mult_tp(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
174  void mult_tm(Field_F_1spinor&, const Field_F_1spinor&, const int ieo);
175 };
176 #endif