Bridge++  Ver. 2.0.2
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 
40  Action() {}
41 
42  virtual ~Action() {}
43 
44  private:
45  // non-copyable
46  Action(const Action&);
47  Action& operator=(const Action&);
48 
49  public:
50  virtual void set_parameters(const Parameters& param) = 0;
51 
52  virtual void get_parameters(Parameters& param) const = 0;
53 
55  virtual void set_config(Field *U) = 0;
56 
58  virtual double langevin(RandomNumbers *) = 0;
59 
61  virtual double calcH() = 0;
62 
64  //virtual const Field force() = 0;
65  virtual void force(Field&) = 0;
66 
67  virtual void force(Field& v, Field& U)
68  {
69  set_config(&U);
70  force(v);
71  }
72 
73 #ifdef USE_FACTORY
74  public:
75  typedef Action *(*ProductCreator)();
76  typedef Action *(*ProductCreator_params)(const Parameters&);
77 
80 
81  static Action *New(const IdentifierType& subtype)
82  {
83  ProductCreator p = Factory::Find(subtype);
84  return p ? (*p)() : 0;
85  }
86 
87  static Action *New(const IdentifierType& subtype, const Parameters& params)
88  {
89  ProductCreator_params p = Factory_params::Find(subtype);
90  return p ? (*p)(params) : 0;
91  }
92 
93 #ifdef USE_FACTORY_AUTOREGISTER
94 #else
95  static bool init_factory();
96 #endif
97 #endif
98 };
99 #endif
bridgeIO.h
field_G.h
Action::get_parameters
virtual void get_parameters(Parameters &param) const =0
randomNumbers.h
factory.h
Action::force
virtual void force(Field &)=0
returns force for molcular dynamical update of conjugate momenta.
Parameters
Class for parameters.
Definition: parameters.h:46
Action::calcH
virtual double calcH()=0
calculate Hamiltonian of this action term.
Action::set_parameters
virtual void set_parameters(const Parameters &param)=0
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
Action::langevin
virtual double langevin(RandomNumbers *)=0
Langevis step.
Action
Base class of HMC action class family.
Definition: action.h:36
Action::~Action
virtual ~Action()
Definition: action.h:42
Action::force
virtual void force(Field &v, Field &U)
Definition: action.h:67
Action::set_config
virtual void set_config(Field *U)=0
setting pointer to the gauge configuration.
Action::Action
Action()
Definition: action.h:40
parameters.h
FactoryTemplate
Definition: factory.h:42
Action::operator=
Action & operator=(const Action &)
Field
Container of Field-type object.
Definition: field.h:46
IdentifierType
std::string IdentifierType
Definition: factory.h:39