Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_SF.cpp
Go to the documentation of this file.
1 
14 #include "fopr_Wilson_SF.h"
15 
16 
17 
18 #ifdef USE_FACTORY
19 namespace {
20  Fopr *create_object()
21  {
22  return new Fopr_Wilson_SF();
23  }
24 
25 
26  bool init = Fopr::Factory_noarg::Register("Wilson_SF", create_object);
27 }
28 #endif
29 
30 
31 
32 const std::string Fopr_Wilson_SF::class_name = "Fopr_Wilson_SF";
33 
34 //====================================================================
36 {
37  const string str_vlevel = params.get_string("verbose_level");
38 
39  m_vl = vout.set_verbose_level(str_vlevel);
40 
41  //- fetch and check input parameters
42  double kappa;
43  std::vector<int> bc;
44 
45  int err = 0;
46  err += params.fetch_double("hopping_parameter", kappa);
47  err += params.fetch_int_vector("boundary_condition", bc);
48 
49  if (err) {
50  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
51  exit(EXIT_FAILURE);
52  }
53 
54  set_parameters(kappa, bc);
55 }
56 
57 
58 //====================================================================
59 void Fopr_Wilson_SF::set_parameters(const double kappa, const std::vector<int> bc)
60 {
61  //- print input parameters
62  vout.general(m_vl, "%s:\n", class_name.c_str());
63  vout.general(m_vl, " kappa = %12.8f\n", kappa);
64  for (int dir = 0; dir < m_Ndim; ++dir) {
65  vout.general(m_vl, " boundary[%d] = %2d\n", dir, bc[dir]);
66  }
67 
68  //- range check
69  // NB. kappa = 0 is allowed.
70  assert(bc.size() == m_Ndim);
71 
72  //- store values
73  m_kappa = kappa;
74 
75  m_boundary.resize(m_Ndim);
76  for (int mu = 0; mu < m_Ndim; ++mu) {
77  m_boundary[mu] = bc[mu];
78  }
79 
80  //- propagate parameters
82 }
83 
84 
85 //====================================================================
86 void Fopr_Wilson_SF::DdagD(Field& w, const Field& f)
87 {
88  Field w2(f.nin(), f.nvol(), f.nex());
89 
90  D(w2, f);
91  mult_gm5(w, w2);
92  D(w2, w);
93  mult_gm5(w, w2);
94 }
95 
96 
97 //====================================================================
98 void Fopr_Wilson_SF::Ddag(Field& w, const Field& f)
99 {
100  Field w2(f.nin(), f.nvol(), f.nex());
101 
102  mult_gm5(w, f);
103  D(w2, w);
104  mult_gm5(w, w2);
105 }
106 
107 
108 //====================================================================
109 void Fopr_Wilson_SF::H(Field& w, const Field& f)
110 {
111  Field w2(f.nin(), f.nvol(), f.nex());
112 
113  D(w2, f);
114  mult_gm5(w, w2);
115 }
116 
117 
118 //====================================================================
119 void Fopr_Wilson_SF::D(Field& w, const Field& f)
120 {
121  Field w2(f);
122 
124  m_fopr_w->D(w, w2);
126 }
127 
128 
129 //====================================================================
130 void Fopr_Wilson_SF::mult_gm5p(int mu, Field_F& v, const Field_F& w)
131 {
132  Field_F w2(w);
133 
135  m_fopr_w->mult_gm5p(mu, v, w2);
137 }
138 
139 
140 //====================================================================
142 {
143  //- Counting of floating point operations.
144  // not implemented, yet.
145 
146  double flop = 0.0;
147 
148  return flop;
149 }
150 
151 
152 //====================================================================
153 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:495
void DdagD(Field &, const Field &)
Fopr_Wilson * m_fopr_w
std::vector< int > m_boundary
void general(const char *format,...)
Definition: bridgeIO.cpp:195
const Field_F mult_gm5p(int mu, const Field_F &w)
Container of Field-type object.
Definition: field.h:39
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:211
int nvol() const
Definition: field.h:116
Class for parameters.
Definition: parameters.h:46
void Ddag(Field &, const Field &)
Wilson fermion operator with SF BC.
void D(Field &, const Field &)
Wilson-type fermion field.
Definition: field_F.h:37
static const std::string class_name
int nin() const
Definition: field.h:115
void set_parameters(const Parameters &params)
void D(Field &v, const Field &f)
Bridge::VerboseLevel m_vl
Definition: fopr.h:128
int nex() const
Definition: field.h:117
void H(Field &, const Field &)
double flop_count()
this returns the number of floating point operations.
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void mult_gm5p(int mu, Field_F &v, const Field_F &w)
void set_boundary_zero(Field &f)
Definition: field_F_SF.h:56
Field_F_SF set_zero
In order to set the boundary field to zero.
Base class of fermion operator family.
Definition: fopr.h:47
string get_string(const string &key) const
Definition: parameters.cpp:116
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:294
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
void set_parameters(const Parameters &params)