Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action_F_Rational_Frame.cpp
Go to the documentation of this file.
1 
15 
16 #ifdef USE_PARAMETERS_FACTORY
17 #include "parameters_factory.h"
18 #endif
19 
20 //- parameter entries
21 namespace {
22  void append_entry(Parameters& param)
23  {
24  param.Register_string("verbose_level", "NULL");
25  }
26 
27 
28 #ifdef USE_PARAMETERS_FACTORY
29  bool init_param = ParametersFactory::Register("Action.F_Rational_Frame", append_entry);
30 #endif
31 }
32 //- end
33 
34 //- parameters class
36 //- end
37 
38 const std::string Action_F_Rational_frame::class_name = "Action_F_Rational_frame";
39 
40 //====================================================================
42 {
43  const string str_vlevel = params.get_string("verbose_level");
44 
45  m_vl = vout.set_verbose_level(str_vlevel);
46 }
47 
48 
49 //====================================================================
51 {
52  int Nc = CommonParameters::Nc();
53  int Nvol = CommonParameters::Nvol();
54  int Ndim = CommonParameters::Ndim();
55  int NinG = 2 * Nc * Nc;
56 
57  m_force.reset(NinG, Nvol, Ndim);
58 
59  // link variable update flag
60  m_status_linkv = 0;
61 }
62 
63 
64 //====================================================================
66 {
67  int NinF = m_fopr_langev->field_nin();
68  int NvolF = m_fopr_langev->field_nvol();
69  int NexF = m_fopr_langev->field_nex();
70  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
71 
72  m_psf.reset(NinF, NvolF, NexF);
73 
74  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
75 
76  Field xi(NinF, NvolF, NexF);
77  rand->gauss_lex_global(xi);
78 
80  m_psf = m_fopr_langev->mult(xi);
81 
82  double xi2 = xi.norm();
83  double H_psf = xi2 * xi2;
84 
85  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
86  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
87 
88  return H_psf;
89 }
90 
91 
92 //====================================================================
94 {
95  int NinF = m_fopr_H->field_nin();
96  int NvolF = m_fopr_H->field_nvol();
97  int NexF = m_fopr_H->field_nex();
98  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
99 
100  Field v1(NinF, NvolF, NexF);
101 
102  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
103 
105  v1 = m_fopr_H->mult(m_psf);
106 
107  double H_psf = v1 * m_psf;
108 
109  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
110  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
111 
112  return H_psf;
113 }
114 
115 
116 //====================================================================
118 {
119  if (m_status_linkv == 0) {
120  int Nvol = m_U->nvol();
121  int Nex = m_U->nex();
122 
123  Field_G force(Nvol, Nex), force1(Nvol, Nex);
124 
125  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
126 
129 
130  m_force = (Field)force;
131  ++m_status_linkv;
132 
133  double Fave, Fmax, Fdev;
134  m_force.stat(Fave, Fmax, Fdev);
135  vout.general(m_vl, " Frational_frame_ave = %12.6f Frational_frame_max = %12.6f Frational_frame_dev = %12.6f\n",
136  Fave, Fmax, Fdev);
137 
138  return m_force;
139  } else {
140  vout.general(m_vl, " %s returns previous force.\n", class_name.c_str());
141  return m_force;
142  }
143 }
144 
145 
146 //====================================================================
147 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:207
void set_parameters(const Parameters &params)
void Register_string(const string &, const string &)
Definition: parameters.cpp:352
virtual const Field mult(const Field &)=0
multiplies fermion operator to a given field and returns the resultant field.
void general(const char *format,...)
Definition: bridgeIO.cpp:38
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:37
virtual void set_config(Field *)=0
int nvol() const
Definition: field.h:101
Class for parameters.
Definition: parameters.h:40
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
const Field force()
returns the force for updating conjugate momentum.
virtual int field_nin()=0
returns the on-site d.o.f. for which the fermion operator is defined.
double calcH()
calculation of Hamiltonian.
SU(N) gauge field.
Definition: field_G.h:36
static const std::string class_name
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:82
double norm() const
Definition: field.h:210
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:102
virtual void force_core(Field &, const Field &)
Definition: force.cpp:58
static bool Register(const std::string &realm, const creator_callback &cb)
Bridge::VerboseLevel m_vl
Definition: action.h:64
Base class of random number generators.
Definition: randomNumbers.h:40
void stat(double &Fave, double &Fmax, double &Fdev) const
determines the statistics of the field. average, maximum value, and deviation is determined over glob...
Definition: field.cpp:544
string get_string(const string &key) const
Definition: parameters.cpp:85
void setup()
creating instances. called from set_parameters().
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:191
static int NPE()