forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal_variable.cpp
More file actions
215 lines (187 loc) · 6.19 KB
/
global_variable.cpp
File metadata and controls
215 lines (187 loc) · 6.19 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
//==========================================================
// AUTHOR : mohan
// DATE : 2008-11-07
//==========================================================
#include "global_variable.h"
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
namespace GlobalV
{
//----------------------------------------------------------
// EXPLAIN : Basic Global Variables
// In practice calculation, these values are set in
// input.cpp.
//----------------------------------------------------------
int NBANDS = 0;
int NBANDS_ISTATE = 0; // default number.
int NLOCAL = 0; // total number of local basis.
double KSPACING = 0.0;
double MIN_DIST_COEF = 0.2;
double PSEUDORCUT;
bool PSEUDO_MESH;
std::string CALCULATION = "scf";
int EFIELD_FLAG = 0; // 5: add electric field
int DIP_COR_FLAG = 0; // 7: add dipole field
bool GATE_FLAG = false; // add gate field
double NELEC = 0;
std::string DFT_FUNCTIONAL = "default";
double XC_TEMPERATURE = 0.0;
int NSPIN = 1; // LDA
bool TWO_EFERMI = 0; // two fermi energy, exist only magnetization is fixed.
int CURRENT_SPIN = 0;
int CURRENT_K = 0;
int CAL_FORCE = 0; // if cal_force >1, means do the grid integration 'cal_force' times.
double FORCE_THR = 1.0e-3;
bool CAL_STRESS = false;
double PRESS1 = 0.0;
double PRESS2 = 0.0;
double PRESS3 = 0.0;
double PRESSURE = 0.0;
std::string RELAX_METHOD = "bfgs";
std::string OUT_LEVEL = "ie";
int OUT_FREQ_ELEC = 0;
int OUT_FREQ_ION = 0;
int RELAX_NMAX = 20;
int MD_NSTEP = 20;
int SCF_NMAX = 50;
std::string BASIS_TYPE = "pw"; // xiaohui add 2013-09-01
std::string KS_SOLVER = "cg"; // xiaohui add 2013-09-01
double SEARCH_RADIUS = -1.0;
bool SEARCH_PBC = true;
bool SPARSE_MATRIX = false;
int DIAGO_PROC = 0;
int PW_DIAG_NMAX = 30;
int DIAGO_CG_PREC = 1; // mohan add 2012-03-31
int PW_DIAG_NDIM = 4;
double PW_DIAG_THR = 1.0e-2;
int NB2D = 1;
double SCF_THR = 1.0e-9;
double DQ = 0.010; // space between Q points of the reciprocal radial tab
int NQX = 10000; // number of points describing reciprocal radial tab
int NURSE = 0; // used for debug.
bool COLOUR = 0;
bool GAMMA_ONLY_LOCAL = 0; // mohan add 2010-10-20
bool GAMMA_ONLY_PW = 0; // mohan add 2012-06-05
int T_IN_H = 1; // mohan add 2010-11-28
int VL_IN_H = 1;
int VNL_IN_H = 1;
int VH_IN_H = 1;
int VION_IN_H = 1;
int ZEEMAN_IN_H = 1;
double STRESS_THR = 1.0e-2; // LiuXh add 20180515
int ocp = 0;
std::string ocp_set = "none";
std::vector<double> ocp_kb(10000);
// int ocp_n=0;
// double ocp_kb[10000];
int out_mul = 0; // 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)
//----------------------------------------------------------
int NPROC = 1;
int KPAR = 1;
int NSTOGROUP = 1;
int MY_RANK = 0;
int MY_POOL = 0;
int MY_STOGROUP = 0;
int NPROC_IN_POOL = 1;
int NPROC_IN_STOGROUP = 1;
int RANK_IN_POOL = 0;
int RANK_IN_STOGROUP = 0;
int DRANK = -1; // mohan add 2012-01-13, must be -1, so we can recognize who didn't in DIAG_WORLD
int DSIZE = KPAR;
int DCOLOR = -1;
int GRANK = MY_RANK;
int GSIZE = DSIZE;
//----------------------------------------------------------
// EXPLAIN :
//----------------------------------------------------------
std::string global_in_card = "INPUT";
std::string stru_file = "STRU";
std::string global_kpoint_card = "KPT";
std::string global_wannier_card;
std::string global_pseudo_dir = "";
std::string global_orbital_dir = ""; // liuyu add 2021-08-14
// std::string global_pseudo_type = "auto";
std::string global_epm_pseudo_card;
std::string global_out_dir;
std::string global_readin_dir; // zhengdy modified
std::string global_stru_dir;
std::string global_matrix_dir;
std::ofstream ofs_running;
std::ofstream ofs_warning;
std::ofstream ofs_info; // output math lib info
//----------------------------------------------------------
// EXPLAIN : test level for each class
//----------------------------------------------------------
int test_input = 0;
int test_winput = 0;
int test_kpoint = 0;
int test_atom = 0;
int test_unitcell = 0;
int test_symmetry = 0;
int test_fft = 0;
int test_pw = 0;
int test_elec = 0;
int test_wf = 0;
int test_charge = 0;
int test_potential = 0;
int test_energy = 0;
// for test purpose, skip ewald calculation
bool test_skip_ewald = false;
//----------------------------------------------------------
// src_lcao
//----------------------------------------------------------
int test_atom_arrange = 0;
int test_atom_input = 0;
int test_grid = 0; // 4 now
int test_grid_driver = 0; // 4 now
int test_overlap = 0;
int TEST_FORCE = 0; // mohan add 2011-03-18
int TEST_STRESS = 0; // zhengdy add 2018-05-16
int test_gridt = 0; // mohan add 2011-03-17
//----------------------------------------------------------
// src_pseudo
//----------------------------------------------------------
int test_pseudo_cell = 0; // 2 : output readin data
int test_pp = 0; // pp: pseudopotential
int test_kmesh = 0;
int test_relax_method = 0;
//----------------------------------------------------------
// src_tools
//----------------------------------------------------------
int test_deconstructor = 0;
// added by zhengdy-soc
bool NONCOLIN = false;
bool LSPINORB = false;
bool DOMAG = false;
bool DOMAG_Z = false;
int NPOL = 1;
int PRENSPIN = 1;
double soc_lambda = 1.0;
bool FINAL_SCF = false; // LiuXh add 20180619
bool deepks_out_labels = false; // caoyu add 2021-10-16 for DeePKS, wenfei 2022-1-16
bool deepks_scf = false; // caoyu add 2021-10-16 for DeePKS, wenfei 2022-1-16
bool deepks_bandgap = false; // for bandgap label. QO added 2021-12-15
bool deepks_out_unittest = false;
bool deepks_setorb = false;
int vnl_method = 1; // set defauld vnl method as old, added by zhengdy 2021-10-11
bool out_element_info = false; // added by zhengdy 2021-11-26
bool imp_sol = false; // implicit solvation. sunml added 2022-04-04
double eb_k = 80.0;
double tau = 1.0798 * 1e-5;
double sigma_k = 0.6;
double nc_k = 0.00037;
} // namespace GlobalV