Bridge++  Ver.2.1.3
aindex_eo-tmpl.h
Go to the documentation of this file.
1 
11 
12 
13 template<typename REALTYPE>
15  = "AIndex_eo<REALTYPE, ACCEL>";
16 
17 //====================================================================
18 template<typename REALTYPE>
20 {
21  Nx = CommonParameters::Nx();
22  Ny = CommonParameters::Ny();
23  Nz = CommonParameters::Nz();
24  Nt = CommonParameters::Nt();
25  Nvol = CommonParameters::Nvol();
26  Nx2 = Nx/2;
27  Nvol2 = ceil_nwp(Nvol/2);
28  m_vl = CommonParameters::Vlevel();
29 
30  Nc = CommonParameters::Nc();
31  Nd = CommonParameters::Nd();
32  Ndf = 2 * Nc * Nc;
33  Nvcd = 2 * Nc * Nd;
34 
35  if((Nx % 2) == 1){
36  vout.crucial(m_vl, "AIndex_eo: Nx is not even.\n");
37  exit(EXIT_FAILURE);
38  }
39 
40  int ipe1 = Communicator::ipe(1);
41  int ipe2 = Communicator::ipe(2);
42  int ipe3 = Communicator::ipe(3);
43 
44  m_ieo_origin = (ipe1 * Ny + ipe2 * Nz + ipe3 * Nt) % 2;
45  // note that Nx must be even.
46 
47  m_Nsize[0] = Nx;
48  m_Nsize[1] = Ny;
49  m_Nsize[2] = Nz;
50  m_Nsize[3] = Nt;
51 
52  m_Nsize2[0] = Nx2;
53  m_Nsize2[1] = Ny;
54  m_Nsize2[2] = Nz;
55  m_Nsize2[3] = Nt;
56 
57  Leo.resize(Ny * Nz * Nt);
58  for(int t = 0; t < Nt; ++t) {
59  int t2 = ipe3 * Nt + t;
60  for(int z = 0; z < Nz; ++z) {
61  int z2 = ipe2 * Nz + z;
62  for(int y = 0; y < Ny; ++y) {
63  int y2 = ipe1 * Ny + y;
64  Leo[y + Ny * (z + Nz * t)] = (y2 + z2 + t2) % 2;
65  }
66  }
67  }
68 
69 }
70 
71 //============================================================END=====
CommonParameters::Ny
static int Ny()
Definition: commonParameters.h:106
CommonParameters::Nz
static int Nz()
Definition: commonParameters.h:107
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
aindex_eo.h
CommonParameters::Nx
static int Nx()
Definition: commonParameters.h:105
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
CommonParameters::Nt
static int Nt()
Definition: commonParameters.h:108
CommonParameters::Nd
static int Nd()
Definition: commonParameters.h:116
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
Communicator::ipe
static int ipe(const int dir)
logical coordinate of current proc.
Definition: communicator.cpp:105
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:242
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:572
AIndex_eo
Definition: aindex_eo_base.h:17