Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
force_F_Wilson_eo.cpp
Go to the documentation of this file.
1 
14 #include "force_F_Wilson_eo.h"
15 
16 #ifdef USE_PARAMETERS_FACTORY
17 #include "parameters_factory.h"
18 #endif
19 
20 using Bridge::vout;
21 
22 //- parameter entries
23 namespace {
24  void append_entry(Parameters& param)
25  {
26  param.Register_double("hopping_parameter", 0.0);
27  param.Register_int_vector("boundary_condition", std::valarray<int>());
28 
29  param.Register_string("verbose_level", "NULL");
30  }
31 
32 
33 #ifdef USE_PARAMETERS_FACTORY
34  bool init_param = ParametersFactory::Register("Force.F_Wilson_eo", append_entry);
35 #endif
36 }
37 //- end
38 
39 //- parameters class
41 //- end
42 
43 //====================================================================
45 {
46  const string str_vlevel = params.get_string("verbose_level");
47 
48  m_vl = vout.set_verbose_level(str_vlevel);
49 
50  //- fetch and check input parameters
51  double kappa;
52  valarray<int> bc;
53 
54  int err = 0;
55  err += params.fetch_double("hopping_parameter", kappa);
56  err += params.fetch_int_vector("boundary_condition", bc);
57 
58  if (err) {
59  vout.crucial(m_vl, "Force_F_Wilson_eo: fetch error, input parameter not found.\n");
60  abort();
61  }
62 
63 
64  set_parameters(kappa, bc);
65 }
66 
67 
68 //====================================================================
69 void Force_F_Wilson_eo::set_parameters(double kappa, const std::valarray<int> bc)
70 {
71  int Ndim = CommonParameters::Ndim();
72 
73  //- print input parameters
74  vout.general(m_vl, "Parameters of Force_F_Wilson_eo:\n");
75  vout.general(m_vl, " kappa = %8.4f\n", kappa);
76  for (int mu = 0; mu < Ndim; ++mu) {
77  vout.general(m_vl, " boundary[%d] = %2d\n", mu, bc[mu]);
78  }
79 
80  //- range check
81  // NB. kappa == 0 is allowed.
82  assert(bc.size() == Ndim);
83 
84  //- store values
85  m_kappa = kappa;
86 
87  m_boundary.resize(Ndim);
88  for (int mu = 0; mu < Ndim; ++mu) {
89  m_boundary[mu] = bc[mu];
90  }
91 
92  //- post-process
94 }
95 
96 
97 //====================================================================
99 {
100  int Nc = CommonParameters::Nc();
101  int Nvol = CommonParameters::Nvol();
102  int Nvol2 = Nvol / 2;
103  int Ndim = CommonParameters::Ndim();
104  int NinG = 2 * Nc * Nc;
105 
106  Field_G force(Nvol, Ndim);
107  Field_G force1(Nvol, Ndim);
108 
109  force1 = force_udiv(eta_e);
110 
111  for (int mu = 0; mu < Ndim; ++mu) {
112  force.mult_Field_Gnn(mu, *m_U, mu, force1, mu);
113  force.at_Field_G(mu);
114  }
115  force *= -2.0;
116 
117  return (Field)force;
118 }
119 
120 
121 //====================================================================
123  const Field& eta)
124 {
125  int Nc = CommonParameters::Nc();
126  int Nvol = CommonParameters::Nvol();
127  int Ndim = CommonParameters::Ndim();
128  int NinG = 2 * Nc * Nc;
129 
130  Field_G force(Nvol, Ndim);
131  Field_G force1(Nvol, Ndim);
132 
133  force1 = force_udiv1(zeta, eta);
134 
135  for (int mu = 0; mu < Ndim; ++mu) {
136  force.mult_Field_Gnn(mu, *m_U, mu, force1, mu);
137  force.at_Field_G(mu);
138  }
139  force *= -2.0;
140 
141  return (Field)force;
142 }
143 
144 
145 //====================================================================
147 {
148  int Nc = CommonParameters::Nc();
149  int Nd = CommonParameters::Nd();
150  int Nvol = CommonParameters::Nvol();
151  int Ndim = CommonParameters::Ndim();
152  int Nvol2 = Nvol / 2;
153 
154  Field_G force(Nvol, Ndim);
155  Field_G force1(Nvol, Ndim);
156 
157  Field_F eta_o(Nvol2, 1);
158  Field_F eta(Nvol, 1);
159 
160  eta_o = m_fopr_w->Meo(eta_e, 1);
161  m_index.mergeField(eta, eta_e, eta_o);
162 
163  Field_F zeta_e(Nvol2, 1);
164  Field_F zeta_o(Nvol2, 1);
165  Field_F zeta(Nvol, 1);
166 
167  //zeta = m_fopr_w->H(eta);
168  m_fopr_w->set_mode("H");
169  zeta_e = (Field_F)m_fopr_w->mult(eta_e);
170  zeta_o = m_fopr_w->Meo(zeta_e, 1);
171  m_index.mergeField(zeta, zeta_e, zeta_o);
172 
173  force = (Field_G)force_udiv1(zeta, (Field_F)eta);
174  force1 = (Field_G)force_udiv1((Field_F)eta, zeta);
175  force += force1;
176 
177  return (Field)force;
178 }
179 
180 
181 //====================================================================
183  const Field& eta)
184 {
185  return force_udiv1((Field_F)zeta, (Field_F)eta);
186 }
187 
188 
189 //====================================================================
191  const Field_F& eta)
192 {
193  int Nc = CommonParameters::Nc();
194  int Nd = CommonParameters::Nd();
195  int Nvol = CommonParameters::Nvol();
196  int Ndim = CommonParameters::Ndim();
197 
198  Field_G force(Nvol, Ndim);
199  Field_G force1(Nvol, 1);
200 
201  Field_F eta2(Nvol, 1);
202 
203  for (int mu = 0; mu < Ndim; ++mu) {
204  eta2 = (Field_F)m_fopr_w->gm5p(mu, eta);
205  tensorProd_Field_F(force1, zeta, eta2);
206  force.setpart_ex(mu, force1, 0);
207  }
208 
209  force *= -m_kappa;
210 
211  return (Field)force;
212 }
213 
214 
215 //====================================================================
216 //============================================================END=====