Bridge++  Ver. 1.3.x
gaugeFixing.h
Go to the documentation of this file.
1 
14 #ifndef GAUGEFIXING_INCLUDED
15 #define GAUGEFIXING_INCLUDED
16 
17 #include "field_G.h"
18 #include "parameters.h"
19 
20 #include "bridgeIO.h"
21 
22 #ifdef USE_FACTORY
23 #include "factory.h"
24 #endif
25 
27 
28 /*
29  This class fixes the gauge of configuration.
30  [10 Oct 2012 Y.Namekawa]
31  unique_ptr is introduced to avoid memory leaks
32  [21 Mar 2015 Y.Namekawa]
33  */
34 
36 {
37  public:
39  : m_vl(CommonParameters::Vlevel()) {}
40 
41  virtual ~GaugeFixing() {}
42 
43  private:
44  // non-copyable
45  GaugeFixing(const GaugeFixing&);
47 
48  public:
49  virtual void set_parameters(const Parameters& params) = 0;
50 
52 
53  virtual void fix(Field_G& Ufix, const Field_G& Uorg) = 0;
54 
55  protected:
57 
58 
59 #ifdef USE_FACTORY
60  public:
61  typedef GaugeFixing *(*ProductCreator)(RandomNumbers *);
63 
64  static GaugeFixing *New(const IdentifierType& subtype, RandomNumbers *rand)
65  {
66  ProductCreator p = Factory::Find(subtype);
67 
68  return p ? (*p)(rand) : 0;
69  }
70 
71  static GaugeFixing *New(const IdentifierType& subtype, unique_ptr<RandomNumbers>& rand)
72  {
73  ProductCreator p = Factory::Find(subtype);
74 
75  return p ? (*p)(rand.get()) : 0;
76  }
77 #endif
78 };
79 #endif
virtual ~GaugeFixing()
Definition: gaugeFixing.h:41
Class for parameters.
Definition: parameters.h:38
SU(N) gauge field.
Definition: field_G.h:38
pointer get() const
Common parameter class: provides parameters as singleton.
Bridge::VerboseLevel m_vl
Definition: gaugeFixing.h:56
Base class of random number generators.
Definition: randomNumbers.h:39
Bridge::VerboseLevel vl
Definition: checker.cpp:18
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: gaugeFixing.h:51
VerboseLevel
Definition: bridgeIO.h:39
std::string IdentifierType
Factory template class.
Definition: factory.h:33
GaugeFixing & operator=(const GaugeFixing &)
gauge fixing.
Definition: gaugeFixing.h:35
virtual void fix(Field_G &Ufix, const Field_G &Uorg)=0
virtual void set_parameters(const Parameters &params)=0