Bridge++  Ver. 2.0.2
force_G.h
Go to the documentation of this file.
1 
14 #ifndef FORCE_G_INCLUDED
15 #define FORCE_G_INCLUDED
16 
17 #include "Field/field_G.h"
18 #include "Parameters/parameters.h"
19 
20 #ifdef USE_FACTORY
21 #include "Tools/factory.h"
22 #endif
23 
25 
31 class Force_G
32 {
33  protected:
35 
36  public:
38  : m_U(0) {}
39 
40  virtual ~Force_G() {}
41 
42  private:
43  // non-copyable
44  Force_G(const Force_G&);
45  Force_G& operator=(const Force_G&);
46 
47  public:
48  virtual void set_parameters(const Parameters&) = 0;
49 
50  virtual void get_parameters(Parameters&) const = 0;
51 
52  void set_config(Field *U)
53  {
54  m_U = (Field_G *)U;
55  }
56 
58  {
59  m_U = U;
60  }
61 
62  virtual void force_core(Field&) = 0;
63 
64  virtual void force_core(Field& v, Field *U)
65  {
66  set_config(U);
67  force_core(v);
68  }
69 
70  virtual void force_core(Field& v, Field_G *U)
71  {
72  set_config(U);
73  force_core(v);
74  }
75 
76 #ifdef USE_FACTORY
77  public:
78  typedef Force_G *(*ProductCreator)();
79  typedef Force_G *(*ProductCreator_params)(const Parameters&);
80 
83 
84  static Force_G *New(const IdentifierType& subtype)
85  {
86  ProductCreator p = Factory::Find(subtype);
87 
88  return p ? (*p)() : 0;
89  }
90 
91  static Force_G *New(const IdentifierType& subtype, const Parameters& params)
92  {
93  ProductCreator_params p = Factory_params::Find(subtype);
94 
95  return p ? (*p)(params) : 0;
96  }
97 
98 #ifdef USE_FACTORY_AUTOREGISTER
99 #else
100  static bool init_factory();
101 #endif
102 #endif
103 };
104 #endif
Force_G::set_config
void set_config(Field_G *U)
Definition: force_G.h:57
field_G.h
factory.h
Force_G::~Force_G
virtual ~Force_G()
Definition: force_G.h:40
Parameters
Class for parameters.
Definition: parameters.h:46
Force_G::force_core
virtual void force_core(Field &)=0
Force_G::force_core
virtual void force_core(Field &v, Field *U)
Definition: force_G.h:64
Force_G::get_parameters
virtual void get_parameters(Parameters &) const =0
Force_G::force_core
virtual void force_core(Field &v, Field_G *U)
Definition: force_G.h:70
Force_G
Base class of gauge force calculation.
Definition: force_G.h:31
Force_G::set_parameters
virtual void set_parameters(const Parameters &)=0
Force_G::Force_G
Force_G()
Definition: force_G.h:37
parameters.h
FactoryTemplate
Definition: factory.h:42
Force_G::operator=
Force_G & operator=(const Force_G &)
Force_G::m_U
Field_G * m_U
Definition: force_G.h:34
Force_G::set_config
void set_config(Field *U)
Definition: force_G.h:52
Field
Container of Field-type object.
Definition: field.h:46
Field_G
SU(N) gauge field.
Definition: field_G.h:38
IdentifierType
std::string IdentifierType
Definition: factory.h:39