Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
smear_APE_spatial.cpp
Go to the documentation of this file.
1 
14 #include "smear_APE_spatial.h"
15 
16 #ifdef USE_FACTORY_AUTOREGISTER
17 namespace {
18  bool init = Smear_APE_spatial::register_factory();
19 }
20 #endif
21 
22 const std::string Smear_APE_spatial::class_name = "Smear_APE_spatial";
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 rho;
33 
34  int err = 0;
35  err += params.fetch_double("rho", rho);
36 
37  if (err) {
38  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
39  exit(EXIT_FAILURE);
40  }
41 
42  set_parameters(rho);
43 }
44 
45 
46 //====================================================================
47 void Smear_APE_spatial::set_parameters(const double rho)
48 {
49  //- print input parameters
50  vout.general(m_vl, "%s:\n", class_name.c_str());
51  vout.general(m_vl, " rho = %10.6F\n", rho);
52 
53  //- range check
54  // NB. rho == 0 is allowed.
55 
56  //- store values
57  m_rho = rho;
58 }
59 
60 
61 //====================================================================
62 void Smear_APE_spatial::smear(Field_G& Usmear, const Field_G& U)
63 {
64  const int Nvol = CommonParameters::Nvol();
65 
66  assert(U.nvol() == Nvol);
67  assert(U.nex() == m_Ndim);
68 
69  assert(Usmear.nvol() == Nvol);
70  assert(Usmear.nex() == m_Ndim);
71 
72  const int Ndim_spc = m_Ndim - 1;
73 
74  Staple_lex staple;
75 
76  double plaq = staple.plaq_s(U);
77  vout.general(m_vl, " plaq_s(org ) = %12.8f\n", plaq);
78 
79  plaq = staple.plaq_t(U);
80  vout.general(m_vl, " plaq_t(org ) = %12.8f\n", plaq);
81 
82  Usmear.set(0.0);
83 
84  for (int mu = 0; mu < Ndim_spc; ++mu) {
85  Field_G c_tmp;
86  c_tmp.set(0.0);
87 
88  Field_G u_tmp;
89  u_tmp.setpart_ex(0, U, mu);
90 
91  Field_G u_tmp2;
92 
93  for (int nu = 0; nu < Ndim_spc; ++nu) {
94  if (nu != mu) {
95  staple.upper(u_tmp2, U, mu, nu);
96  c_tmp.addpart_ex(0, u_tmp2, 0, m_rho);
97 
98  staple.lower(u_tmp2, U, mu, nu);
99  c_tmp.addpart_ex(0, u_tmp2, 0, m_rho);
100  }
101  }
102 
103  m_proj->project(u_tmp2, m_rho, c_tmp, u_tmp);
104  Usmear.setpart_ex(mu, u_tmp2, 0);
105  }
106 
107  const int mu = m_Ndim - 1; // temporal link: unsmeared.
108  Usmear.setpart_ex(mu, U, mu);
109 
110  plaq = staple.plaq_s(Usmear);
111  vout.general(m_vl, " plaq_s(smear) = %12.8f\n", plaq);
112 
113  plaq = staple.plaq_t(Usmear);
114  vout.general(m_vl, " plaq_t(smear) = %12.8f\n", plaq);
115 }
116 
117 
118 //====================================================================
119 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
Projection * m_proj
projector to group element.
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
void general(const char *format,...)
Definition: bridgeIO.cpp:197
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
int nvol() const
Definition: field.h:127
double plaq_t(const Field_G &)
calculates temporal plaquette value.
Definition: staple_lex.cpp:95
void smear(Field_G &Usmear, const Field_G &U)
Smearing of a given gauge field.
Class for parameters.
Definition: parameters.h:46
void lower(Field_G &, const Field_G &, const int mu, const int nu)
constructs lower staple in mu-nu plane.
Definition: staple_lex.cpp:177
void addpart_ex(int ex, const Field &w, int exw)
Definition: field.h:204
static const std::string class_name
virtual void project(Field_G &v, const double alpha, const Field_G &C, const Field_G &U)=0
projection V = P[alpha, C, U]
Staple construction.
Definition: staple_lex.h:39
SU(N) gauge field.
Definition: field_G.h:38
void set_parameters(const Parameters &params)
Setting parameters with Parameters object.
int nex() const
Definition: field.h:128
void upper(Field_G &, const Field_G &, const int mu, const int nu)
constructs upper staple in mu-nu plane.
Definition: staple_lex.cpp:151
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
double m_rho
smearing parameter
double plaq_s(const Field_G &)
calculates spatial plaquette value.
Definition: staple_lex.cpp:62
void setpart_ex(int ex, const Field &w, int exw)
Definition: field.h:197
string get_string(const string &key) const
Definition: parameters.cpp:221
Bridge::VerboseLevel m_vl
Definition: smear.h:37
int m_Ndim
spacetime dimension
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131