Bridge++  Ver. 2.0.2
afopr_Smeared.h
Go to the documentation of this file.
1 
14 #ifndef AFOPR_SMEARED_INCLUDED
15 #define AFOPR_SMEARED_INCLUDED
16 
17 #include "lib/Fopr/afopr.h"
19 
20 #include "lib/IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
40 template<typename AFIELD>
41 class AFopr_Smeared : public AFopr<AFIELD>
42 {
43  public:
44  static const std::string class_name;
45 
46  private:
48 
51 
52  public:
55  : m_vl(CommonParameters::Vlevel()), m_fopr(fopr), m_dr_smear(dr_smear) {}
56 
57  AFopr_Smeared(AFopr<AFIELD> *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(AFIELD& v, const AFIELD& f)
72  { m_fopr->mult(v, f); }
73 
75  void mult_dag(AFIELD& v, const AFIELD& f)
76  { m_fopr->mult_dag(v, f); }
77 
79  void mult(AFIELD& v, const AFIELD& f, std::string mode)
80  { m_fopr->mult(v, f, mode); }
81 
83  void mult_dag(AFIELD& v, const AFIELD& f, std::string mode)
84  { m_fopr->mult_dag(v, f, mode); }
85 
87  void mult_gm5(AFIELD& v, const AFIELD& f)
88  { m_fopr->mult_gm5(v, f); }
89 
91  void set_mode(const std::string mode)
92  { m_fopr->set_mode(mode); }
93 
96  { return m_fopr->needs_convert(); }
97 
99  void convert(AFIELD& v, const Field& w)
100  { m_fopr->convert(v, w); }
101 
103  void reverse(Field& v, const AFIELD& w)
104  { m_fopr->reverse(v, w); }
105 
106  std::string get_mode() const
107  { return m_fopr->get_mode(); }
108 
109  void mult_up(const int mu, AFIELD& v, const AFIELD& w)
110  { m_fopr->mult_up(mu, v, w); }
111 
112  void mult_dn(const int mu, AFIELD& v, const AFIELD& w)
113  { m_fopr->mult_dn(mu, v, w); }
114 
115  int field_nvol() { return m_fopr->field_nvol(); }
116  int field_nin() { return m_fopr->field_nin(); }
117  int field_nex() { return m_fopr->field_nex(); }
118 
120  double flop_count();
121 
122 #ifdef USE_FACTORY
123  private:
124  static AFopr<AFIELD> *create_object(AFopr<AFIELD> *fopr, Director *director)
125  {
126  return new AFopr_Smeared(fopr, dynamic_cast<Director_Smear *>(director));
127  }
128 
129  static AFopr<AFIELD> *create_object_with_params(AFopr<AFIELD> *fopr, Director *director, const Parameters& params)
130  {
131  return new AFopr_Smeared(fopr, dynamic_cast<Director_Smear *>(director), params);
132  }
133 
134  public:
135  static bool register_factory()
136  {
137  bool init = true;
138  init &= AFopr<AFIELD>::Factory_fopr_director::Register("Smeared", create_object);
139  // init &= AFopr<AFIELD>::Factory_fopr_director_params::Register("Smeared", create_object_with_params);
140  return init;
141  }
142 #endif
143 };
144 #endif
AFopr_Smeared::mult
void mult(AFIELD &v, const AFIELD &f)
multiply smeared fermion operator
Definition: afopr_Smeared.h:71
AFopr_Smeared::mult_gm5
void mult_gm5(AFIELD &v, const AFIELD &f)
multiply gamma_5 matrix.
Definition: afopr_Smeared.h:87
director_Smear.h
bridgeIO.h
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr
Definition: afopr.h:48
AFopr_Smeared::flop_count
double flop_count()
returns floating operation counts.
Definition: afopr_Smeared-tmpl.h:59
AFopr_Smeared::m_fopr
AFopr< AFIELD > * m_fopr
Definition: afopr_Smeared.h:49
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_Smeared::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Smeared.h:106
AFopr_Smeared::AFopr_Smeared
AFopr_Smeared(AFopr< AFIELD > *fopr, Director_Smear *dr_smear)
constructor requires Fopr and Director_Smear objects
Definition: afopr_Smeared.h:54
AFopr_Smeared::set_parameters
void set_parameters(const Parameters &)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Smeared-tmpl.h:27
AFopr_Smeared::mult_dag
void mult_dag(AFIELD &v, const AFIELD &f, std::string mode)
multiply smeared fermion operator
Definition: afopr_Smeared.h:83
AFopr_Smeared::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: afopr_Smeared.h:115
AFopr_Smeared::mult
void mult(AFIELD &v, const AFIELD &f, std::string mode)
multiply smeared fermion operator
Definition: afopr_Smeared.h:79
AFopr_Smeared::convert
void convert(AFIELD &v, const Field &w)
convert of spinor field.
Definition: afopr_Smeared.h:99
AFopr_Smeared::reverse
void reverse(Field &v, const AFIELD &w)
reverse of spinor field.
Definition: afopr_Smeared.h:103
AFopr_Smeared::AFopr_Smeared
AFopr_Smeared(AFopr< AFIELD > *fopr, Director_Smear *dr_smear, const Parameters &params)
Definition: afopr_Smeared.h:57
AFopr_Smeared::class_name
static const std::string class_name
Definition: afopr_Smeared.h:44
AFopr_Smeared
smeared fermion operator: alternative version.
Definition: afopr_Smeared.h:41
AFopr_Smeared::mult_up
void mult_up(const int mu, AFIELD &v, const AFIELD &w)
upward nearest neighbor hopping term.
Definition: afopr_Smeared.h:109
AFopr_Smeared::get_parameters
void get_parameters(Parameters &) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Smeared-tmpl.h:38
Director_Smear
Manager of smeared configurations.
Definition: director_Smear.h:39
AFopr_Smeared::m_dr_smear
Director_Smear * m_dr_smear
Definition: afopr_Smeared.h:50
AFopr_Smeared::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: afopr_Smeared.h:116
AFopr_Smeared::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: afopr_Smeared.h:117
AFopr_Smeared::mult_dag
void mult_dag(AFIELD &v, const AFIELD &f)
multiply smeared fermion operator
Definition: afopr_Smeared.h:75
AFopr_Smeared::set_mode
void set_mode(const std::string mode)
set the mode of fermion operator.
Definition: afopr_Smeared.h:91
AFopr_Smeared::m_vl
Bridge::VerboseLevel m_vl
Definition: afopr_Smeared.h:47
Director
Manager of commonly used data object in HMC.
Definition: director.h:37
AFopr_Smeared::needs_convert
bool needs_convert()
requirement of spinor field conversion.
Definition: afopr_Smeared.h:95
Field
Container of Field-type object.
Definition: field.h:46
afopr.h
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
AFopr_Smeared::mult_dn
void mult_dn(const int mu, AFIELD &v, const AFIELD &w)
downward nearest neighbor hopping term.
Definition: afopr_Smeared.h:112
AFopr_Smeared::set_config
void set_config(Field *U)
set pointer to original thin link variable
Definition: afopr_Smeared-tmpl.h:46
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512