Bridge++  Ver.2.1.3
astaple_lex-tmpl.h
Go to the documentation of this file.
1 
10 template<typename AFIELD>
11 const std::string AStaple_lex<AFIELD>::class_name
12  = "AStaple_lex<AFIELD>";
13 //====================================================================
14 template<typename AFIELD>
16 {
17  m_vl = CommonParameters::Vlevel();
18 
19  int Nc = CommonParameters::Nc();
20  m_Ndf = 2 * Nc * Nc;
21  m_Nvol = CommonParameters::Nvol();
22  m_Ndim = CommonParameters::Ndim();
23 
24  m_shift = new ShiftAField_lex<AFIELD>(m_Ndf);
25 
26  m_Umu.reset(m_Ndf, m_Nvol, 1);
27 
28  m_v1.reset(m_Ndf, m_Nvol, 1);
29  m_v2.reset(m_Ndf, m_Nvol, 1);
30  m_v3.reset(m_Ndf, m_Nvol, 1);
31 
32 }
33 
34 //====================================================================
35 template<typename AFIELD>
37 {
38  delete m_shift;
39 }
40 
41 //====================================================================
42 template<typename AFIELD>
44 {
45  real_t plaqs, plaqt;
46  plaq_s(plaqs, U);
47  plaq_t(plaqt, U);
48 
49  plaq = 0.5 * (plaqs + plaqt);
50 
51 }
52 
53 //====================================================================
54 template<typename AFIELD>
56 {
57 #pragma omp barrier
58 
59  int Nc = CommonParameters::Nc();
60  int Nvol = CommonParameters::Nvol();
61  int NPE = CommonParameters::NPE();
62 
63  real_t fac = real_t(Nvol) * real_t(NPE) * real_t(Nc * (m_Ndim-1));
64  fac = 1.0/fac;
65 
66  real_t plaq = 0.0;
67 
68  for (int mu = 0; mu < m_Ndim-1; ++mu) {
69  int nu = (mu + 1) % (m_Ndim-1);
70 
71  copy(m_Umu, 0, U, mu);
72 
73  upper(m_v3, U, mu, nu);
74 
75  real_t plaq1 = dot(m_v3, m_Umu);
76 
77  plaq += plaq1;
78  }
79 
80  plaqs = plaq * fac;
81 
82 #pragma omp barrier
83 }
84 
85 
86 //====================================================================
87 template<typename AFIELD>
89 {
90 #pragma omp barrier
91 
92  int Nc = CommonParameters::Nc();
93  int Nvol = CommonParameters::Nvol();
94  int NPE = CommonParameters::NPE();
95 
96  real_t fac = real_t(Nvol) * real_t(NPE) * real_t(Nc * (m_Ndim-1));
97  fac = 1.0/fac;
98 
99  int mu = m_Ndim - 1;
100 
101  real_t plaq = 0.0;
102  copy(m_Umu, 0, U, mu);
103 
104  for (int nu = 0; nu < m_Ndim-1; ++nu) {
105  upper(m_v3, U, mu, nu);
106  real_t plaq1 = dot(m_v3, m_Umu);
107  plaq += plaq1;
108  }
109 
110  plaqt = plaq * fac;
111 
112 #pragma omp barrier
113 }
114 
115 //====================================================================
116 template<typename AFIELD>
118  const int mu)
119 {
120 #pragma omp barrier
121 
122  W.set(0.0);
123 #pragma omp barrier
124 
125  for (int nu = 0; nu < m_Ndim; ++nu) {
126  if (nu != mu) {
127  upper(m_v3, U, mu, nu);
128  axpy(W, real_t(1.0), m_v3);
129  lower(m_v3, U, mu, nu);
130  axpy(W, real_t(1.0), m_v3);
131  }
132  }
133 
134 #pragma omp barrier
135 }
136 
137 //====================================================================
138 template<typename AFIELD>
140  const int mu, const int nu)
141 {
142  // (1) mu (2)
143  // +-->--+
144  // nu | |
145  // i+ +
146 
147  m_shift->backward(m_v1, 0, U, nu, mu);
148 
149  m_shift->backward(c, 0, U, mu, nu);
150 
151  mult_Gnd(m_v2, 0, c, 0, m_v1, 0);
152 
153  mult_Gnn(c, 0, U, nu, m_v2, 0);
154 
155 }
156 
157 //====================================================================
158 template<typename AFIELD>
160  const int mu, const int nu)
161 {
162  // + +
163  // nu | |
164  // i+-->--+
165  // (1) mu (2)
166 
167  m_shift->backward(m_v2, 0, U, nu, mu);
168 
169  mult_Gnn(m_v1, 0, U, mu, m_v2, 0);
170  mult_Gdn(m_v2, 0, U, nu, m_v1, 0);
171 
172  m_shift->forward(c, m_v2, nu);
173 
174 }
175 
176 //============================================================END=====
BridgeACC::mult_Gnd
void mult_Gnd(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
AStaple_lex::tidyup
void tidyup()
final tidy up.
Definition: astaple_lex-tmpl.h:36
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
Field::set
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
AStaple_lex::staple
void staple(AFIELD &, const AFIELD &, const int mu)
constructs staple in mu-direction (summing up nu-direction).
Definition: astaple_lex-tmpl.h:117
AStaple_lex< Field >::real_t
Field ::real_t real_t
Definition: astaple_lex.h:31
BridgeACC::mult_Gnn
void mult_Gnn(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
ShiftAField_lex
Shift of a field in the lexical site index.
Definition: shiftAField_lex.h:28
AStaple_lex::lower
void lower(AFIELD &, const AFIELD &, const int mu, const int nu)
constructs lower staple in mu-nu plane.
Definition: astaple_lex-tmpl.h:159
axpy
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:381
dot
double dot(const Field &y, const Field &x)
Definition: field.cpp:577
copy
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:213
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
AStaple_lex::plaq_t
void plaq_t(real_t &plaq_t, const AFIELD &)
calculates temporal plaquette value.
Definition: astaple_lex-tmpl.h:88
AStaple_lex
Staple construction.
Definition: afopr_CloverTerm.h:27
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
AStaple_lex::plaquette
void plaquette(real_t &plaq, const AFIELD &)
setting parameters.
Definition: astaple_lex-tmpl.h:43
real_t
double real_t
Definition: bridgeACC_AField_double.cpp:14
BridgeACC::mult_Gdn
void mult_Gdn(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
AStaple_lex::upper
void upper(AFIELD &, const AFIELD &, const int mu, const int nu)
constructs upper staple in mu-nu plane.
Definition: astaple_lex-tmpl.h:139
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
AStaple_lex::plaq_s
void plaq_s(real_t &plaq_s, const AFIELD &)
calculates spatial plaquette value.
Definition: astaple_lex-tmpl.h:55
Field
Container of Field-type object.
Definition: field.h:46
AStaple_lex::init
void init()
initial setup.
Definition: astaple_lex-tmpl.h:15