Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action_G_Plaq_SF.cpp
Go to the documentation of this file.
1 
14 #include "action_G_Plaq_SF.h"
15 
16 
17 #ifdef USE_FACTORY
18 namespace {
19  Action *create_object()
20  {
21  return new Action_G_Plaq_SF();
22  }
23 
24 
25  bool init = Action::Factory::Register("Action_G_Plaq_SF", create_object);
26 }
27 #endif
28 
29 
30 
31 const std::string Action_G_Plaq_SF::class_name = "Action_G_Plaq_SF";
32 
33 //====================================================================
35 {
36  const string str_vlevel = params.get_string("verbose_level");
37 
38  m_vl = vout.set_verbose_level(str_vlevel);
39 
40  //- fetch and check input parameters
41  double beta, ct0, ct1, ct2;
42  std::vector<double> phi, phipr;
43 
44  int err = 0;
45  err += params.fetch_double("beta", beta);
46  err += params.fetch_double("ct0", ct0);
47  err += params.fetch_double("ct1", ct1);
48  err += params.fetch_double("ct2", ct2);
49  err += params.fetch_double_vector("phi", phi);
50  err += params.fetch_double_vector("phipr", phipr);
51 
52  if (err) {
53  vout.crucial(m_vl, "Error ar %s: input parameter not found.\n", class_name.c_str());
54  exit(EXIT_FAILURE);
55  }
56 
57 
58  double gg = 6.0 / beta;
59  double ct = ct0 + ct1 * gg + ct2 * gg * gg;
60 
61  set_parameters(beta, &phi[0], &phipr[0], ct);
62 
63  //- post-process
64  m_force_G->set_parameters(params);
65 }
66 
67 
68 //====================================================================
69 
78 void Action_G_Plaq_SF::set_parameters(double beta, double *phi, double *phipr, double ct)
79 {
80  //- print input parameters
81  vout.general(m_vl, "%s:\n", class_name.c_str());
82  vout.general(m_vl, " beta = %12.6f\n", beta);
83  vout.general(m_vl, " phi1 = %12.6f\n", phi[0]);
84  vout.general(m_vl, " phi2 = %12.6f\n", phi[1]);
85  vout.general(m_vl, " phi3 = %12.6f\n", phi[2]);
86  vout.general(m_vl, " phipr1= %12.6f\n", phipr[0]);
87  vout.general(m_vl, " phipr2= %12.6f\n", phipr[1]);
88  vout.general(m_vl, " phipr3= %12.6f\n", phipr[2]);
89  vout.general(m_vl, " ct = %12.6f\n", ct);
90 
91  //- range check
92  // NB. beta,phi,phipr,ct = 0 is allowed.
93 
94  //- store values
95  m_beta = beta;
96 
97  m_phi = phi;
98  m_phipr = phipr;
99  m_ct = ct;
100 
101  //- post-process
103 }
104 
105 
106 //====================================================================
108 {
109  double H_U = calcH();
110 
111  return H_U;
112 }
113 
114 
115 //====================================================================
116 
132 {
133  int Nc = CommonParameters::Nc();
134 
135  double plaq = m_staple.plaquette_ct(*m_U, m_ct);
136 
137  double H_U = -(1.0 / Nc) * m_beta * plaq;
138 
139  vout.general(m_vl, "H_Gplaq = %18.8f\n", H_U);
140 
141  return H_U;
142 }
143 
144 
145 //====================================================================
146 
158 {
159  //- check of argument type
160  assert(force.nin() == m_U->nin());
161  assert(force.nvol() == m_U->nvol());
162  assert(force.nex() == m_U->nex());
163 
164  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
165 
166  force.set(0.0);
167 
168  m_force_G->force_core(force, m_U);
169 }
170 
171 
172 //====================================================================
173 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:495
double plaquette_ct(const Field_G &, double ct)
Definition: staple_SF.cpp:596
int fetch_double_vector(const string &key, vector< double > &value) const
Definition: parameters.cpp:275
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:164
void general(const char *format,...)
Definition: bridgeIO.cpp:195
void set_parameters(const Parameters &params)
Container of Field-type object.
Definition: field.h:39
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:211
int nvol() const
Definition: field.h:116
std::string m_label
Class for parameters.
Definition: parameters.h:46
virtual void force_core(Field &)=0
Base class of HMC action class family.
Definition: action.h:36
void set_parameters(const Parameters &params)
Definition: staple_SF.cpp:39
int nin() const
Definition: field.h:115
HMC action class for plaquette gauge action with SF BC.
double m_ct
SF boundary improvement coefficient for the plaquatte action.
int nex() const
Definition: field.h:117
double * m_phipr
SF boundary condition at t=Nt.
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
Bridge::VerboseLevel m_vl
Definition: action.h:75
Base class of random number generators.
Definition: randomNumbers.h:36
static const std::string class_name
virtual void set_parameters(const Parameters &)=0
double langevin(RandomNumbers *)
Langevis step.
string get_string(const string &key) const
Definition: parameters.cpp:116
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
double * m_phi
SF boundary condition at t=0.