Bridge++  Ver. 2.0.2
shiftField_lex.cpp
Go to the documentation of this file.
1 
14 #include "Field/shiftField_lex.h"
15 #include "Field/field_thread-inc.h"
17 
18 const std::string ShiftField_lex::class_name = "ShiftField_lex";
19 
20 //====================================================================
21 void ShiftField_lex::init(const int Nin)
22 {
24 
25  vout.paranoiac(m_vl, "%s: construction\n", class_name.c_str());
26 
31 
32  m_Nvol = m_Nx * m_Ny * m_Nz * m_Nt;
33 
34  m_Nin = Nin;
35 
36  if (m_Nin > 0) {
37  vout.paranoiac(m_vl, " Nin = %d: resetting working vectors.\n",
38  m_Nin);
39 
40  m_wt_x.reset(m_Nin, m_Nvol / m_Nx, 1);
41  m_vt_x.reset(m_Nin, m_Nvol / m_Nx, 1);
42  m_wt_y.reset(m_Nin, m_Nvol / m_Ny, 1);
43  m_vt_y.reset(m_Nin, m_Nvol / m_Ny, 1);
44  m_wt_z.reset(m_Nin, m_Nvol / m_Nz, 1);
45  m_vt_z.reset(m_Nin, m_Nvol / m_Nz, 1);
46  m_wt_t.reset(m_Nin, m_Nvol / m_Nt, 1);
47  m_vt_t.reset(m_Nin, m_Nvol / m_Nt, 1);
48  } else {
49  vout.paranoiac(m_vl, " Nin = %d: working vectors are not set.\n",
50  m_Nin);
51  }
52 
53  vout.paranoiac(m_vl, "%s: construction finished.\n",
54  class_name.c_str());
55 }
56 
57 
58 //====================================================================
59 void ShiftField_lex::backward(Field& v, const Field& w, const int mu)
60 {
61  const int boundary_condition = 1;
62 
63  if (mu == 0) { // x-direction
64  up_x(v, w, boundary_condition);
65  } else if (mu == 1) {
66  up_y(v, w, boundary_condition);
67  } else if (mu == 2) {
68  up_z(v, w, boundary_condition);
69  } else if (mu == 3) {
70  up_t(v, w, boundary_condition);
71  } else {
72  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n", class_name.c_str(), mu);
73  exit(EXIT_FAILURE);
74  }
75 }
76 
77 
78 //====================================================================
79 void ShiftField_lex::forward(Field& v, const Field& w, const int mu)
80 {
81  const int boundary_condition = 1;
82 
83  if (mu == 0) {
84  dn_x(v, w, boundary_condition);
85  } else if (mu == 1) {
86  dn_y(v, w, boundary_condition);
87  } else if (mu == 2) {
88  dn_z(v, w, boundary_condition);
89  } else if (mu == 3) {
90  dn_t(v, w, boundary_condition);
91  } else {
92  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n",
93  class_name.c_str(), mu);
94  exit(EXIT_FAILURE);
95  }
96 }
97 
98 
99 //====================================================================
101  const int boundary_condition, const int mu)
102 {
103  if (mu == 0) { // x-direction
104  up_x(v, w, boundary_condition);
105  } else if (mu == 1) {
106  up_y(v, w, boundary_condition);
107  } else if (mu == 2) {
108  up_z(v, w, boundary_condition);
109  } else if (mu == 3) {
110  up_t(v, w, boundary_condition);
111  } else {
112  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n",
113  class_name.c_str(), mu);
114  exit(EXIT_FAILURE);
115  }
116 }
117 
118 
119 //====================================================================
121  const int boundary_condition, const int mu)
122 {
123  if (mu == 0) {
124  dn_x(v, w, boundary_condition);
125  } else if (mu == 1) {
126  dn_y(v, w, boundary_condition);
127  } else if (mu == 2) {
128  dn_z(v, w, boundary_condition);
129  } else if (mu == 3) {
130  dn_t(v, w, boundary_condition);
131  } else {
132  vout.crucial(m_vl, "Error at %s: wrong mu = %d\n",
133  class_name.c_str(), mu);
134  exit(EXIT_FAILURE);
135  }
136 }
137 
138 
139 //====================================================================
140 void ShiftField_lex::up_x(Field& v, const Field& w, const int bc)
141 {
142  double bc2 = 1.0;
143  if (Communicator::ipe(0) == 0) bc2 = bc;
144 
145  int Nin;
146  int Nex = w.nex();
147 
148  int ith, nth, is, ns;
149  set_threadtask(ith, nth, is, ns, m_Nvol);
150 
151  double *wt, *vt;
152 
153 #pragma omp barrier
154 
155  if (m_Nin > 0) {
156  wt = m_wt_x.ptr(0);
157  vt = m_vt_x.ptr(0);
158  Nin = m_Nin;
159  } else {
160  is = 0;
161  Nin = w.nin();
162  if (ith == 0) {
163  wt = new double[Nin * (m_Nvol / m_Nx)];
164  vt = new double[Nin * (m_Nvol / m_Nx)];
165  ns = m_Nvol;
166  } else {
167  wt = 0;
168  vt = 0;
169  ns = 0;
170  }
171  }
172 
173  for (int ex = 0; ex < Nex; ++ex) {
174  double *vp = v.ptr(Nin * m_Nvol * ex);
175  const double *wp = w.ptr(Nin * m_Nvol * ex);
176 
177  for (int site = is; site < ns; ++site) {
178  int ix = site % m_Nx;
179  int iyzt = site / m_Nx;
180  if (ix == 0) {
181  for (int in = 0; in < Nin; ++in) {
182  wt[in + Nin * iyzt] = bc2 * wp[in + Nin * site];
183  }
184  }
185  }
186 
187 #pragma omp barrier
188 
189 #pragma omp master
190  {
191  const int size = Nin * (m_Nvol / m_Nx);
192  Communicator::exchange(size, &vt[0], &wt[0], 0, 1, 0);
193  }
194 
195 #pragma omp barrier
196 
197  for (int site = is; site < ns; ++site) {
198  int ix = site % m_Nx;
199  int iyzt = site / m_Nx;
200  int nei = ix + 1 + m_Nx * iyzt;
201  if (ix < m_Nx - 1) {
202  for (int in = 0; in < Nin; ++in) {
203  vp[in + Nin * site] = wp[in + Nin * nei];
204  }
205  } else {
206  for (int in = 0; in < Nin; ++in) {
207  vp[in + Nin * site] = vt[in + Nin * iyzt];
208  }
209  }
210  }
211  }
212 
213  if ((m_Nin == 0) && (ith == 0)) {
214  delete[] wt;
215  delete[] vt;
216  }
217 
218 #pragma omp barrier
219 }
220 
221 
222 //====================================================================
223 void ShiftField_lex::dn_x(Field& v, const Field& w, const int bc)
224 {
225  double bc2 = 1.0;
226  if (Communicator::ipe(0) == 0) bc2 = bc;
227 
228  int Nin;
229  int Nex = w.nex();
230 
231  int ith, nth, is, ns;
232  set_threadtask(ith, nth, is, ns, m_Nvol);
233 
234  double *wt, *vt;
235 
236 #pragma omp barrier
237 
238  if (m_Nin > 0) {
239  wt = m_wt_x.ptr(0);
240  vt = m_vt_x.ptr(0);
241  Nin = m_Nin;
242  } else {
243  is = 0;
244  Nin = w.nin();
245  if (ith == 0) {
246  wt = new double[Nin * (m_Nvol / m_Nx)];
247  vt = new double[Nin * (m_Nvol / m_Nx)];
248  ns = m_Nvol;
249  } else {
250  wt = 0;
251  vt = 0;
252  ns = 0;
253  }
254  }
255 
256  for (int ex = 0; ex < Nex; ++ex) {
257  double *vp = v.ptr(Nin * m_Nvol * ex);
258  const double *wp = w.ptr(Nin * m_Nvol * ex);
259 
260  for (int site = is; site < ns; ++site) {
261  int ix = site % m_Nx;
262  int iyzt = site / m_Nx;
263  if (ix == m_Nx - 1) {
264  for (int in = 0; in < Nin; ++in) {
265  wt[in + Nin * iyzt] = wp[in + Nin * site];
266  }
267  }
268  }
269 
270 #pragma omp barrier
271 
272 #pragma omp master
273  {
274  const int size = Nin * (m_Nvol / m_Nx);
275  Communicator::exchange(size, &vt[0], &wt[0], 0, -1, 4);
276  }
277 
278 #pragma omp barrier
279 
280  for (int site = is; site < ns; ++site) {
281  int ix = site % m_Nx;
282  int iyzt = site / m_Nx;
283  int nei = ix - 1 + m_Nx * iyzt;
284  if (ix > 0) {
285  for (int in = 0; in < Nin; ++in) {
286  vp[in + Nin * site] = wp[in + Nin * nei];
287  }
288  } else {
289  for (int in = 0; in < Nin; ++in) {
290  vp[in + Nin * site] = bc2 * vt[in + Nin * iyzt];
291  }
292  }
293  }
294  }
295 
296  if ((m_Nin == 0) && (ith == 0)) {
297  delete[] wt;
298  delete[] vt;
299  }
300 
301 #pragma omp barrier
302 }
303 
304 
305 //====================================================================
306 void ShiftField_lex::up_y(Field& v, const Field& w, const int bc)
307 {
308  double bc2 = 1.0;
309  if (Communicator::ipe(1) == 0) bc2 = bc;
310 
311  int Nin;
312  int Nex = w.nex();
313 
314  int ith, nth, is, ns;
315  set_threadtask(ith, nth, is, ns, m_Nvol);
316 
317  double *wt, *vt;
318 
319 #pragma omp barrier
320 
321  if (m_Nin > 0) {
322  wt = m_wt_y.ptr(0);
323  vt = m_vt_y.ptr(0);
324  Nin = m_Nin;
325  } else {
326  is = 0;
327  Nin = w.nin();
328  if (ith == 0) {
329  wt = new double[Nin * (m_Nvol / m_Ny)];
330  vt = new double[Nin * (m_Nvol / m_Ny)];
331  ns = m_Nvol;
332  } else {
333  wt = 0;
334  vt = 0;
335  ns = 0;
336  }
337  }
338 
339  for (int ex = 0; ex < Nex; ++ex) {
340  double *vp = v.ptr(Nin * m_Nvol * ex);
341  const double *wp = w.ptr(Nin * m_Nvol * ex);
342 
343  for (int site = is; site < ns; ++site) {
344  int ix = site % m_Nx;
345  int iyzt = site / m_Nx;
346  int iy = iyzt % m_Ny;
347  int izt = iyzt / m_Ny;
348  int ixzt = ix + m_Nx * izt;
349  if (iy == 0) {
350  for (int in = 0; in < Nin; ++in) {
351  wt[in + Nin * ixzt] = bc2 * wp[in + Nin * site];
352  }
353  }
354  }
355 
356 #pragma omp barrier
357 
358 #pragma omp master
359  {
360  const int size = Nin * (m_Nvol / m_Ny);
361  Communicator::exchange(size, &vt[0], &wt[0], 1, 1, 1);
362  }
363 
364 #pragma omp barrier
365 
366  for (int site = is; site < ns; ++site) {
367  int ix = site % m_Nx;
368  int iyzt = site / m_Nx;
369  int iy = iyzt % m_Ny;
370  int izt = iyzt / m_Ny;
371  int ixzt = ix + m_Nx * izt;
372  int nei = ix + m_Nx * (iy + 1 + m_Ny * izt);
373 
374  if (iy < m_Ny - 1) {
375  for (int in = 0; in < Nin; ++in) {
376  vp[in + Nin * site] = wp[in + Nin * nei];
377  }
378  } else {
379  for (int in = 0; in < Nin; ++in) {
380  vp[in + Nin * site] = vt[in + Nin * ixzt];
381  }
382  }
383  }
384  }
385 
386  if ((m_Nin == 0) && (ith == 0)) {
387  delete[] wt;
388  delete[] vt;
389  }
390 
391 #pragma omp barrier
392 }
393 
394 
395 //====================================================================
396 void ShiftField_lex::dn_y(Field& v, const Field& w, const int bc)
397 {
398  double bc2 = 1.0;
399  if (Communicator::ipe(1) == 0) bc2 = bc;
400 
401  int Nin;
402  int Nex = w.nex();
403 
404  int ith, nth, is, ns;
405  set_threadtask(ith, nth, is, ns, m_Nvol);
406 
407  double *wt, *vt;
408 
409 #pragma omp barrier
410 
411  if (m_Nin > 0) {
412  wt = m_wt_y.ptr(0);
413  vt = m_vt_y.ptr(0);
414  Nin = m_Nin;
415  } else {
416  is = 0;
417  Nin = w.nin();
418  if (ith == 0) {
419  wt = new double[Nin * (m_Nvol / m_Ny)];
420  vt = new double[Nin * (m_Nvol / m_Ny)];
421  ns = m_Nvol;
422  } else {
423  wt = 0;
424  vt = 0;
425  ns = 0;
426  }
427  }
428 
429  for (int ex = 0; ex < Nex; ++ex) {
430  double *vp = v.ptr(Nin * m_Nvol * ex);
431  const double *wp = w.ptr(Nin * m_Nvol * ex);
432 
433  for (int site = is; site < ns; ++site) {
434  int ix = site % m_Nx;
435  int iyzt = site / m_Nx;
436  int iy = iyzt % m_Ny;
437  int izt = iyzt / m_Ny;
438  int ixzt = ix + m_Nx * izt;
439  if (iy == m_Ny - 1) {
440  for (int in = 0; in < Nin; ++in) {
441  wt[in + Nin * ixzt] = wp[in + Nin * site];
442  }
443  }
444  }
445 
446 #pragma omp barrier
447 
448 #pragma omp master
449  {
450  const int size = Nin * (m_Nvol / m_Ny);
451  Communicator::exchange(size, &vt[0], &wt[0], 1, -1, 5);
452  }
453 
454 #pragma omp barrier
455 
456  for (int site = is; site < ns; ++site) {
457  int ix = site % m_Nx;
458  int iyzt = site / m_Nx;
459  int iy = iyzt % m_Ny;
460  int izt = iyzt / m_Ny;
461  int ixzt = ix + m_Nx * izt;
462  int nei = ix + m_Nx * (iy - 1 + m_Ny * izt);
463 
464  if (iy > 0) {
465  for (int in = 0; in < Nin; ++in) {
466  vp[in + Nin * site] = wp[in + Nin * nei];
467  }
468  } else {
469  for (int in = 0; in < Nin; ++in) {
470  vp[in + Nin * site] = bc2 * vt[in + Nin * ixzt];
471  }
472  }
473  }
474  }
475 
476  if ((m_Nin == 0) && (ith == 0)) {
477  delete[] wt;
478  delete[] vt;
479  }
480 
481 #pragma omp barrier
482 }
483 
484 
485 //====================================================================
486 void ShiftField_lex::up_z(Field& v, const Field& w, const int bc)
487 {
488  double bc2 = 1.0;
489  if (Communicator::ipe(2) == 0) bc2 = bc;
490 
491  int Nin;
492  int Nex = w.nex();
493 
494  int ith, nth, is, ns;
495  set_threadtask(ith, nth, is, ns, m_Nvol);
496 
497  double *wt, *vt;
498 
499  int Nxy = m_Nx * m_Ny;
500 
501 #pragma omp barrier
502 
503  if (m_Nin > 0) {
504  wt = m_wt_z.ptr(0);
505  vt = m_vt_z.ptr(0);
506  Nin = m_Nin;
507  } else {
508  is = 0;
509  Nin = w.nin();
510  if (ith == 0) {
511  wt = new double[Nin * (m_Nvol / m_Nz)];
512  vt = new double[Nin * (m_Nvol / m_Nz)];
513  ns = m_Nvol;
514  } else {
515  wt = 0;
516  vt = 0;
517  ns = 0;
518  }
519  }
520 
521  for (int ex = 0; ex < Nex; ++ex) {
522  double *vp = v.ptr(Nin * m_Nvol * ex);
523  const double *wp = w.ptr(Nin * m_Nvol * ex);
524 
525  for (int site = is; site < ns; ++site) {
526  int ixy = site % Nxy;
527  int izt = site / Nxy;
528  int iz = izt % m_Nz;
529  int it = izt / m_Nz;
530  int ixyt = ixy + Nxy * it;
531  if (iz == 0) {
532  for (int in = 0; in < Nin; ++in) {
533  wt[in + Nin * ixyt] = bc2 * wp[in + Nin * site];
534  }
535  }
536  }
537 
538 #pragma omp barrier
539 
540 #pragma omp master
541  {
542  const int size = Nin * (m_Nvol / m_Nz);
543  Communicator::exchange(size, &vt[0], &wt[0], 2, 1, 2);
544  }
545 
546 #pragma omp barrier
547 
548  for (int site = is; site < ns; ++site) {
549  int ixy = site % Nxy;
550  int izt = site / Nxy;
551  int iz = izt % m_Nz;
552  int it = izt / m_Nz;
553  int ixyt = ixy + Nxy * it;
554  int nei = ixy + Nxy * (iz + 1 + m_Nz * it);
555 
556  if (iz < m_Nz - 1) {
557  for (int in = 0; in < Nin; ++in) {
558  vp[in + Nin * site] = wp[in + Nin * nei];
559  }
560  } else {
561  for (int in = 0; in < Nin; ++in) {
562  vp[in + Nin * site] = vt[in + Nin * ixyt];
563  }
564  }
565  }
566  }
567 
568  if ((m_Nin == 0) && (ith == 0)) {
569  delete[] wt;
570  delete[] vt;
571  }
572 
573 #pragma omp barrier
574 }
575 
576 
577 //====================================================================
578 void ShiftField_lex::dn_z(Field& v, const Field& w, const int bc)
579 {
580  double bc2 = 1.0;
581  if (Communicator::ipe(2) == 0) bc2 = bc;
582 
583  int Nin;
584  int Nex = w.nex();
585 
586  int ith, nth, is, ns;
587  set_threadtask(ith, nth, is, ns, m_Nvol);
588 
589  double *wt, *vt;
590 
591  int Nxy = m_Nx * m_Ny;
592 
593 #pragma omp barrier
594 
595  if (m_Nin > 0) {
596  wt = m_wt_z.ptr(0);
597  vt = m_vt_z.ptr(0);
598  Nin = m_Nin;
599  } else {
600  is = 0;
601  Nin = w.nin();
602  if (ith == 0) {
603  wt = new double[Nin * (m_Nvol / m_Nz)];
604  vt = new double[Nin * (m_Nvol / m_Nz)];
605  ns = m_Nvol;
606  } else {
607  wt = 0;
608  vt = 0;
609  ns = 0;
610  }
611  }
612 
613  for (int ex = 0; ex < Nex; ++ex) {
614  double *vp = v.ptr(Nin * m_Nvol * ex);
615  const double *wp = w.ptr(Nin * m_Nvol * ex);
616 
617  for (int site = is; site < ns; ++site) {
618  int ixy = site % Nxy;
619  int izt = site / Nxy;
620  int iz = izt % m_Nz;
621  int it = izt / m_Nz;
622  int ixyt = ixy + Nxy * it;
623  if (iz == m_Nz - 1) {
624  for (int in = 0; in < Nin; ++in) {
625  wt[in + Nin * ixyt] = wp[in + Nin * site];
626  }
627  }
628  }
629 
630 #pragma omp barrier
631 
632 #pragma omp master
633  {
634  const int size = Nin * (m_Nvol / m_Nz);
635  Communicator::exchange(size, &vt[0], &wt[0], 2, -1, 6);
636  }
637 
638 #pragma omp barrier
639 
640  for (int site = is; site < ns; ++site) {
641  int ixy = site % Nxy;
642  int izt = site / Nxy;
643  int iz = izt % m_Nz;
644  int it = izt / m_Nz;
645  int ixyt = ixy + Nxy * it;
646  int nei = ixy + Nxy * (iz - 1 + m_Nz * it);
647 
648  if (iz > 0) {
649  for (int in = 0; in < Nin; ++in) {
650  vp[in + Nin * site] = wp[in + Nin * nei];
651  }
652  } else {
653  for (int in = 0; in < Nin; ++in) {
654  vp[in + Nin * site] = bc2 * vt[in + Nin * ixyt];
655  }
656  }
657  }
658  }
659 
660  if ((m_Nin == 0) && (ith == 0)) {
661  delete[] wt;
662  delete[] vt;
663  }
664 
665 #pragma omp barrier
666 }
667 
668 
669 //====================================================================
670 void ShiftField_lex::up_t(Field& v, const Field& w, const int bc)
671 {
672  double bc2 = 1.0;
673  if (Communicator::ipe(3) == 0) bc2 = bc;
674 
675  int Nin;
676  int Nex = w.nex();
677 
678  int ith, nth, is, ns;
679  set_threadtask(ith, nth, is, ns, m_Nvol);
680 
681  double *wt, *vt;
682 
683  int Nxyz = m_Nx * m_Ny * m_Nz;
684 
685 #pragma omp barrier
686 
687  if (m_Nin > 0) {
688  wt = m_wt_t.ptr(0);
689  vt = m_vt_t.ptr(0);
690  Nin = m_Nin;
691  } else {
692  is = 0;
693  Nin = w.nin();
694  if (ith == 0) {
695  wt = new double[Nin * (m_Nvol / m_Nt)];
696  vt = new double[Nin * (m_Nvol / m_Nt)];
697  ns = m_Nvol;
698  } else {
699  wt = 0;
700  vt = 0;
701  ns = 0;
702  }
703  }
704 
705  for (int ex = 0; ex < Nex; ++ex) {
706  double *vp = v.ptr(Nin * m_Nvol * ex);
707  const double *wp = w.ptr(Nin * m_Nvol * ex);
708 
709  for (int site = is; site < ns; ++site) {
710  int ixyz = site % Nxyz;
711  int it = site / Nxyz;
712  if (it == 0) {
713  for (int in = 0; in < Nin; ++in) {
714  wt[in + Nin * ixyz] = bc2 * wp[in + Nin * site];
715  }
716  }
717  }
718 
719 #pragma omp barrier
720 
721 #pragma omp master
722  {
723  const int size = Nin * (m_Nvol / m_Nt);
724  Communicator::exchange(size, &vt[0], &wt[0], 3, 1, 3);
725  }
726 
727 #pragma omp barrier
728 
729  for (int site = is; site < ns; ++site) {
730  int ixyz = site % Nxyz;
731  int it = site / Nxyz;
732  int nei = ixyz + Nxyz * (it + 1);
733 
734  if (it < m_Nt - 1) {
735  for (int in = 0; in < Nin; ++in) {
736  vp[in + Nin * site] = wp[in + Nin * nei];
737  }
738  } else {
739  for (int in = 0; in < Nin; ++in) {
740  vp[in + Nin * site] = vt[in + Nin * ixyz];
741  }
742  }
743  }
744  }
745 
746  if ((m_Nin == 0) && (ith == 0)) {
747  delete[] wt;
748  delete[] vt;
749  }
750 
751 #pragma omp barrier
752 }
753 
754 
755 //====================================================================
756 void ShiftField_lex::dn_t(Field& v, const Field& w, const int bc)
757 {
758  double bc2 = 1.0;
759  if (Communicator::ipe(3) == 0) bc2 = bc;
760 
761  int Nin;
762  int Nex = w.nex();
763 
764  int ith, nth, is, ns;
765  set_threadtask(ith, nth, is, ns, m_Nvol);
766 
767  double *wt, *vt;
768 
769  int Nxyz = m_Nx * m_Ny * m_Nz;
770 
771 #pragma omp barrier
772 
773  if (m_Nin > 0) {
774  wt = m_wt_t.ptr(0);
775  vt = m_vt_t.ptr(0);
776  Nin = m_Nin;
777  } else {
778  is = 0;
779  Nin = w.nin();
780  if (ith == 0) {
781  wt = new double[Nin * (m_Nvol / m_Nt)];
782  vt = new double[Nin * (m_Nvol / m_Nt)];
783  ns = m_Nvol;
784  } else {
785  wt = 0;
786  vt = 0;
787  ns = 0;
788  }
789  }
790 
791  for (int ex = 0; ex < Nex; ++ex) {
792  double *vp = v.ptr(Nin * m_Nvol * ex);
793  const double *wp = w.ptr(Nin * m_Nvol * ex);
794 
795  for (int site = is; site < ns; ++site) {
796  int ixyz = site % Nxyz;
797  int it = site / Nxyz;
798  if (it == m_Nt - 1) {
799  for (int in = 0; in < Nin; ++in) {
800  wt[in + Nin * ixyz] = wp[in + Nin * site];
801  }
802  }
803  }
804 
805 #pragma omp barrier
806 
807 #pragma omp master
808  {
809  const int size = Nin * (m_Nvol / m_Nt);
810  Communicator::exchange(size, &vt[0], &wt[0], 3, -1, 7);
811  }
812 
813 #pragma omp barrier
814 
815  for (int site = is; site < ns; ++site) {
816  int ixyz = site % Nxyz;
817  int it = site / Nxyz;
818  int nei = ixyz + Nxyz * (it - 1);
819 
820  if (it > 0) {
821  for (int in = 0; in < Nin; ++in) {
822  vp[in + Nin * site] = wp[in + Nin * nei];
823  }
824  } else {
825  for (int in = 0; in < Nin; ++in) {
826  vp[in + Nin * site] = bc2 * vt[in + Nin * ixyz];
827  }
828  }
829  }
830  }
831 
832  if ((m_Nin == 0) && (ith == 0)) {
833  delete[] wt;
834  delete[] vt;
835  }
836 
837 #pragma omp barrier
838 }
839 
840 
841 //============================================================END=====
CommonParameters::Ny
static int Ny()
Definition: commonParameters.h:106
CommonParameters::Nz
static int Nz()
Definition: commonParameters.h:107
ShiftField_lex::up_z
void up_z(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:486
ShiftField_lex::m_vt_y
Field m_vt_y
comm. buffer in y-direction
Definition: shiftField_lex.h:51
ShiftField_lex::m_vl
Bridge::VerboseLevel m_vl
Definition: shiftField_lex.h:48
ShiftField_lex::up_t
void up_t(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:670
ShiftField_lex::m_Nz
int m_Nz
Definition: shiftField_lex.h:45
ShiftField_lex::forward
void forward(Field &, const Field &, const int mu)
Definition: shiftField_lex.cpp:79
ShiftField_lex::m_Nin
int m_Nin
Definition: shiftField_lex.h:44
ShiftField_lex::m_Nt
int m_Nt
Definition: shiftField_lex.h:45
shiftField_lex.h
Field::nex
int nex() const
Definition: field.h:128
ShiftField_lex::m_vt_t
Field m_vt_t
comm. buffer in t-direction
Definition: shiftField_lex.h:53
ShiftField_lex::m_Nvol
int m_Nvol
Definition: shiftField_lex.h:46
Field::nin
int nin() const
Definition: field.h:126
ShiftField_lex::m_Ny
int m_Ny
Definition: shiftField_lex.h:45
Bridge::BridgeIO::paranoiac
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:238
ShiftField_lex::dn_y
void dn_y(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:396
CommonParameters::Nx
static int Nx()
Definition: commonParameters.h:105
ShiftField_lex::m_wt_t
Field m_wt_t
Definition: shiftField_lex.h:53
ShiftField_lex::init
void init(const int Nin=0)
Definition: shiftField_lex.cpp:21
ShiftField_lex::dn_z
void dn_z(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:578
CommonParameters::Nt
static int Nt()
Definition: commonParameters.h:108
ShiftField_lex::up_y
void up_y(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:306
ShiftField_lex::dn_x
void dn_x(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:223
threadManager.h
ShiftField_lex::class_name
static const std::string class_name
Definition: shiftField_lex.h:41
ShiftField_lex::up_x
void up_x(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:140
Field::reset
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
Field::ptr
const double * ptr(const int jin, const int site, const int jex) const
Definition: field.h:153
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
ShiftField_lex::m_wt_y
Field m_wt_y
Definition: shiftField_lex.h:51
ShiftField_lex::backward
void backward(Field &, const Field &, const int mu)
Definition: shiftField_lex.cpp:59
Communicator::ipe
static int ipe(const int dir)
logical coordinate of current proc.
Definition: communicator.cpp:105
ShiftField_lex::dn_t
void dn_t(Field &, const Field &, const int boundary_condition)
Definition: shiftField_lex.cpp:756
field_thread-inc.h
ShiftField_lex::m_wt_x
Field m_wt_x
Definition: shiftField_lex.h:50
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Field
Container of Field-type object.
Definition: field.h:46
Communicator::exchange
static int exchange(int count, dcomplex *recv_buf, dcomplex *send_buf, int idir, int ipm, int tag)
receive array of dcomplex from upstream specified by idir and ipm, and send array to downstream.
Definition: communicator.cpp:207
ShiftField_lex::m_Nx
int m_Nx
Definition: shiftField_lex.h:45
ShiftField_lex::m_wt_z
Field m_wt_z
Definition: shiftField_lex.h:52
ShiftField_lex::m_vt_x
Field m_vt_x
comm. buffer in x-direction
Definition: shiftField_lex.h:50
ShiftField_lex::m_vt_z
Field m_vt_z
comm. buffer in z-direction
Definition: shiftField_lex.h:52
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512