Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson.cpp
Go to the documentation of this file.
1 
14 #include "fopr_Wilson.h"
15 #include "fopr_Wilson_impl.h"
16 
17 #ifdef USE_PARAMETERS_FACTORY
18 #include "parameters_factory.h"
19 #endif
20 
21 using std::valarray;
22 
23 //- parameter entries
24 namespace {
25  void append_entry(Parameters& param)
26  {
27  param.Register_string("gamma_matrix_type", "NULL");
28  param.Register_double("hopping_parameter", 0.0);
29  param.Register_int_vector("boundary_condition", std::valarray<int>());
30 
31  param.Register_string("verbose_level", "NULL");
32  }
33 
34 
35 #ifdef USE_PARAMETERS_FACTORY
36  bool init_param = ParametersFactory::Register("Fopr.Wilson", append_entry);
37 #endif
38 }
39 //- end
40 
41 //- parameters class
43 //- end
44 
45 //====================================================================
47 {
48  const string str_vlevel = params.get_string("verbose_level");
49 
50  m_vl = vout.set_verbose_level(str_vlevel);
51 
52  //- fetch and check input parameters
53  double kappa;
54  valarray<int> bc;
55 
56  int err = 0;
57  err += params.fetch_double("hopping_parameter", kappa);
58  err += params.fetch_int_vector("boundary_condition", bc);
59 
60  if (err) {
61  vout.crucial(m_vl, "Fopr_Wilson: fetch error, input parameter not found.\n");
62  abort();
63  }
64 
65 
66  set_parameters(kappa, bc);
67 }
68 
69 
70 //====================================================================
71 void Fopr_Wilson::set_parameters(const double kappa, const std::valarray<int> bc)
72 { m_impl->set_parameters(kappa, bc); }
73 
74 
75 //====================================================================
77 { m_impl->init("Dirac"); }
78 
79 //====================================================================
80 Fopr_Wilson::Fopr_Wilson(std::string repr) : Fopr(), m_impl(new Fopr_Wilson_impl)
81 { m_impl->init(repr); }
82 
83 //====================================================================
85 
86 
87 //====================================================================
89 { m_impl->set_config(U); }
90 
91 //====================================================================
92 void Fopr_Wilson::set_mode(std::string mode)
93 { m_impl->set_mode(mode); }
94 
95 //====================================================================
96 std::string Fopr_Wilson::get_mode() const
97 { return m_impl->get_mode(); }
98 
99 //====================================================================
100 void Fopr_Wilson::mult(Field& v, const Field& f)
101 { m_impl->mult(v, f); }
102 
103 //====================================================================
105 { m_impl->mult_dag(v, f); }
106 
107 //====================================================================
109 { m_impl->mult_gm5(w, v); }
110 
111 
112 //====================================================================
113 void Fopr_Wilson::D(Field& w, const Field& v)
114 { m_impl->D(w, v); }
115 
116 //====================================================================
117 void Fopr_Wilson::Ddag(Field& w, const Field& v)
118 { m_impl->Ddag(w, v); }
119 
120 //====================================================================
121 void Fopr_Wilson::DdagD(Field& w, const Field& v)
122 { m_impl->DdagD(w, v); }
123 
124 //====================================================================
125 void Fopr_Wilson::H(Field& w, const Field& v)
126 { m_impl->H(w, v); }
127 
128 
129 //====================================================================
130 const Field_F Fopr_Wilson::mult_gm5p(int mu, const Field_F& w)
131 { return m_impl->mult_gm5p(mu, w); }
132 
133 //====================================================================
135 void Fopr_Wilson::mult_up(int mu, Field& w, const Field& v)
136 { m_impl->mult_up(mu, w, v); }
137 
138 //====================================================================
139 void Fopr_Wilson::mult_dn(int mu, Field& w, const Field& v)
140 { m_impl->mult_dn(mu, w, v); }
141 
142 
143 //====================================================================
145 { m_impl->fprop_normalize(v); }
146 
147 //====================================================================
149 { m_impl->fopr_normalize(v); }
150 
151 //====================================================================
152 //============================================================END=====