Bridge++  Ver. 2.0.2
afopr_Smeared_eo.h
Go to the documentation of this file.
1 
14 #ifndef AFOPR_SMEARED_EO_INCLUDED
15 #define AFOPR_SMEARED_EO_INCLUDED
16 
17 #include "Fopr/afopr_eo.h"
18 #include "Smear/director_Smear.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
41 template<typename AFIELD>
42 class AFopr_Smeared_eo : public AFopr_eo<AFIELD>
43 {
44  public:
45  static const std::string class_name;
47 
48  private:
50 
53 
54  public:
57  : m_vl(CommonParameters::Vlevel())
58  {
59  m_fopr_eo = fopr_eo;
60  m_dr_smear = dr_smear;
61  }
62 
63  AFopr_Smeared_eo(AFopr_eo<AFIELD> *fopr_eo, Director_Smear *dr_smear, const Parameters& params)
64  : m_vl(CommonParameters::Vlevel())
65  {
66  m_fopr_eo = fopr_eo;
67  m_dr_smear = dr_smear;
68 
69  set_parameters(params);
70  }
71 
72  void set_parameters(const Parameters&);
73 
74  void get_parameters(Parameters&) const;
75 
76  void preProp(AFIELD& Be, AFIELD& bo, const AFIELD& b)
77  { m_fopr_eo->preProp(Be, bo, b); }
78 
79  void postProp(AFIELD& x, const AFIELD& xe, const AFIELD& bo)
80  { m_fopr_eo->postProp(x, xe, bo); }
81 
83  void set_config(Field *U);
84 
86  void mult(AFIELD& v, const AFIELD& f)
87  { m_fopr_eo->mult(v, f); }
88 
90  void mult_dag(AFIELD& v, const AFIELD& f)
91  { m_fopr_eo->mult_dag(v, f); }
92 
94  void set_mode(const std::string mode)
95  { m_fopr_eo->set_mode(mode); }
96 
97  std::string get_mode() const
98  { return m_fopr_eo->get_mode(); }
99 
100  void mult_up(const int mu, AFIELD& v, const AFIELD& w)
101  { m_fopr_eo->mult_up(mu, v, w); }
102 
103  void mult_dn(const int mu, AFIELD& v, const AFIELD& w)
104  { m_fopr_eo->mult_dn(mu, v, w); }
105 
107  virtual bool needs_convert()
108  { return m_fopr->needs_convert(); }
109 
111  virtual void convert(AFIELD& v, const Field& w)
112  { m_fopr->convert(v, w); }
113 
115  virtual void reverse(Field& v, const AFIELD& w)
116  { m_fopr->reverse(v, w); }
117 
118  int field_nvol() { return m_fopr_eo->field_nvol(); }
119  int field_nin() { return m_fopr_eo->field_nin(); }
120  int field_nex() { return m_fopr_eo->field_nex(); }
121 
122 #ifdef USE_FACTORY
123  private:
124  static AFopr<AFIELD> *create_object(AFopr<AFIELD> *fopr, Director *director)
125  {
126  return new AFopr_Smeared_eo<AFIELD>(
127  dynamic_cast<AFopr_eo<AFIELD> *>(fopr),
128  dynamic_cast<Director_Smear *>(director));
129  }
130 
131  static AFopr<AFIELD> *create_object_with_params(AFopr<AFIELD> *fopr, Director *director, const Parameters& params)
132  {
133  return new AFopr_Smeared_eo<AFIELD>(
134  dynamic_cast<AFopr_eo<AFIELD> *>(fopr),
135  dynamic_cast<Director_Smear *>(director), params);
136  }
137 
138  public:
139  static bool register_factory()
140  {
141  bool init = true;
142  init &= AFopr<AFIELD>::Factory_fopr_director::Register("Smeared_eo", create_object);
143  // init &= AFopr<AFIELD>::Factory_fopr_director_params::Register("Smeared_eo", create_object_with_params);
144  return init;
145  }
146 #endif
147 };
148 #endif
AFopr_Smeared_eo::mult_dag
void mult_dag(AFIELD &v, const AFIELD &f)
multiply smeared fermion operator
Definition: afopr_Smeared_eo.h:90
director_Smear.h
bridgeIO.h
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr
Definition: afopr.h:48
AFopr_Smeared_eo::get_parameters
void get_parameters(Parameters &) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Smeared_eo-tmpl.h:38
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_eo
Base class of fermion operator family.
Definition: afopr_eo.h:35
AFopr_Smeared_eo::set_config
void set_config(Field *U)
set pointer to original thin link variable
Definition: afopr_Smeared_eo-tmpl.h:46
AFopr_Smeared_eo::preProp
void preProp(AFIELD &Be, AFIELD &bo, const AFIELD &b)
Definition: afopr_Smeared_eo.h:76
AFopr_Smeared_eo::field_nex
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Definition: afopr_Smeared_eo.h:120
AFopr_Smeared_eo::m_fopr_eo
AFopr_eo< AFIELD > * m_fopr_eo
Definition: afopr_Smeared_eo.h:51
AFopr_Smeared_eo::field_nvol
int field_nvol()
returns the volume for which the fermion operator is defined.
Definition: afopr_Smeared_eo.h:118
AFopr_Smeared_eo::mult_up
void mult_up(const int mu, AFIELD &v, const AFIELD &w)
upward nearest neighbor hopping term.
Definition: afopr_Smeared_eo.h:100
AFopr_Smeared_eo
smeared fermion operator with even-odd preconditioning.
Definition: afopr_Smeared_eo.h:42
AFopr_Smeared_eo::set_parameters
void set_parameters(const Parameters &)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Smeared_eo-tmpl.h:27
AFopr_Smeared_eo::field_nin
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Definition: afopr_Smeared_eo.h:119
AFopr_Smeared_eo::AFopr_Smeared_eo
AFopr_Smeared_eo(AFopr_eo< AFIELD > *fopr_eo, Director_Smear *dr_smear, const Parameters &params)
Definition: afopr_Smeared_eo.h:63
AFopr_Smeared_eo::needs_convert
virtual bool needs_convert()
returns true if additional field conversion is needed.
Definition: afopr_Smeared_eo.h:107
AFopr_Smeared_eo::mult_dn
void mult_dn(const int mu, AFIELD &v, const AFIELD &w)
downward nearest neighbor hopping term.
Definition: afopr_Smeared_eo.h:103
AFopr_Smeared_eo::m_dr_smear
Director_Smear * m_dr_smear
Definition: afopr_Smeared_eo.h:52
AFopr_Smeared_eo::class_name
static const std::string class_name
Definition: afopr_Smeared_eo.h:45
AFopr_Smeared_eo::AFopr_Smeared_eo
AFopr_Smeared_eo(AFopr_eo< AFIELD > *fopr_eo, Director_Smear *dr_smear)
constructor requires Fopr and Director_Smear objects
Definition: afopr_Smeared_eo.h:56
AFopr_Smeared_eo::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Smeared_eo.h:97
Director_Smear
Manager of smeared configurations.
Definition: director_Smear.h:39
AFopr_Smeared_eo::reverse
virtual void reverse(Field &v, const AFIELD &w)
reverses a Field object into other format if necessary.
Definition: afopr_Smeared_eo.h:115
afopr_eo.h
Director
Manager of commonly used data object in HMC.
Definition: director.h:37
AFopr_Smeared_eo::m_vl
Bridge::VerboseLevel m_vl
Definition: afopr_Smeared_eo.h:49
AFopr_Smeared_eo::postProp
void postProp(AFIELD &x, const AFIELD &xe, const AFIELD &bo)
Definition: afopr_Smeared_eo.h:79
Field
Container of Field-type object.
Definition: field.h:46
AFopr_Smeared_eo::convert
virtual void convert(AFIELD &v, const Field &w)
converts a Field object into other format if necessary.
Definition: afopr_Smeared_eo.h:111
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
AFopr_Smeared_eo::mult
void mult(AFIELD &v, const AFIELD &f)
multiply smeared fermion operator
Definition: afopr_Smeared_eo.h:86
AFopr_Smeared_eo::set_mode
void set_mode(const std::string mode)
set the mode of fermion operator
Definition: afopr_Smeared_eo.h:94
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512