Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
field_G_SF.cpp
Go to the documentation of this file.
1 
14 #include "field_G_SF.h"
15 
16 
17 
18 //====================================================================
19 
30 {
31  int mn = 0;
32 
33  if (Communicator::ipe(3) == 0) {
34  for (int site = 0; site < Svol; ++site) {
35  for (int cc = 0; cc < m_Nc * m_Nc; ++cc) {
36  field[myindex(2 * cc, site, mn)] = U.r(cc);
37  field[myindex(2 * cc + 1, site, mn)] = U.i(cc);
38  }
39  }
40  }
41 }
42 
43 
44 //====================================================================
45 
56 {
57  int mn = 0;
58 
59  if (Communicator::ipe(3) == NPEt - 1) {
60  for (int site = m_Nvol - Svol; site < m_Nvol; ++site) {
61  for (int cc = 0; cc < m_Nc * m_Nc; ++cc) {
62  field[myindex(2 * cc, site, mn)] = U.r(cc);
63  field[myindex(2 * cc + 1, site, mn)] = U.i(cc);
64  }
65  }
66  }
67 }
68 
69 
70 //====================================================================
71 
81 {
82  int mn = 0;
83 
84  if (Communicator::ipe(3) == 0) {
85  for (int site = 0; site < Svol; ++site) {
86  for (int cc = 0; cc < 2 * m_Nc * m_Nc; ++cc) {
87  field[myindex(cc, site, mn)] = 0.0;
88  }
89  }
90  }
91 }
92 
93 
94 //====================================================================
95 
105 {
106  if (Communicator::ipe(3) == 0) {
107  for (int mn = 0; mn < 3; ++mn) {
108  for (int site = 0; site < Svol; ++site) {
109  for (int cc = 0; cc < 2 * m_Nc * m_Nc; ++cc) {
110  field[myindex(cc, site, mn)] = 0.0;
111  }
112  }
113  }
114  }
115 }
116 
117 
118 //====================================================================
119 
130 void Field_G_SF::mult_ct_boundary(int t, double ct)
131 {
132  int mn = 0;
133  int ini = Nx * Ny * Nz * t;
134  int fin = Nx * Ny * Nz * (t + 1);
135 
136  if (((Communicator::ipe(3) == 0) && ((t == 0) || (t == 1))) || ((Communicator::ipe(3) == NPEt - 1) && (t == Nt - 1))) {
137  for (int site = ini; site < fin; ++site) {
138  for (int cc = 0; cc < 2 * m_Nc * m_Nc; ++cc) {
139  field[myindex(cc, site, mn)] *= ct;
140  }
141  }
142  }
143 }
144 
145 
146 //====================================================================
147 
158 {
159  int mn = 0;
160 
161  assert(f.nex() == 1);
162  if (Communicator::ipe(3) == 0) {
163  for (int site = 0; site < Svol; ++site) {
164  f.set_mat(site, mn, wk);
165  }
166  }
167 }
168 
169 
170 //====================================================================
171 
182 {
183  int mn = 0;
184 
185  assert(f.nex() == 1);
186  if (Communicator::ipe(3) == NPEt - 1) {
187  for (int site = m_Nvol - Svol; site < m_Nvol; ++site) {
188  f.set_mat(site, mn, wkpr);
189  }
190  }
191 }
192 
193 
194 //====================================================================
195 
206 {
207  int mn = 0;
208 
209  assert(f.nex() == 1);
210  if (Communicator::ipe(3) == 0) {
211  for (int site = 0; site < Svol; ++site) {
212  for (int cc = 0; cc < m_Nc * m_Nc; ++cc) {
213  f.set_ri(cc, site, mn, 0.0, 0.0);
214  }
215  }
216  }
217 }
218 
219 
220 //====================================================================
221 
232 {
233  assert(f.nex() >= 3);
234  if (Communicator::ipe(3) == 0) {
235  for (int mn = 0; mn < 3; ++mn) {
236  for (int site = 0; site < Svol; ++site) {
237  for (int cc = 0; cc < m_Nc * m_Nc; ++cc) {
238  f.set_ri(cc, site, mn, 0.0, 0.0);
239  }
240  }
241  }
242  }
243 }
244 
245 
246 //====================================================================
247 void Field_G_SF::set_parameters(const std::vector<double>& phi,
248  const std::vector<double>& phipr)
249 {
250  double aphi[3];
251  double aphipr[3];
252 
253  for (int i = 0; i < 3; ++i) {
254  aphi[i] = phi[i];
255  aphipr[i] = phipr[i];
256  }
257 
258  set_parameters(aphi, aphipr);
259 }
260 
261 
262 //====================================================================
263 void Field_G_SF::set_parameters(double *phi, double *phipr)
264 {
265  int Lx = CommonParameters::Lx();
266  double c0r, c0i, c1r, c1i, c2r, c2i;
267 
268  c0r = cos(phi[0] / Lx);
269  c0i = sin(phi[0] / Lx);
270  c1r = cos(phi[1] / Lx);
271  c1i = sin(phi[1] / Lx);
272  c2r = cos(phi[2] / Lx);
273  c2i = sin(phi[2] / Lx);
274 
275  wk.zero();
276  wk.set(0, 0, c0r, c0i);
277  wk.set(1, 1, c1r, c1i);
278  wk.set(2, 2, c2r, c2i);
279 
280  c0r = cos(phipr[0] / Lx);
281  c0i = sin(phipr[0] / Lx);
282  c1r = cos(phipr[1] / Lx);
283  c1i = sin(phipr[1] / Lx);
284  c2r = cos(phipr[2] / Lx);
285  c2i = sin(phipr[2] / Lx);
286 
287  wkpr.zero();
288  wkpr.set(0, 0, c0r, c0i);
289  wkpr.set(1, 1, c1r, c1i);
290  wkpr.set(2, 2, c2r, c2i);
291 }
292 
293 
294 //====================================================================
void set_boundary_zero()
Set the boundary matrix to 0 for SF bc.
Definition: field_G_SF.cpp:80
double i(int c) const
Definition: mat_SU_N.h:115
void set_boundary_wkpr(const Mat_SU_N &U)
Set the boundary spatial link at t=Nt-1 for SF bc.
Definition: field_G_SF.cpp:55
Mat_SU_N & zero()
Definition: mat_SU_N.h:383
static int ipe(const int dir)
logical coordinate of current proc.
void mult_ct_boundary(int t, double ct)
Multiply the boundary improvement factor ct or ctr to an SU(N) matrix object which belongs to a site ...
Definition: field_G_SF.cpp:130
void set_boundary_spatial_link_zero()
Set the boundary spatial link to 0 for SF bc.
Definition: field_G_SF.cpp:104
SU(N) gauge field.
Definition: field_G.h:38
void set_parameters(const std::vector< double > &phi, const std::vector< double > &phipr)
Set the parameter by giving vector objects.
Definition: field_G_SF.cpp:247
void set_boundary_wk(const Mat_SU_N &U)
Set the boundary spatial link at t=0 for SF bc.
Definition: field_G_SF.cpp:29
int nex() const
Definition: field.h:117
Mat_SU_N wk
SF boundary condition at t=0.
Definition: field_G_SF.h:49
std::valarray< double > field
Definition: field.h:51
int m_Nc
number of color elements
Definition: field_G_SF.h:37
int m_Nvol
number of sites
Definition: field_G_SF.h:41
double r(int c) const
Definition: mat_SU_N.h:114
void set(int c, double re, const double &im)
Definition: mat_SU_N.h:133
void set_mat(const int site, const int mn, const Mat_SU_N &U)
Definition: field_G.h:159
int myindex(const int jin, const int site, const int jex) const
Definition: field.h:54
Mat_SU_N wkpr
SF boundary condition at t=Nt.
Definition: field_G_SF.h:51
void set_ri(const int cc, const int site, const int mn, const double re, const double im)
Definition: field_G.h:106