Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action.h
Go to the documentation of this file.
1 
15 #ifndef ACTION_INCLUDED
16 #define ACTION_INCLUDED
17 
18 #include "Field/field_G.h"
19 #include "Tools/randomNumbers.h"
20 #include "Parameters/parameters.h"
21 #include "IO/bridgeIO.h"
22 
23 #ifdef USE_FACTORY
24 #include "Tools/factory.h"
25 #endif
26 
27 
29 
36 class Action
37 {
38  public:
39 
41  : m_vl(CommonParameters::Vlevel()) {}
42 
43  virtual ~Action() {}
44 
45  private:
46  // non-copyable
47  Action(const Action&);
48  Action& operator=(const Action&);
49 
50  public:
51  virtual void set_parameters(const Parameters& param) = 0;
52 
54 
56  virtual void set_config(Field *U) = 0;
57 
59  virtual double langevin(RandomNumbers *) = 0;
60 
62  virtual double calcH() = 0;
63 
65  //virtual const Field force() = 0;
66  virtual void force(Field&) = 0;
67 
68  virtual void force(Field& v, Field& U)
69  {
70  set_config(&U);
71  force(v);
72  }
73 
74  protected:
76 
77 #ifdef USE_FACTORY
78  public:
79  typedef Action *(*ProductCreator)();
81 
82  static Action *New(const IdentifierType& subtype)
83  {
84  ProductCreator p = Factory::Find(subtype);
85 
86  return p ? (*p)() : 0;
87  }
88 
89 #ifdef USE_FACTORY_AUTOREGISTER
90 #else
91  static bool init_factory();
92 #endif
93 #endif
94 };
95 #endif
virtual void force(Field &v, Field &U)
Definition: action.h:68
Container of Field-type object.
Definition: field.h:45
Class for parameters.
Definition: parameters.h:46
Base class of HMC action class family.
Definition: action.h:36
virtual void set_parameters(const Parameters &param)=0
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: action.h:53
virtual void set_config(Field *U)=0
setting pointer to the gauge configuration.
Action & operator=(const Action &)
virtual void force(Field &)=0
returns force for molcular dynamical update of conjugate momenta.
Common parameter class: provides parameters as singleton.
Bridge::VerboseLevel m_vl
Definition: action.h:75
Base class of random number generators.
Definition: randomNumbers.h:43
Bridge::VerboseLevel vl
VerboseLevel
Definition: bridgeIO.h:42
Action()
Definition: action.h:40
virtual double langevin(RandomNumbers *)=0
Langevis step.
std::string IdentifierType
Factory template class.
Definition: factory.h:39
virtual ~Action()
Definition: action.h:43
virtual double calcH()=0
calculate Hamiltonian of this action term.