Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
shiftField_eo.cpp
Go to the documentation of this file.
1 
14 #include "shiftField_eo.h"
15 
16 const std::string ShiftField_eo::class_name = "ShiftField_eo";
17 
18 //====================================================================
20  const int mu, const int ieo)
21 {
22  const int boundary_condition = 1;
23 
24  if (mu == 0) { // x-direction
25  up_xh(v, w, boundary_condition, ieo);
26  } else if (mu == 1) { // y-direction
27  up_yh(v, w, boundary_condition, ieo);
28  } else if (mu == 2) { // z-direction
29  up_zh(v, w, boundary_condition, ieo);
30  } else if (mu == 3) { // t-direction
31  up_th(v, w, boundary_condition, ieo);
32  } else {
33  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n", class_name.c_str(), mu);
34  exit(EXIT_FAILURE);
35  }
36 }
37 
38 
39 //====================================================================
41  const int mu, const int ieo)
42 {
43  const int boundary_condition = 1;
44 
45  if (mu == 0) { // x-direction
46  dn_xh(v, w, boundary_condition, ieo);
47  } else if (mu == 1) { // y-direction
48  dn_yh(v, w, boundary_condition, ieo);
49  } else if (mu == 2) { // z-direction
50  dn_zh(v, w, boundary_condition, ieo);
51  } else if (mu == 3) { // t-direction
52  dn_th(v, w, boundary_condition, ieo);
53  } else {
54  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n", class_name.c_str(), mu);
55  exit(EXIT_FAILURE);
56  }
57 }
58 
59 
60 //====================================================================
62  const int boundary_condition, const int mu, const int ieo)
63 {
64  if (mu == 0) { // x-direction
65  up_xh(v, w, boundary_condition, ieo);
66  } else if (mu == 1) { // y-direction
67  up_yh(v, w, boundary_condition, ieo);
68  } else if (mu == 2) { // z-direction
69  up_zh(v, w, boundary_condition, ieo);
70  } else if (mu == 3) { // t-direction
71  up_th(v, w, boundary_condition, ieo);
72  } else {
73  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n", class_name.c_str(), mu);
74  exit(EXIT_FAILURE);
75  }
76 }
77 
78 
79 //====================================================================
81  const int boundary_condition, const int mu, const int ieo)
82 {
83  if (mu == 0) { // x-direction
84  dn_xh(v, w, boundary_condition, ieo);
85  } else if (mu == 1) { // y-direction
86  dn_yh(v, w, boundary_condition, ieo);
87  } else if (mu == 2) { // z-direction
88  dn_zh(v, w, boundary_condition, ieo);
89  } else if (mu == 3) { // t-direction
90  dn_th(v, w, boundary_condition, ieo);
91  } else {
92  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n", class_name.c_str(), mu);
93  exit(EXIT_FAILURE);
94  }
95 }
96 
97 
98 //====================================================================
99 void ShiftField_eo::backward(Field& v, const Field& w, const int mu)
100 {
101  const int Nin = w.nin();
102  const int Nvol2 = w.nvol() / 2;
103  const int Nex = w.nex();
104 
105  Field field_e(Nin, Nvol2, Nex);
106  Field field_o(Nin, Nvol2, Nex);
107 
108  Field field_se(Nin, Nvol2, Nex);
109  Field field_so(Nin, Nvol2, Nex);
110 
111  m_index_eo.splitField(field_e, field_o, w);
112 
113  backward_h(field_se, field_o, mu, 0);
114  backward_h(field_so, field_e, mu, 1);
115 
116  m_index_eo.mergeField(v, field_se, field_so);
117 }
118 
119 
120 //====================================================================
121 void ShiftField_eo::forward(Field& v, const Field& w, const int mu)
122 {
123  const int Nin = w.nin();
124  const int Nvol2 = w.nvol() / 2;
125  const int Nex = w.nex();
126 
127  Field field_e(Nin, Nvol2, Nex);
128  Field field_o(Nin, Nvol2, Nex);
129 
130  Field field_se(Nin, Nvol2, Nex);
131  Field field_so(Nin, Nvol2, Nex);
132 
133  m_index_eo.splitField(field_e, field_o, w);
134 
135  forward_h(field_se, field_o, mu, 0);
136  forward_h(field_so, field_e, mu, 1);
137 
138  m_index_eo.mergeField(v, field_se, field_so);
139 }
140 
141 
142 //====================================================================
144  const int boundary_condition, const int mu)
145 {
146  const int Nin = w.nin();
147  const int Nvol2 = w.nvol() / 2;
148  const int Nex = w.nex();
149 
150  Field field_e(Nin, Nvol2, Nex);
151  Field field_o(Nin, Nvol2, Nex);
152 
153  Field field_se(Nin, Nvol2, Nex);
154  Field field_so(Nin, Nvol2, Nex);
155 
156  m_index_eo.splitField(field_e, field_o, w);
157 
158  backward_h(field_se, field_o, boundary_condition, mu, 0);
159  backward_h(field_so, field_e, boundary_condition, mu, 1);
160 
161  m_index_eo.mergeField(v, field_se, field_so);
162 }
163 
164 
165 //====================================================================
167  const int boundary_condition, const int mu)
168 {
169  const int Nin = w.nin();
170  const int Nvol2 = w.nvol() / 2;
171  const int Nex = w.nex();
172 
173  Field field_e(Nin, Nvol2, Nex);
174  Field field_o(Nin, Nvol2, Nex);
175 
176  Field field_se(Nin, Nvol2, Nex);
177  Field field_so(Nin, Nvol2, Nex);
178 
179  m_index_eo.splitField(field_e, field_o, w);
180 
181  forward_h(field_se, field_o, boundary_condition, mu, 0);
182  forward_h(field_so, field_e, boundary_condition, mu, 1);
183 
184  m_index_eo.mergeField(v, field_se, field_so);
185 }
186 
187 
188 //====================================================================
189 void ShiftField_eo::up_xh(Field& v, const Field& w, const int boundary_condition,
190  const int ieo)
191 {
192  double bc2;
193 
194  if (Communicator::ipe(0) == 0) {
195  bc2 = boundary_condition;
196  } else {
197  bc2 = 1.0;
198  }
199 
200  const int Nin = w.nin();
201  const int Nex = w.nex();
202  const int Nvol = w.nvol();
203  const int Nvol2 = (1 + Nvol / m_Nx2) / 2;
204 
205  Field wt(Nin, Nvol2, Nex);
206  Field vt(Nin, Nvol2, Nex);
207 
208  int s2 = 0;
209  for (int t = 0; t < m_Nt; t++) {
210  for (int z = 0; z < m_Nz; z++) {
211  for (int y = 0; y < m_Ny; y++) {
212  if (m_index_eo.leo(y, z, t) == ieo) {
213  // bulk
214  for (int x = 0; x < m_Nx2; x++) {
215  int ix = m_index_eo.siteh(x, y, z, t);
216  for (int ex = 0; ex < Nex; ex++) {
217  for (int in = 0; in < Nin; in++) {
218  v.set(in, ix, ex, w.cmp(in, ix, ex));
219  }
220  }
221  }
222  } else {
223  // bulk
224  for (int x = 0; x < m_Nx2 - 1; x++) {
225  int ix = m_index_eo.siteh(x, y, z, t);
226  int px = m_index_eo.siteh_xup(x, y, z, t, ieo);
227  for (int ex = 0; ex < Nex; ex++) {
228  for (int in = 0; in < Nin; in++) {
229  v.set(in, ix, ex, w.cmp(in, px, ex));
230  }
231  }
232  }
233  // boundary (x=m_Nx2-1)
234  int px = m_index_eo.siteh(0, y, z, t);
235  for (int in = 0; in < Nin; in++) {
236  for (int ex = 0; ex < Nex; ex++) {
237  wt.set(in, s2, ex, bc2 * w.cmp(in, px, ex));
238  }
239  }
240  s2++;
241  }
242  }
243  }
244  }
245 
246  if (s2 > Nvol2) {
247  vout.crucial(m_vl, "Error at %s: invalid size\n", class_name.c_str());
248  exit(EXIT_FAILURE);
249  }
250 
251  const int size = Nin * Nvol2 * Nex;
252  exchange(size, &vt, &wt, 0, 1, 0);
253 
254  s2 = 0;
255  for (int t = 0; t < m_Nt; t++) {
256  for (int z = 0; z < m_Nz; z++) {
257  for (int y = 0; y < m_Ny; y++) {
258  // boundary (x=m_Nx-1)
259  if (m_index_eo.leo(y, z, t) != ieo) {
260  int ix = m_index_eo.siteh(m_Nx2 - 1, y, z, t);
261  for (int in = 0; in < Nin; in++) {
262  for (int ex = 0; ex < Nex; ex++) {
263  v.set(in, ix, ex, vt.cmp(in, s2, ex));
264  }
265  }
266  s2++;
267  }
268  }
269  }
270  }
271 }
272 
273 
274 //====================================================================
275 void ShiftField_eo::dn_xh(Field& v, const Field& w, const int boundary_condition,
276  const int ieo)
277 {
278  double bc2;
279 
280  if (Communicator::ipe(0) == 0) {
281  bc2 = boundary_condition;
282  } else {
283  bc2 = 1.0;
284  }
285 
286  const int Nin = w.nin();
287  const int Nex = w.nex();
288  const int Nvol = w.nvol();
289  const int Nvol2 = (1 + Nvol / m_Nx2) / 2;
290 
291  Field wt(Nin, Nvol2, Nex);
292  Field vt(Nin, Nvol2, Nex);
293 
294  int s2 = 0;
295  for (int t = 0; t < m_Nt; t++) {
296  for (int z = 0; z < m_Nz; z++) {
297  for (int y = 0; y < m_Ny; y++) {
298  if (m_index_eo.leo(y, z, t) == (1 - ieo)) {
299  // bulk
300  for (int x = 0; x < m_Nx2; x++) {
301  int ix = m_index_eo.siteh(x, y, z, t);
302  for (int ex = 0; ex < Nex; ex++) {
303  for (int in = 0; in < Nin; in++) {
304  v.set(in, ix, ex, w.cmp(in, ix, ex));
305  }
306  }
307  }
308  } else {
309  // bulk
310  for (int x = 1; x < m_Nx2; x++) {
311  int ix = m_index_eo.siteh(x, y, z, t);
312  int mx = m_index_eo.siteh_xdn(x, y, z, t, ieo);
313  for (int ex = 0; ex < Nex; ex++) {
314  for (int in = 0; in < Nin; in++) {
315  v.set(in, ix, ex, w.cmp(in, mx, ex));
316  }
317  }
318  }
319  // boundary (x=0)
320  int mx = m_index_eo.siteh(m_Nx2 - 1, y, z, t);
321  for (int in = 0; in < Nin; in++) {
322  for (int ex = 0; ex < Nex; ex++) {
323  wt.set(in, s2, ex, w.cmp(in, mx, ex));
324  }
325  }
326  s2++;
327  }
328  }
329  }
330  }
331 
332  const int size = Nin * Nvol2 * Nex;
333  exchange(size, &vt, &wt, 0, -1, 4);
334 
335  s2 = 0;
336  for (int t = 0; t < m_Nt; t++) {
337  for (int z = 0; z < m_Nz; z++) {
338  for (int y = 0; y < m_Ny; y++) {
339  // boundary (x=0)
340  if (m_index_eo.leo(y, z, t) != (1 - ieo)) {
341  int ix = m_index_eo.siteh(0, y, z, t);
342  for (int in = 0; in < Nin; in++) {
343  for (int ex = 0; ex < Nex; ex++) {
344  v.set(in, ix, ex, bc2 * vt.cmp(in, s2, ex));
345  }
346  }
347  s2++;
348  }
349  }
350  }
351  }
352 }
353 
354 
355 //====================================================================
356 void ShiftField_eo::up_yh(Field& v, const Field& w, const int boundary_condition,
357  const int ieo)
358 {
359  double bc2;
360 
361  if (Communicator::ipe(1) == 0) {
362  bc2 = boundary_condition;
363  } else {
364  bc2 = 1.0;
365  }
366 
367  const int Nin = w.nin();
368  const int Nex = w.nex();
369  const int Nvol = w.nvol();
370 
371  Field wt(Nin, Nvol / m_Ny, Nex);
372  Field vt(Nin, Nvol / m_Ny, Nex);
373 
374  for (int t = 0; t < m_Nt; t++) {
375  for (int z = 0; z < m_Nz; z++) {
376  for (int x = 0; x < m_Nx2; x++) {
377  // bulk
378  for (int y = 0; y < m_Ny - 1; y++) {
379  int ix = m_index_eo.siteh(x, y, z, t);
380  int px = m_index_eo.siteh(x, y + 1, z, t);
381  for (int ex = 0; ex < Nex; ex++) {
382  for (int in = 0; in < Nin; in++) {
383  v.set(in, ix, ex, w.cmp(in, px, ex));
384  }
385  }
386  }
387 
388  // boundary (y=m_Ny-1)
389  int s2 = x + m_Nx2 * (z + m_Nz * t);
390  int px = m_index_eo.siteh(x, 0, z, t);
391  for (int in = 0; in < Nin; in++) {
392  for (int ex = 0; ex < Nex; ex++) {
393  wt.set(in, s2, ex, bc2 * w.cmp(in, px, ex));
394  }
395  }
396  }
397  }
398  }
399 
400  const int size = Nin * (Nvol / m_Ny) * Nex;
401  exchange(size, &vt, &wt, 1, 1, 1);
402 
403  for (int t = 0; t < m_Nt; t++) {
404  for (int z = 0; z < m_Nz; z++) {
405  for (int x = 0; x < m_Nx2; x++) {
406  // boundary (y=m_Ny-1)
407  int s2 = x + m_Nx2 * (z + m_Nz * t);
408  int ix = m_index_eo.siteh(x, m_Ny - 1, z, t);
409  for (int in = 0; in < Nin; in++) {
410  for (int ex = 0; ex < Nex; ex++) {
411  v.set(in, ix, ex, vt.cmp(in, s2, ex));
412  }
413  }
414  }
415  }
416  }
417 }
418 
419 
420 //====================================================================
421 void ShiftField_eo::dn_yh(Field& v, const Field& w, const int boundary_condition,
422  const int ieo)
423 {
424  double bc2;
425 
426  if (Communicator::ipe(1) == 0) {
427  bc2 = boundary_condition;
428  } else {
429  bc2 = 1.0;
430  }
431 
432  const int Nin = w.nin();
433  const int Nex = w.nex();
434  const int Nvol = w.nvol();
435 
436  Field wt(Nin, Nvol / m_Ny, Nex);
437  Field vt(Nin, Nvol / m_Ny, Nex);
438 
439  for (int t = 0; t < m_Nt; t++) {
440  for (int z = 0; z < m_Nz; z++) {
441  for (int x = 0; x < m_Nx2; x++) {
442  // bulk
443  for (int y = 1; y < m_Ny; y++) {
444  int ix = m_index_eo.siteh(x, y, z, t);
445  int px = m_index_eo.siteh(x, y - 1, z, t);
446  for (int ex = 0; ex < Nex; ex++) {
447  for (int in = 0; in < Nin; in++) {
448  v.set(in, ix, ex, w.cmp(in, px, ex));
449  }
450  }
451  }
452  // boundary (y=0)
453  int s2 = x + m_Nx2 * (z + m_Nz * t);
454  int px = m_index_eo.siteh(x, m_Ny - 1, z, t);
455  for (int in = 0; in < Nin; in++) {
456  for (int ex = 0; ex < Nex; ex++) {
457  wt.set(in, s2, ex, w.cmp(in, px, ex));
458  }
459  }
460  }
461  }
462  }
463 
464  const int size = Nin * (Nvol / m_Ny) * Nex;
465  exchange(size, &vt, &wt, 1, -1, 5);
466 
467  for (int t = 0; t < m_Nt; t++) {
468  for (int z = 0; z < m_Nz; z++) {
469  for (int x = 0; x < m_Nx2; x++) {
470  int s2 = x + m_Nx2 * (z + m_Nz * t);
471 
472  // boundary (y=0)
473  int ix = m_index_eo.siteh(x, 0, z, t);
474  for (int in = 0; in < Nin; in++) {
475  for (int ex = 0; ex < Nex; ex++) {
476  v.set(in, ix, ex, bc2 * vt.cmp(in, s2, ex));
477  }
478  }
479  }
480  }
481  }
482 }
483 
484 
485 //====================================================================
486 void ShiftField_eo::up_zh(Field& v, const Field& w, const int boundary_condition,
487  const int ieo)
488 {
489  double bc2;
490 
491  if (Communicator::ipe(2) == 0) {
492  bc2 = boundary_condition;
493  } else {
494  bc2 = 1.0;
495  }
496 
497  const int Nin = w.nin();
498  const int Nex = w.nex();
499  const int Nvol = w.nvol();
500 
501  Field wt(Nin, Nvol / m_Nz, Nex);
502  Field vt(Nin, Nvol / m_Nz, Nex);
503 
504  for (int t = 0; t < m_Nt; t++) {
505  for (int y = 0; y < m_Ny; y++) {
506  for (int x = 0; x < m_Nx2; x++) {
507  // bulk
508  for (int z = 0; z < m_Nz - 1; z++) {
509  int ix = m_index_eo.siteh(x, y, z, t);
510  int px = m_index_eo.siteh(x, y, z + 1, t);
511  for (int ex = 0; ex < Nex; ex++) {
512  for (int in = 0; in < Nin; in++) {
513  v.set(in, ix, ex, w.cmp(in, px, ex));
514  }
515  }
516  }
517 
518  // boundary (z=m_Nz-1)
519  int s2 = x + m_Nx2 * (y + m_Ny * t);
520  int px = m_index_eo.siteh(x, y, 0, t);
521  for (int in = 0; in < Nin; in++) {
522  for (int ex = 0; ex < Nex; ex++) {
523  wt.set(in, s2, ex, bc2 * w.cmp(in, px, ex));
524  }
525  }
526  }
527  }
528  }
529 
530  const int size = Nin * (Nvol / m_Nz) * Nex;
531  exchange(size, &vt, &wt, 2, 1, 2);
532 
533  for (int t = 0; t < m_Nt; t++) {
534  for (int y = 0; y < m_Ny; y++) {
535  for (int x = 0; x < m_Nx2; x++) {
536  int s2 = x + m_Nx2 * (y + m_Ny * t);
537 
538  // boundary (z=m_Nz-1)
539  int ix = m_index_eo.siteh(x, y, m_Nz - 1, t);
540  for (int in = 0; in < Nin; in++) {
541  for (int ex = 0; ex < Nex; ex++) {
542  v.set(in, ix, ex, vt.cmp(in, s2, ex));
543  }
544  }
545  }
546  }
547  }
548 }
549 
550 
551 //====================================================================
552 void ShiftField_eo::dn_zh(Field& v, const Field& w, const int boundary_condition,
553  const int ieo)
554 {
555  double bc2;
556 
557  if (Communicator::ipe(2) == 0) {
558  bc2 = boundary_condition;
559  } else {
560  bc2 = 1.0;
561  }
562 
563  const int Nin = w.nin();
564  const int Nex = w.nex();
565  const int Nvol = w.nvol();
566 
567  Field wt(Nin, Nvol / m_Nz, Nex);
568  Field vt(Nin, Nvol / m_Nz, Nex);
569 
570  for (int t = 0; t < m_Nt; t++) {
571  for (int y = 0; y < m_Ny; y++) {
572  for (int x = 0; x < m_Nx2; x++) {
573  int s2 = x + m_Nx2 * (y + m_Ny * t);
574 
575  // bulk
576  for (int z = 1; z < m_Nz; z++) {
577  int ix = m_index_eo.siteh(x, y, z, t);
578  int px = m_index_eo.siteh(x, y, z - 1, t);
579  for (int ex = 0; ex < Nex; ex++) {
580  for (int in = 0; in < Nin; in++) {
581  v.set(in, ix, ex, w.cmp(in, px, ex));
582  }
583  }
584  }
585  // boundary (z=0)
586  int px = m_index_eo.siteh(x, y, m_Nz - 1, t);
587  for (int in = 0; in < Nin; in++) {
588  for (int ex = 0; ex < Nex; ex++) {
589  wt.set(in, s2, ex, w.cmp(in, px, ex));
590  }
591  }
592  }
593  }
594  }
595 
596  const int size = Nin * (Nvol / m_Nz) * Nex;
597  exchange(size, &vt, &wt, 2, -1, 6);
598 
599  for (int t = 0; t < m_Nt; t++) {
600  for (int y = 0; y < m_Ny; y++) {
601  for (int x = 0; x < m_Nx2; x++) {
602  int s2 = x + m_Nx2 * (y + m_Ny * t);
603 
604  // boundary (z=0)
605  int ix = m_index_eo.siteh(x, y, 0, t);
606  for (int in = 0; in < Nin; in++) {
607  for (int ex = 0; ex < Nex; ex++) {
608  v.set(in, ix, ex, bc2 * vt.cmp(in, s2, ex));
609  }
610  }
611  }
612  }
613  }
614 }
615 
616 
617 //====================================================================
618 void ShiftField_eo::up_th(Field& v, const Field& w, const int boundary_condition,
619  const int ieo)
620 {
621  double bc2;
622 
623  if (Communicator::ipe(3) == 0) {
624  bc2 = boundary_condition;
625  } else {
626  bc2 = 1.0;
627  }
628 
629  const int Nin = w.nin();
630  const int Nex = w.nex();
631  const int Nvol = w.nvol();
632 
633  Field wt(Nin, Nvol / m_Nt, Nex);
634  Field vt(Nin, Nvol / m_Nt, Nex);
635 
636  for (int z = 0; z < m_Nz; z++) {
637  for (int y = 0; y < m_Ny; y++) {
638  for (int x = 0; x < m_Nx2; x++) {
639  int s2 = x + m_Nx2 * (y + m_Ny * z);
640 
641  // bulk
642  for (int t = 0; t < m_Nt - 1; t++) {
643  int ix = m_index_eo.siteh(x, y, z, t);
644  int px = m_index_eo.siteh(x, y, z, t + 1);
645  for (int ex = 0; ex < Nex; ex++) {
646  for (int in = 0; in < Nin; in++) {
647  v.set(in, ix, ex, w.cmp(in, px, ex));
648  }
649  }
650  }
651 
652  // boundary (t=m_Nt-1)
653  int px = m_index_eo.siteh(x, y, z, 0);
654  for (int ex = 0; ex < Nex; ex++) {
655  for (int in = 0; in < Nin; in++) {
656  wt.set(in, s2, ex, bc2 * w.cmp(in, px, ex));
657  }
658  }
659  }
660  }
661  }
662 
663  const int size = Nin * (Nvol / m_Nt) * Nex;
664  exchange(size, &vt, &wt, 3, 1, 3);
665 
666  for (int z = 0; z < m_Nz; z++) {
667  for (int y = 0; y < m_Ny; y++) {
668  for (int x = 0; x < m_Nx2; x++) {
669  int s2 = x + m_Nx2 * (y + m_Ny * z);
670 
671  // boundary (t=m_Nt-1)
672  int ix = m_index_eo.siteh(x, y, z, m_Nt - 1);
673  for (int ex = 0; ex < Nex; ex++) {
674  for (int in = 0; in < Nin; in++) {
675  v.set(in, ix, ex, vt.cmp(in, s2, ex));
676  }
677  }
678  }
679  }
680  }
681 }
682 
683 
684 //====================================================================
685 void ShiftField_eo::dn_th(Field& v, const Field& w, const int boundary_condition,
686  const int ieo)
687 {
688  double bc2;
689 
690  if (Communicator::ipe(3) == 0) {
691  bc2 = boundary_condition;
692  } else {
693  bc2 = 1.0;
694  }
695 
696  const int Nin = w.nin();
697  const int Nex = w.nex();
698  const int Nvol = w.nvol();
699 
700  Field wt(Nin, Nvol / m_Nt, Nex);
701  Field vt(Nin, Nvol / m_Nt, Nex);
702 
703  for (int z = 0; z < m_Nz; z++) {
704  for (int y = 0; y < m_Ny; y++) {
705  for (int x = 0; x < m_Nx2; x++) {
706  int s2 = x + m_Nx2 * (y + m_Ny * z);
707 
708  //- bulk
709  for (int t = 1; t < m_Nt; t++) {
710  int ix = m_index_eo.siteh(x, y, z, t);
711  int px = m_index_eo.siteh(x, y, z, t - 1);
712  for (int ex = 0; ex < Nex; ex++) {
713  for (int in = 0; in < Nin; in++) {
714  v.set(in, ix, ex, w.cmp(in, px, ex));
715  }
716  }
717  }
718  //- boundary (t=0)
719  // int ix = m_index_eo.siteh(x, y, z, 0);
720  int px = m_index_eo.siteh(x, y, z, m_Nt - 1);
721  for (int ex = 0; ex < Nex; ex++) {
722  for (int in = 0; in < Nin; in++) {
723  wt.set(in, s2, ex, w.cmp(in, px, ex));
724  }
725  }
726  }
727  }
728  }
729 
730  const int size = Nin * (Nvol / m_Nt) * Nex;
731  exchange(size, &vt, &wt, 3, -1, 7);
732 
733  for (int z = 0; z < m_Nz; z++) {
734  for (int y = 0; y < m_Ny; y++) {
735  for (int x = 0; x < m_Nx2; x++) {
736  int s2 = x + m_Nx2 * (y + m_Ny * z);
737 
738  //- boundary (t=0)
739  int ix = m_index_eo.siteh(x, y, z, 0);
740  // int px = m_index_eo.siteh(x, y, z, m_Nt - 1);
741  for (int ex = 0; ex < Nex; ex++) {
742  for (int in = 0; in < Nin; in++) {
743  v.set(in, ix, ex, bc2 * vt.cmp(in, s2, ex));
744  }
745  }
746  }
747  }
748  }
749 }
750 
751 
752 //====================================================================
753 //============================================================END=====
void backward(Field &, const Field &, const int mu)
BridgeIO vout
Definition: bridgeIO.cpp:495
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:164
int siteh(const int x2, const int y, const int z, const int t) const
Definition: index_eo.h:160
Bridge::VerboseLevel m_vl
Definition: shiftField_eo.h:53
static const std::string class_name
Definition: shiftField_eo.h:47
Container of Field-type object.
Definition: field.h:39
void up_th(Field &, const Field &, const int, const int)
int nvol() const
Definition: field.h:116
double cmp(const int jin, const int site, const int jex) const
Definition: field.h:132
void dn_yh(Field &, const Field &, const int, const int)
static int ipe(const int dir)
logical coordinate of current proc.
int leo(const int y, const int z, const int t) const
Definition: index_eo.h:112
int nin() const
Definition: field.h:115
void mergeField(Field &eo, const Field &e, const Field &o)
Definition: index_eo.cpp:168
int siteh_xup(const int x2, const int y, const int z, const int t, const int ieo) const
Definition: index_eo.h:174
Index_eo m_index_eo
Definition: shiftField_eo.h:51
int siteh_xdn(const int x2, const int y, const int z, const int t, const int ieo) const
Definition: index_eo.h:190
void up_zh(Field &, const Field &, const int, const int)
int nex() const
Definition: field.h:117
void dn_th(Field &, const Field &, const int, const int)
void up_xh(Field &, const Field &, const int, const int)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void dn_zh(Field &, const Field &, const int, const int)
void up_yh(Field &, const Field &, const int, const int)
void dn_xh(Field &, const Field &, const int, const int)
void splitField(Field &e, Field &o, const Field &eo)
Definition: index_eo.cpp:140
void forward(Field &, const Field &, const int mu)
void backward_h(Field &, const Field &, const int mu, const int ieo)
int exchange(int count, Field *recv_buf, Field *send_buf, int idir, int ipm, int tag)
Definition: field.h:328
void forward_h(Field &, const Field &, const int mu, const int ieo)