forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal_variable.h
More file actions
242 lines (209 loc) · 8.11 KB
/
global_variable.h
File metadata and controls
242 lines (209 loc) · 8.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
//==========================================================
// AUTHOR : mohan
// DATE : 2008-11-07
//==========================================================
#ifndef GLOBAL_VARIABLE_H
#define GLOBAL_VARIABLE_H
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
namespace GlobalV
{
//==========================================================
// EXPLAIN : Basic Global Variables
//==========================================================
extern int NBANDS;
extern int NBANDS_ISTATE; // 1.05 // mohan add 2011-03-22
extern int NLOCAL; // 1.1 // mohan add 2009-05-29
extern double KSPACING;
extern double MIN_DIST_COEF;
extern double PSEUDORCUT;
extern bool PSEUDO_MESH;
extern std::string CALCULATION; // 2 "scf";"nscf" ;"symmetry"
extern int EFIELD_FLAG; // 5 add electric field
extern int DIP_COR_FLAG; // 7 add dipole correction
extern bool GATE_FLAG; // add gate field
extern double NELEC;
extern std::string DFT_FUNCTIONAL; // 6.5 change the DFT functional from input file.
extern double XC_TEMPERATURE;
extern int NSPIN; // 7
extern bool TWO_EFERMI; // 7.5 mohan add 2011-04-03, two fermi energy, exist if magnetization is fixed.
extern int CURRENT_SPIN; // 8
extern int CURRENT_K; // 8
extern int CAL_FORCE; // 8.1
extern double FORCE_THR; // 8.2
extern bool CAL_STRESS; // 8.25 calcualte the stress
extern double PRESS1;
extern double PRESS2;
extern double PRESS3;
extern double PRESSURE;
extern std::string RELAX_METHOD;
extern std::string OUT_LEVEL;
extern int OUT_FREQ_ELEC;
extern int OUT_FREQ_ION;
extern int RELAX_NMAX; // 8.3
extern int SCF_NMAX; // 8.4
extern int MD_NSTEP;
extern std::string BASIS_TYPE; // xiaohui add 2013-09-01
extern std::string KS_SOLVER; // xiaohui add 2013-09-01
extern double SEARCH_RADIUS; // 11.1 // mohan add 2011-03-10
extern bool SEARCH_PBC; // 11.2 // mohan add 2011-03-10
extern bool SPARSE_MATRIX; // 11.3 // mohan add 2009-03-13
// added by zhengdy-soc
extern bool NONCOLIN; // 0 : collinear ; 1 : non-collinear
extern bool LSPINORB; // 0 : no soc ; 1 : has soc
extern bool DOMAG; // 1 : calculate the magnetism with x, y, z component
extern bool DOMAG_Z; // 1 : constrain the magnetism to z axis
extern int NPOL; // 1 : no soc; 2 : has soc
extern int PRENSPIN; // NSPIN used before, for restart with soc
extern double soc_lambda; // soc modulator factor, from 0 to 1
extern int DIAGO_PROC; // 12.1 number of processors used to diag.
extern int PW_DIAG_NMAX; // 13
extern int DIAGO_CG_PREC; // 13.1
extern int PW_DIAG_NDIM; // 14
extern double PW_DIAG_THR; // 15 pw_diag_thr
extern int NB2D; // 16.5 dividsion of 2D_matrix.
extern double SCF_THR; // 17
extern double DQ; // 19 mohan add 2009-09-10
extern int NQX; // 20 mohan add 2009-09-10
extern int NURSE; // 21 mohan add 2010-09-10
extern bool COLOUR; // mohan add 2011-04-26
extern bool GAMMA_ONLY_LOCAL; // 22 : mohan add 2010-10-20
extern bool GAMMA_ONLY_PW; // mohan add 2012-06-05
extern int T_IN_H; // 23, calculate T in H or not.
extern int VL_IN_H; // 24, calculate Vl in H or not.
extern int VNL_IN_H; // 25, calculate Vnl in H or not.
extern int VH_IN_H; // 26, calculate Vh in H or not.
extern int VION_IN_H; // 28, calculate Vion_loc in H or not.
extern double STRESS_THR; // LiuXh add 20180515
extern int ocp;
// extern int ocp_n;
extern std::string ocp_set;
extern std::vector<double> ocp_kb;
// extern double ocp_kb[10000];
extern int out_mul; // qifeng add 2019/9/10
//========================================================================
// EXPLAIN : Parallel information
// GLOBAL VARIABLES :
// NAME : NPROC( global number of process )
// NAME : KPAR( global number of pools )
// NAME : MY_RANK( global index of process )
// NAME : MY_POOL( global index of pool (count in pool))
// NAME : NPROC_IN_POOL( local number of process in a pool.)
// NAME : RANK_IN_POOL( global index of pool (count in process),
// MY_RANK in each pool)
// NAME : DRANK( index of diag world)
// NAME : DSIZE( number of processors in diag world, only 1 DWORLD exist)
// NAME : DCOLOR( color of each group)
// NAME : GRANK( index of grid world)
// NAME : GSIZE( number of processors in each grid world)
//========================================================================
extern int NPROC;
extern int KPAR;
extern int NSTOGROUP;
extern int MY_RANK;
extern int MY_POOL;
extern int MY_STOGROUP;
extern int NPROC_IN_POOL;
extern int NPROC_IN_STOGROUP;
extern int RANK_IN_POOL;
extern int RANK_IN_STOGROUP;
extern int DRANK;
extern int DSIZE;
extern int DCOLOR;
extern int GRANK;
extern int GSIZE;
//==========================================================
// EXPLAIN : readin file dir, output file std::ofstream
// GLOBAL VARIABLES :
// NAME : global_in_card
// NAME : stru_file
// NAME : global_kpoint_card
// NAME : global_wannier_card
// NAME : global_pseudo_dir
// NAME : global_pseudo_type // mohan add 2013-05-20 (xiaohui add 2013-06-23)
// NAME : global_out_dir
// NAME : ofs_running( contain information during runnnig)
// NAME : ofs_warning( contain warning information, including error)
//==========================================================
extern std::string global_in_card;
extern std::string stru_file;
extern std::string global_kpoint_card;
extern std::string global_wannier_card;
extern std::string global_pseudo_dir;
// extern std::string global_pseudo_type; // mohan add 2013-05-20 (xiaohui add 2013-06-23)
extern std::string global_out_dir;
extern std::string global_orbital_dir; // liuyu add 2021-08-14
extern std::string global_readin_dir; // zhengdy modified
extern std::string global_stru_dir; // liuyu add 2022-05-24 for MD STRU
extern std::string global_matrix_dir; // liuyu add 2022-09-19 for HS matrix output
extern std::ofstream ofs_running;
extern std::ofstream ofs_warning;
extern std::ofstream ofs_info;
//==========================================================
// EXPLAIN : test level for each class
//==========================================================
extern int test_input;
extern int test_winput;
extern int test_kpoint;
extern int test_atom;
extern int test_unitcell;
extern int test_symmetry;
extern int test_fft;
extern int test_pw;
extern int test_elec;
extern int test_wf;
extern int test_charge;
extern int test_potential;
extern int test_energy;
extern bool test_skip_ewald;
//==========================================================
// src_onscaling
//==========================================================
extern int test_atom_arrange;
extern int test_atom_input;
extern int test_grid;
extern int test_grid_driver;
extern int test_overlap;
extern int TEST_FORCE; // mohan add 2011-03-18
extern int TEST_STRESS; // zhengdy add 2018-05-16
extern int test_gridt; // mohan add 2011-03-17
//==========================================================
// src_pseudo
//==========================================================
extern int test_pseudo_cell;
extern int test_pp;
extern int test_kmesh;
extern int test_relax_method;
//==========================================================
// src_tools
//==========================================================
extern int test_deconstructor;
extern bool FINAL_SCF; // LiuXh add 20180619
extern bool
deepks_out_labels; // (need libnpy) prints energy and force labels and descriptors for training, wenfei 2022-1-12
extern bool
deepks_scf; //(need libnpy and libtorch) if set 1, a trained model would be needed to cal V_delta and F_delta
extern bool deepks_bandgap; // for bandgap label. QO added 2021-12-15
extern bool deepks_setorb;
extern bool deepks_out_unittest; // if set 1, prints intermediate quantities that shall be used for making unit test
extern std::string deepks_model; // needed when deepks_scf=1
// the following 3 are used when generating jle.orb
extern int bessel_lmax; // lmax used in descriptor, mohan added 2021-01-03
extern double bessel_rcut;
extern double bessel_tol;
// method for dealing with non-local potential in Hamiltonian matrix, 0 for old, 1 for new
extern int vnl_method;
// whether or not output information for each element
extern bool out_element_info;
// implicit solvation
extern bool imp_sol; // sunml added 2022-04-04
extern double eb_k;
extern double tau;
extern double sigma_k;
extern double nc_k;
} // namespace GlobalV
#endif