Bridge++  Version 1.5.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 #ifdef USE_FACTORY_AUTOREGISTER
17 namespace {
18  bool init = Action_G_Plaq_SF::register_factory();
19 }
20 #endif
21 
22 const std::string Action_G_Plaq_SF::class_name = "Action_G_Plaq_SF";
23 
24 //====================================================================
26 {
27  const string str_vlevel = params.get_string("verbose_level");
28 
29  m_vl = vout.set_verbose_level(str_vlevel);
30 
31  //- fetch and check input parameters
32  double beta, ct0, ct1, ct2;
33  std::vector<double> phi, phipr;
34 
35  int err = 0;
36  err += params.fetch_double("beta", beta);
37  err += params.fetch_double("ct0", ct0);
38  err += params.fetch_double("ct1", ct1);
39  err += params.fetch_double("ct2", ct2);
40  err += params.fetch_double_vector("phi", phi);
41  err += params.fetch_double_vector("phipr", phipr);
42 
43  if (err) {
44  vout.crucial(m_vl, "Error ar %s: input parameter not found.\n", class_name.c_str());
45  exit(EXIT_FAILURE);
46  }
47 
48 
49  const double gg = 6.0 / beta;
50  const double ct = ct0 + ct1 * gg + ct2 * gg * gg;
51 
52  set_parameters(beta, &phi[0], &phipr[0], ct);
53 
54  //- post-process
55  m_force_G->set_parameters(params);
56 }
57 
58 
59 //====================================================================
60 
69 void Action_G_Plaq_SF::set_parameters(const double beta,
70  double *phi, double *phipr,
71  const double ct)
72 {
73  //- print input parameters
74  vout.general(m_vl, "%s:\n", class_name.c_str());
75  vout.general(m_vl, " beta = %12.6f\n", beta);
76  vout.general(m_vl, " phi1 = %12.6f\n", phi[0]);
77  vout.general(m_vl, " phi2 = %12.6f\n", phi[1]);
78  vout.general(m_vl, " phi3 = %12.6f\n", phi[2]);
79  vout.general(m_vl, " phipr1= %12.6f\n", phipr[0]);
80  vout.general(m_vl, " phipr2= %12.6f\n", phipr[1]);
81  vout.general(m_vl, " phipr3= %12.6f\n", phipr[2]);
82  vout.general(m_vl, " ct = %12.6f\n", ct);
83 
84  //- range check
85  // NB. beta,phi,phipr,ct = 0 is allowed.
86 
87  //- store values
88  m_beta = beta;
89 
90  m_phi = phi;
91  m_phipr = phipr;
92  m_ct = ct;
93 
94  //- post-process
96 }
97 
98 
99 //====================================================================
101 {
102  const double H_U = calcH();
103 
104  return H_U;
105 }
106 
107 
108 //====================================================================
109 
125 {
126  const int Nc = CommonParameters::Nc();
127 
128  const double plaq = m_staple.plaquette_ct(*m_U, m_ct);
129 
130  const double H_U = -(1.0 / Nc) * m_beta * plaq;
131 
132  vout.general(m_vl, "H_Gplaq = %18.8f\n", H_U);
133 
134  return H_U;
135 }
136 
137 
138 //====================================================================
139 
151 {
152  //- check of argument type
153  assert(force.nin() == m_U->nin());
154  assert(force.nvol() == m_U->nvol());
155  assert(force.nex() == m_U->nex());
156 
157  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
158 
159  force.set(0.0);
160 
161  m_force_G->force_core(force, m_U);
162 }
163 
164 
165 //====================================================================
166 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
int fetch_double_vector(const string &key, vector< double > &value) const
Definition: parameters.cpp:410
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
double plaquette_ct(const Field_G &, const double ct)
Definition: staple_SF.cpp:641
void general(const char *format,...)
Definition: bridgeIO.cpp:197
void set_parameters(const Parameters &params)
Container of Field-type object.
Definition: field.h:45
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
int nvol() const
Definition: field.h:127
std::string m_label
Class for parameters.
Definition: parameters.h:46
virtual void force_core(Field &)=0
void set_parameters(const Parameters &params)
Definition: staple_SF.cpp:35
int nin() const
Definition: field.h:126
double m_ct
SF boundary improvement coefficient for the plaquatte action.
int nex() const
Definition: field.h:128
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:43
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:221
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
double * m_phi
SF boundary condition at t=0.