Bridge++  Ver. 2.0.2
fopr_Smeared.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_SMEARED_INCLUDED
15 #define FOPR_SMEARED_INCLUDED
16 
17 #include "fopr.h"
18 #include "Smear/director_Smear.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
41 class Fopr_Smeared : public Fopr
42 {
43  public:
44  static const std::string class_name;
45 
46  private:
48 
51 
52  public:
54  Fopr_Smeared(Fopr *fopr, Director_Smear *dr_smear)
55  : m_vl(CommonParameters::Vlevel()), m_fopr(fopr), m_dr_smear(dr_smear) {}
56 
57  Fopr_Smeared(Fopr *fopr, Director_Smear *dr_smear, const Parameters& params)
58  : m_vl(CommonParameters::Vlevel()), m_fopr(fopr), m_dr_smear(dr_smear)
59  {
60  set_parameters(params);
61  }
62 
63  void set_parameters(const Parameters&);
64 
65  void get_parameters(Parameters&) const;
66 
68  void set_config(Field *U);
69 
71  void mult(Field& v, const Field& f)
72  {
73  m_fopr->mult(v, f);
74  }
75 
77  void mult_dag(Field& v, const Field& f)
78  {
79  m_fopr->mult_dag(v, f);
80  }
81 
83  void set_mode(const std::string mode)
84  {
85  m_fopr->set_mode(mode);
86  }
87 
88  std::string get_mode() const
89  {
90  return m_fopr->get_mode();
91  }
92 
93  void mult_up(const int mu, Field& v, const Field& w)
94  {
95  m_fopr->mult_up(mu, v, w);
96  }
97 
98  void mult_dn(const int mu, Field& v, const Field& w)
99  {
100  m_fopr->mult_dn(mu, v, w);
101  }
102 
103  int field_nvol() { return m_fopr->field_nvol(); }
104  int field_nin() { return m_fopr->field_nin(); }
105  int field_nex() { return m_fopr->field_nex(); }
106 
108  double flop_count();
109 
110 #ifdef USE_FACTORY
111  private:
112  static Fopr *create_object(Fopr *fopr, Director *director)
113  {
114  return new Fopr_Smeared(fopr, dynamic_cast<Director_Smear *>(director));
115  }
116 
117  static Fopr *create_object_with_params(Fopr *fopr, Director *director, const Parameters& params)
118  {
119  return new Fopr_Smeared(fopr, dynamic_cast<Director_Smear *>(director), params);
120  }
121 
122  public:
123  static bool register_factory()
124  {
125  bool init = true;
126  init &= Fopr::Factory_fopr_director::Register("Smeared", create_object);
127  // init &= Fopr::Factory_fopr_director_params::Register("Smeared", create_object_with_params);
128  return init;
129  }
130 #endif
131 };
132 #endif
Fopr_Smeared::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_Smeared.h:103
Fopr_Smeared::set_parameters
void set_parameters(const Parameters &)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Smeared.cpp:25
director_Smear.h
bridgeIO.h
Fopr_Smeared::class_name
static const std::string class_name
Definition: fopr_Smeared.h:44
Fopr_Smeared::mult_dag
void mult_dag(Field &v, const Field &f)
multiply smeared fermion operator
Definition: fopr_Smeared.h:77
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr< Field >
AFopr::mult
virtual void mult(AFIELD &, const AFIELD &)
multiplies fermion operator to a given field.
Definition: afopr.h:95
Parameters
Class for parameters.
Definition: parameters.h:46
Fopr_Smeared::mult_dn
void mult_dn(const int mu, Field &v, const Field &w)
downward nearest neighbor hopping term.
Definition: fopr_Smeared.h:98
AFopr::field_nex
virtual int field_nex()=0
returns the external degree of freedom of the fermion field.
Fopr_Smeared::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: fopr_Smeared.cpp:54
Fopr_Smeared::Fopr_Smeared
Fopr_Smeared(Fopr *fopr, Director_Smear *dr_smear, const Parameters &params)
Definition: fopr_Smeared.h:57
Fopr_Smeared::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_Smeared.h:104
AFopr::set_mode
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: afopr.h:81
Fopr_Smeared::Fopr_Smeared
Fopr_Smeared(Fopr *fopr, Director_Smear *dr_smear)
constructor requires Fopr and Director_Smear objects
Definition: fopr_Smeared.h:54
AFopr::get_mode
virtual std::string get_mode() const
returns the current mult mode.
Definition: afopr.h:88
AFopr::mult_dag
virtual void mult_dag(AFIELD &, const AFIELD &)
hermitian conjugate of mult.
Definition: afopr.h:102
Fopr_Smeared::mult_up
void mult_up(const int mu, Field &v, const Field &w)
upward nearest neighbor hopping term.
Definition: fopr_Smeared.h:93
AFopr::field_nvol
virtual int field_nvol()=0
returns the volume of the fermion field.
Fopr_Smeared::get_mode
std::string get_mode() const
Definition: fopr_Smeared.h:88
Fopr_Smeared
smeared fermion operator.
Definition: fopr_Smeared.h:41
Director_Smear
Manager of smeared configurations.
Definition: director_Smear.h:39
fopr.h
Fopr_Smeared::set_config
void set_config(Field *U)
set pointer to original thin link variable
Definition: fopr_Smeared.cpp:42
Fopr_Smeared::m_fopr
Fopr * m_fopr
Definition: fopr_Smeared.h:49
AFopr::mult_dn
virtual void mult_dn(int mu, AFIELD &, const AFIELD &)
downward nearest neighbor hopping term.
Definition: afopr.h:137
Fopr_Smeared::set_mode
void set_mode(const std::string mode)
set the mode of fermion operator
Definition: fopr_Smeared.h:83
Director
Manager of commonly used data object in HMC.
Definition: director.h:37
Field
Container of Field-type object.
Definition: field.h:46
AFopr::field_nin
virtual int field_nin()=0
returns the on-site degree of freedom of the fermion field.
Fopr_Smeared::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_Smeared.h:105
Fopr_Smeared::mult
void mult(Field &v, const Field &f)
multiply smeared fermion operator
Definition: fopr_Smeared.h:71
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Fopr_Smeared::get_parameters
void get_parameters(Parameters &) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Smeared.cpp:35
Fopr_Smeared::m_dr_smear
Director_Smear * m_dr_smear
Definition: fopr_Smeared.h:50
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AFopr::mult_up
virtual void mult_up(int mu, AFIELD &, const AFIELD &)
upward nearest neighbor hopping term.
Definition: afopr.h:130
Fopr_Smeared::m_vl
Bridge::VerboseLevel m_vl
Definition: fopr_Smeared.h:47