Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_SF.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_WILSON_SF_INCLUDED
16 #define FOPR_WILSON_SF_INCLUDED
17 
18 #include "fopr_Wilson.h"
19 
20 #include "Field/field_F_SF.h"
21 
22 #include "IO/bridgeIO.h"
23 using Bridge::vout;
24 
26 
50 class Fopr_Wilson_SF : public Fopr
51 {
52  public:
53  static const std::string class_name;
54 
55  private:
57  double m_kappa;
58  std::vector<int> m_boundary;
59  std::string m_mode;
60 
62  const Field_G *m_U;
63 
64  /*
66  Communicator* comm;
68  int Svol;
70  int m_Nc2;
71  */
72 
75 
76  public:
78  {
83  m_NinF = 2 * m_Nc * m_Nd;
84 
85  m_boundary.resize(m_Ndim);
86  m_U = 0;
87  m_fopr_w = new Fopr_Wilson;
88 
89  /*
90  comm = Communicator::init();
91  m_Nc2 = 2*m_Nc;
92  int Nt = CommonParameters::Nt();
93  Svol=m_Nvol/Nt;
94  */
95  }
96 
97  void set_parameters(const Parameters& params);
98  void set_parameters(const double kappa, const std::vector<int> bc);
99 
100  void set_config(Field *U)
101  {
102  m_U = (Field_G *)U;
103  m_fopr_w->set_config(U);
104  }
105 
107  {
108  m_U = U.get();
109  m_fopr_w->set_config(U.get());
110  }
111 
113  {
114  delete m_fopr_w;
115  }
116 
117  void mult(Field& v, const Field& f)
118  {
119  if (m_mode == "D") {
120  D(v, f);
121  } else if (m_mode == "DdagD") {
122  DdagD(v, f);
123  } else if (m_mode == "Ddag") {
124  Ddag(v, f);
125  } else if (m_mode == "H") {
126  H(v, f);
127  } else {
128  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
129  exit(EXIT_FAILURE);
130  }
131  }
132 
133  void mult_dag(Field& v, const Field& f)
134  {
135  if (m_mode == "D") {
136  Ddag(v, f);
137  } else if (m_mode == "DdagD") {
138  DdagD(v, f);
139  } else if (m_mode == "Ddag") {
140  D(v, f);
141  } else if (m_mode == "H") {
142  H(v, f);
143  } else {
144  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
145  exit(EXIT_FAILURE);
146  }
147  }
148 
149  void set_mode(const std::string mode)
150  {
151  m_mode = mode;
152  }
153 
154  std::string get_mode() const
155  {
156  return m_mode;
157  }
158 
159  void DdagD(Field&, const Field&);
160  void D(Field&, const Field&);
161  void Ddag(Field&, const Field&);
162  void H(Field&, const Field&);
163 
164  void mult_gm5(Field& v, const Field& w)
165  {
166  m_fopr_w->mult_gm5(v, w);
167  }
168 
169  void mult_gm5p(const int mu, Field_F& v, const Field_F& w);
170 
171  int field_nvol() { return m_Nvol; }
172  int field_nin() { return 2 * m_Nc * m_Nd; }
173  int field_nex() { return 1; }
174 
176  double flop_count();
177 
178  private:
179  // A function to set the fermion field to zero at the t=0 boundary.
180  // void set_boundary_zero(Field&);
181 
182 #ifdef USE_FACTORY
183  private:
184  static Fopr *create_object()
185  {
186  return new Fopr_Wilson_SF();
187  }
188 
189  public:
190  static bool register_factory()
191  {
192  return Fopr::Factory_noarg::Register("Wilson_SF", create_object);
193  }
194 #endif
195 };
196 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
void DdagD(Field &, const Field &)
void set_config(Field *U)
setting pointer to the gauge configuration.
Fopr_Wilson * m_fopr_w
std::vector< int > m_boundary
Container of Field-type object.
Definition: field.h:45
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
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
void set_config(Field *U)
setting pointer to the gauge configuration.
static const std::string class_name
std::string m_mode
const Field_G * m_U
SU(N) gauge field.
Definition: field_G.h:38
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Bridge::VerboseLevel m_vl
Definition: fopr.h:127
void mult_gm5p(const int mu, Field_F &v, const Field_F &w)
pointer get() const
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_config(unique_ptr< Field_G > &U)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Org::Fopr_Wilson Fopr_Wilson
Wilson fermion operator.
Definition: fopr_Wilson.h:60
int field_nvol()
returns the volume for which the fermion operator is defined.
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Field_F_SF set_zero
In order to set the boundary field to zero.
Base class of fermion operator family.
Definition: fopr.h:46
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
A class generated to add a function for the SF.
Definition: field_F_SF.h:33
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
std::string get_mode() const
only for Fopr_Overlap
void set_parameters(const Parameters &params)