Bridge++  Ver. 2.0.2
commonParameters.h
Go to the documentation of this file.
1 
14 #ifndef COMMONPARAMETERS_INCLUDED
15 #define COMMONPARAMETERS_INCLUDED
16 
17 #include <string>
18 using std::string;
19 
20 #include <cmath>
21 
22 //#include <valarray>
23 #include <vector>
24 
25 #include "bridge_long.h"
26 
27 #include "IO/bridgeIO.h"
28 
30 
43  public:
44  static const std::string class_name;
45 
46  private:
47  //- color, spinor and space-time dimension
48  static int m_Nc;
49  static const int m_Nd;
50  static const int m_Ndim;
51 
52  static const double m_epsilon_criterion;
53 
54  //- global lattice size
55  static int m_Lx, m_Ly, m_Lz, m_Lt;
56  static long_t m_Lvol;
57 
58  //- Number of processors assigined in each direction
59  static int m_NPEx, m_NPEy, m_NPEz, m_NPEt, m_NPE;
60  static char m_map_grid[16];
61 
62  //- local lattice size
63  static int m_Nx, m_Ny, m_Nz, m_Nt, m_Nvol;
64 
65  static bool m_initialized;
66 
70 
71  // static void setup(const string&);
72  static bool check_parameters();
73 
75 
76  public:
78  static void init(const std::vector<int>& lattice_size,
79  const std::vector<int>& grid_size);
80 
82  static void init(const std::vector<int>& lattice_size,
83  const std::vector<int>& grid_size,
84  const int Nc);
85 
87  static void init_Vlevel(Bridge::VerboseLevel vlevel);
88 
89  static void print_parameters();
90 
91  static int Lx() { return m_Lx; }
92  static int Ly() { return m_Ly; }
93  static int Lz() { return m_Lz; }
94  static int Lt() { return m_Lt; }
95  static long_t Lvol() { return m_Lvol; }
96 
97  static int NPEx() { return m_NPEx; }
98  static int NPEy() { return m_NPEy; }
99  static int NPEz() { return m_NPEz; }
100  static int NPEt() { return m_NPEt; }
101  static int NPE() { return m_NPE; }
102 
103  static char *Grid_map() { return m_map_grid; }
104 
105  static int Nx() { return m_Nx; }
106  static int Ny() { return m_Ny; }
107  static int Nz() { return m_Nz; }
108  static int Nt() { return m_Nt; }
109  static int Nvol() { return m_Nvol; }
110 
111  static int Lsize(const int dir);
112  static int Nsize(const int dir);
113  static int NPEsize(const int dir);
114 
115  static int Nc() { return m_Nc; }
116  static int Nd() { return m_Nd; }
117  static int Ndim() { return m_Ndim; }
118 
119  static double epsilon_criterion() { return m_epsilon_criterion; }
120  static double epsilon_criterion2() { return pow(m_epsilon_criterion, 2); }
121 
122  static Bridge::VerboseLevel Vlevel() { return m_vlevel; }
123 };
124 #endif
CommonParameters::m_map_grid
static char m_map_grid[16]
Definition: commonParameters.h:60
CommonParameters::Ny
static int Ny()
Definition: commonParameters.h:106
CommonParameters::Nz
static int Nz()
Definition: commonParameters.h:107
bridgeIO.h
CommonParameters::Lvol
static long_t Lvol()
Definition: commonParameters.h:95
CommonParameters::Grid_map
static char * Grid_map()
Definition: commonParameters.h:103
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
CommonParameters::m_NPE
static int m_NPE
Definition: commonParameters.h:59
CommonParameters::m_NPEy
static int m_NPEy
Definition: commonParameters.h:59
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
CommonParameters::m_Lvol
static long_t m_Lvol
Definition: commonParameters.h:56
CommonParameters::m_Nvol
static int m_Nvol
Definition: commonParameters.h:63
CommonParameters::m_Lt
static int m_Lt
Definition: commonParameters.h:55
CommonParameters::Ly
static int Ly()
Definition: commonParameters.h:92
CommonParameters::class_name
static const std::string class_name
Definition: commonParameters.h:44
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
CommonParameters::init_Vlevel
static void init_Vlevel(Bridge::VerboseLevel vlevel)
initialization for default verbose level.
Definition: commonParameters.cpp:113
CommonParameters::m_initialized
static bool m_initialized
Definition: commonParameters.h:65
bridge_long.h
CommonParameters::Nx
static int Nx()
Definition: commonParameters.h:105
CommonParameters::m_Lx
static int m_Lx
Definition: commonParameters.h:55
CommonParameters::m_Lz
static int m_Lz
Definition: commonParameters.h:55
CommonParameters::m_NPEt
static int m_NPEt
Definition: commonParameters.h:59
CommonParameters::Lt
static int Lt()
Definition: commonParameters.h:94
CommonParameters::Lx
static int Lx()
Definition: commonParameters.h:91
CommonParameters::Nsize
static int Nsize(const int dir)
Definition: commonParameters.cpp:146
CommonParameters::epsilon_criterion2
static double epsilon_criterion2()
Definition: commonParameters.h:120
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
CommonParameters::Lz
static int Lz()
Definition: commonParameters.h:93
CommonParameters::Nt
static int Nt()
Definition: commonParameters.h:108
CommonParameters::NPEz
static int NPEz()
Definition: commonParameters.h:99
CommonParameters::m_epsilon_criterion
static const double m_epsilon_criterion
Definition: commonParameters.h:52
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
CommonParameters::m_Nd
static const int m_Nd
Definition: commonParameters.h:49
CommonParameters::m_Nc
static int m_Nc
Definition: commonParameters.h:48
CommonParameters::NPEy
static int NPEy()
Definition: commonParameters.h:98
CommonParameters::print_parameters
static void print_parameters()
Definition: commonParameters.cpp:274
CommonParameters::m_vlevel
static Bridge::VerboseLevel m_vlevel
Definition: commonParameters.h:74
CommonParameters::Nd
static int Nd()
Definition: commonParameters.h:116
CommonParameters::Lsize
static int Lsize(const int dir)
Definition: commonParameters.cpp:120
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
CommonParameters::m_Ly
static int m_Ly
Definition: commonParameters.h:55
CommonParameters::NPEx
static int NPEx()
Definition: commonParameters.h:97
CommonParameters::m_Nx
static int m_Nx
Definition: commonParameters.h:63
CommonParameters::CommonParameters
CommonParameters()
Definition: commonParameters.h:67
CommonParameters::NPEt
static int NPEt()
Definition: commonParameters.h:100
CommonParameters::NPEsize
static int NPEsize(const int dir)
Definition: commonParameters.cpp:172
CommonParameters::m_NPEx
static int m_NPEx
Definition: commonParameters.h:59
CommonParameters::operator=
CommonParameters & operator=(const CommonParameters &)
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
CommonParameters::check_parameters
static bool check_parameters()
Definition: commonParameters.cpp:198
CommonParameters::init
static void init(const std::vector< int > &lattice_size, const std::vector< int > &grid_size)
initialization (Nc=3 is assumed).
Definition: commonParameters.cpp:72
CommonParameters::m_Nt
static int m_Nt
Definition: commonParameters.h:63
CommonParameters::CommonParameters
CommonParameters(const CommonParameters &)
Definition: commonParameters.h:68
CommonParameters::m_Nz
static int m_Nz
Definition: commonParameters.h:63
CommonParameters::m_NPEz
static int m_NPEz
Definition: commonParameters.h:59
CommonParameters::m_Ny
static int m_Ny
Definition: commonParameters.h:63
CommonParameters::m_Ndim
static const int m_Ndim
Definition: commonParameters.h:50
CommonParameters::epsilon_criterion
static double epsilon_criterion()
Definition: commonParameters.h:119