Bridge++  Version 1.5.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 #ifdef USE_FACTORY_AUTOREGISTER
17 namespace {
18  bool init = Fopr_Wilson_SF::register_factory();
19 }
20 #endif
21 
22 const std::string Fopr_Wilson_SF::class_name = "Fopr_Wilson_SF";
23 
24 //====================================================================
26 {
27  const string str_vlevel = params.get_string("verbose_level");
28 
29  m_vl = vout.set_verbose_level(str_vlevel);
30 
31  //- fetch and check input parameters
32  double kappa;
33  std::vector<int> bc;
34 
35  int err = 0;
36  err += params.fetch_double("hopping_parameter", kappa);
37  err += params.fetch_int_vector("boundary_condition", bc);
38 
39  if (err) {
40  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
41  exit(EXIT_FAILURE);
42  }
43 
44  set_parameters(kappa, bc);
45 }
46 
47 
48 //====================================================================
49 void Fopr_Wilson_SF::set_parameters(const double kappa, const std::vector<int> bc)
50 {
51  //- print input parameters
52  vout.general(m_vl, "%s:\n", class_name.c_str());
53  vout.general(m_vl, " kappa = %12.8f\n", kappa);
54  for (int dir = 0; dir < m_Ndim; ++dir) {
55  vout.general(m_vl, " boundary[%d] = %2d\n", dir, bc[dir]);
56  }
57 
58  //- range check
59  // NB. kappa = 0 is allowed.
60  assert(bc.size() == m_Ndim);
61 
62  //- store values
63  m_kappa = kappa;
64 
65  m_boundary.resize(m_Ndim);
66  m_boundary = bc;
67 
68  //- propagate parameters
70 }
71 
72 
73 //====================================================================
74 void Fopr_Wilson_SF::DdagD(Field& w, const Field& f)
75 {
76  Field w2(f.nin(), f.nvol(), f.nex());
77 
78  D(w2, f);
79  mult_gm5(w, w2);
80  D(w2, w);
81  mult_gm5(w, w2);
82 }
83 
84 
85 //====================================================================
86 void Fopr_Wilson_SF::Ddag(Field& w, const Field& f)
87 {
88  Field w2(f.nin(), f.nvol(), f.nex());
89 
90  mult_gm5(w, f);
91  D(w2, w);
92  mult_gm5(w, w2);
93 }
94 
95 
96 //====================================================================
97 void Fopr_Wilson_SF::H(Field& w, const Field& f)
98 {
99  Field w2(f.nin(), f.nvol(), f.nex());
100 
101  D(w2, f);
102  mult_gm5(w, w2);
103 }
104 
105 
106 //====================================================================
107 void Fopr_Wilson_SF::D(Field& w, const Field& f)
108 {
109  Field w2(f);
110 
112  m_fopr_w->D(w, w2);
114 }
115 
116 
117 //====================================================================
118 void Fopr_Wilson_SF::mult_gm5p(const int mu, Field_F& v, const Field_F& w)
119 {
120  Field_F w2(w);
121 
123  m_fopr_w->mult_gm5p(mu, v, w2);
125 }
126 
127 
128 //====================================================================
130 {
131  //- Counting of floating point operations in giga unit.
132  // not implemented, yet.
133 
134  const double gflop = 0;
135 
136  return gflop;
137 }
138 
139 
140 //====================================================================
141 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
void DdagD(Field &, const Field &)
Fopr_Wilson * m_fopr_w
std::vector< int > m_boundary
void general(const char *format,...)
Definition: bridgeIO.cpp:197
Container of Field-type object.
Definition: field.h:45
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
int nvol() const
Definition: field.h:127
Class for parameters.
Definition: parameters.h:46
void Ddag(Field &, const Field &)
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:126
void set_parameters(const Parameters &params)
void D(Field &v, const Field &f)
Bridge::VerboseLevel m_vl
Definition: fopr.h:127
void mult_gm5p(const int mu, Field_F &v, const Field_F &w)
const Field_F mult_gm5p(const int mu, const Field_F &w)
int nex() const
Definition: field.h:128
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 set_boundary_zero(Field &f)
Definition: field_F_SF.h:53
Field_F_SF set_zero
In order to set the boundary field to zero.
string get_string(const string &key) const
Definition: parameters.cpp:221
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:429
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)