Skip to content

Commit f4996ed

Browse files
authored
Merge branch 'deepmodeling:develop' into develop
2 parents a13470f + 06cffb7 commit f4996ed

File tree

17 files changed

+110
-139
lines changed

17 files changed

+110
-139
lines changed

docs/quick_start/output.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ The following files are the central output files for ABACUS. After executing the
66

77
Different from `INPUT` given by the users, `OUT.suffix/INPUT` contains all parameters in ABACUS.
88

9-
> **Note:** `OUT.suffix/INPUT` contain the initial default of ABACUS instead of the real parameters used in calculations. This file is stored for reproduction in case the default value is changed during development. If you want to figure out the real parameters used in calculations, you can open `OUT.suffix/runing_scf.log` and research corresponding parameter you are interested.
9+
> **Note:** `OUT.suffix/INPUT` contains the **actual parameters used in the calculation**, including:
10+
> 1. **User-specified parameters** (explicitly defined in your input file or command-line arguments, overriding default parameters).
11+
> 2. **System default parameters** (automatically applied when not explicitly provided by the user).
12+
13+
14+
This file ensures calculations can be fully reproduced, even if default values change in future ABACUS versions.
15+
Also notice that in rare cases, a small number of parameters may be dynamically reset to appropriate values during runtime.
1016

1117
For a complete list of input parameters, please consult this [instruction](../advanced/input_files/input-main.md).
1218

source/module_base/kernels/math_ylm_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct cal_ylm_real_op {
2020
/// @param PI_HALF - ModuleBase::PI_HALF
2121
/// @param FOUR_PI - ModuleBase::FOUR_PI,
2222
/// @param SQRT_INVERSE_FOUR_PI - ModuleBase::SQRT_INVERSE_FOUR_PI,
23-
/// @param g - input array with size npw * 3, GlobalC::wf.get_1qvec_cartesian
23+
/// @param g - input array with size npw * 3, wf.get_1qvec_cartesian
2424
/// @param p - intermediate array
2525
///
2626
/// Output Parameters

source/module_basis/module_nao/two_center_bundle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TwoCenterBundle
2828
void tabulate(const double lcao_ecut, const double lcao_dk, const double lcao_dr, const double lcao_rmax);
2929

3030
/**
31-
* @brief Overwrites the content of a LCAO_Orbitals object (e.g. GlobalC::ORB)
31+
* @brief Overwrites the content of a LCAO_Orbitals object (e.g. ORB)
3232
* with the current object.
3333
*
3434
* This function provides an interface to the corresponding object in the old module_ao.

source/module_cell/test/klist_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ Fcoef::~Fcoef()
8484
{
8585
}
8686

87-
namespace GlobalC
88-
{
89-
Parallel_Kpoints Pkpoints;
90-
} // namespace GlobalC
9187

9288
/************************************************
9389
* unit test of class K_Vectors

source/module_cell/test/klist_test_para.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ Fcoef::~Fcoef()
8787
{
8888
}
8989

90-
namespace GlobalC
91-
{
92-
Parallel_Kpoints Pkpoints;
93-
UnitCell ucell;
94-
} // namespace GlobalC
9590

9691
/************************************************
9792
* unit test of class K_Vectors

source/module_hamilt_general/module_surchem/test/cal_epsilon_test.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ TEST_F(cal_epsilon_test, cal_epsilon)
4545
device_flag = "cpu";
4646

4747
ModulePW::PW_Basis pwtest(device_flag, precision_flag);
48-
GlobalC::rhopw = &pwtest;
49-
5048
ModuleBase::Matrix3 latvec;
5149
int nx, ny, nz; // f*G
5250
double wfcecut;
@@ -70,17 +68,17 @@ TEST_F(cal_epsilon_test, cal_epsilon)
7068
#endif
7169

7270
#ifdef __MPI
73-
GlobalC::rhopw->initmpi(1, 0, POOL_WORLD);
71+
pwtest.initmpi(1, 0, POOL_WORLD);
7472
#endif
7573
// pwtest.initgrids(lat0,latvec,wfcecut);
76-
GlobalC::rhopw->initgrids(lat0, latvec, wfcecut);
77-
GlobalC::rhopw->initparameters(gamma_only, wfcecut, distribution_type, xprime);
78-
GlobalC::rhopw->setuptransform();
79-
GlobalC::rhopw->collect_local_pw();
74+
pwtest.initgrids(lat0, latvec, wfcecut);
75+
pwtest.initparameters(gamma_only, wfcecut, distribution_type, xprime);
76+
pwtest.setuptransform();
77+
pwtest.collect_local_pw();
8078

81-
GlobalC::rhopw->nrxx = 125000;
82-
const int npw = GlobalC::rhopw->npw;
83-
const int nrxx = GlobalC::rhopw->nrxx;
79+
pwtest.nrxx = 125000;
80+
const int npw = pwtest.npw;
81+
const int nrxx = pwtest.nrxx;
8482

8583
std::ifstream fin;
8684
fin.open("./support/PS_TOTN_real.in");
@@ -99,8 +97,7 @@ TEST_F(cal_epsilon_test, cal_epsilon)
9997
double* epsilon = new double[nrxx];
10098
double* epsilon0 = new double[nrxx];
10199

102-
GlobalC::rhopw = &pwtest;
103-
solvent_model.cal_epsilon(GlobalC::rhopw, PS_TOTN_real, epsilon, epsilon0);
100+
solvent_model.cal_epsilon(&pwtest, PS_TOTN_real, epsilon, epsilon0);
104101

105102
EXPECT_EQ(PS_TOTN_real[0], 0.274231);
106103
EXPECT_EQ(epsilon[0], 1);

source/module_hamilt_general/module_surchem/test/cal_pseudo_test.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ TEST_F(cal_pseudo_test, gauss_charge)
3737
device_flag = "cpu";
3838

3939
ModulePW::PW_Basis pwtest(device_flag, precision_flag);
40-
GlobalC::rhopw = &pwtest;
4140
ModuleBase::Matrix3 latvec;
4241
int nx, ny, nz; // f*G
4342
double wfcecut;
@@ -58,26 +57,26 @@ TEST_F(cal_pseudo_test, gauss_charge)
5857
#endif
5958

6059
#ifdef __MPI
61-
GlobalC::rhopw->initmpi(1, 0, POOL_WORLD);
60+
pwtest.initmpi(1, 0, POOL_WORLD);
6261
#endif
6362
// pwtest.initgrids(lat0,latvec,wfcecut);
6463

65-
GlobalC::rhopw->initgrids(ucell.lat0, ucell.latvec, wfcecut);
64+
pwtest.initgrids(ucell.lat0, ucell.latvec, wfcecut);
6665

67-
GlobalC::rhopw->initparameters(gamma_only, wfcecut, distribution_type, xprime);
68-
GlobalC::rhopw->setuptransform();
69-
GlobalC::rhopw->collect_local_pw();
70-
GlobalC::rhopw->collect_uniqgg();
66+
pwtest.initparameters(gamma_only, wfcecut, distribution_type, xprime);
67+
pwtest.setuptransform();
68+
pwtest.collect_local_pw();
69+
pwtest.collect_uniqgg();
7170

72-
const int npw = GlobalC::rhopw->npw;
73-
const int nrxx = GlobalC::rhopw->nrxx;
71+
const int npw = pwtest.npw;
72+
const int nrxx = pwtest.nrxx;
7473
complex<double>* N = new complex<double>[npw];
7574
ModuleBase::GlobalFunc::ZEROS(N, npw);
7675

7776
Structure_Factor sf;
7877
sf.nbspline = -1;
7978

80-
solvent_model.gauss_charge(ucell, pgrid, GlobalC::rhopw, N, &sf);
79+
solvent_model.gauss_charge(ucell, pgrid, &pwtest, N, &sf);
8180

8281
EXPECT_NEAR(N[14].real(), 0.002, 1e-9);
8382
EXPECT_NEAR(N[16].real(), -0.001573534, 1e-9);
@@ -92,7 +91,6 @@ TEST_F(cal_pseudo_test, cal_pseudo)
9291
device_flag = "cpu";
9392
Setcell::setupcell(ucell);
9493
ModulePW::PW_Basis pwtest(device_flag, precision_flag);
95-
GlobalC::rhopw = &pwtest;
9694
ModuleBase::Matrix3 latvec;
9795
int nx, ny, nz; // f*G
9896
double wfcecut;
@@ -113,18 +111,18 @@ TEST_F(cal_pseudo_test, cal_pseudo)
113111
#endif
114112

115113
#ifdef __MPI
116-
GlobalC::rhopw->initmpi(1, 0, POOL_WORLD);
114+
pwtest.initmpi(1, 0, POOL_WORLD);
117115
#endif
118116
// pwtest.initgrids(lat0,latvec,wfcecut);
119117

120-
GlobalC::rhopw->initgrids(ucell.lat0, ucell.latvec, wfcecut);
121-
GlobalC::rhopw->initparameters(gamma_only, wfcecut, distribution_type, xprime);
122-
GlobalC::rhopw->setuptransform();
123-
GlobalC::rhopw->collect_local_pw();
124-
GlobalC::rhopw->collect_uniqgg();
118+
pwtest.initgrids(ucell.lat0, ucell.latvec, wfcecut);
119+
pwtest.initparameters(gamma_only, wfcecut, distribution_type, xprime);
120+
pwtest.setuptransform();
121+
pwtest.collect_local_pw();
122+
pwtest.collect_uniqgg();
125123

126-
const int npw = GlobalC::rhopw->npw;
127-
const int nrxx = GlobalC::rhopw->nrxx;
124+
const int npw = pwtest.npw;
125+
const int nrxx = pwtest.nrxx;
128126

129127
Structure_Factor sf;
130128
sf.nbspline = -1;
@@ -137,7 +135,7 @@ TEST_F(cal_pseudo_test, cal_pseudo)
137135
}
138136

139137
complex<double>* PS_TOTN = new complex<double>[npw];
140-
solvent_model.cal_pseudo(ucell, pgrid, GlobalC::rhopw, Porter_g, PS_TOTN, &sf);
138+
solvent_model.cal_pseudo(ucell, pgrid, &pwtest, Porter_g, PS_TOTN, &sf);
141139

142140
EXPECT_NEAR(PS_TOTN[16].real(), 0.098426466, 1e-9);
143141
EXPECT_NEAR(PS_TOTN[14].real(), 0.102, 1e-9);

source/module_hamilt_general/module_surchem/test/cal_totn_test.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ TEST_F(cal_totn_test, cal_totn)
3535
device_flag = "cpu";
3636

3737
ModulePW::PW_Basis pwtest(device_flag, precision_flag);
38-
GlobalC::rhopw = &pwtest;
3938
ModuleBase::Matrix3 latvec;
4039
int nx, ny, nz; // f*G
4140
double wfcecut;
@@ -56,19 +55,19 @@ TEST_F(cal_totn_test, cal_totn)
5655
#endif
5756

5857
#ifdef __MPI
59-
GlobalC::rhopw->initmpi(1, 0, POOL_WORLD);
58+
pwtest.initmpi(1, 0, POOL_WORLD);
6059
#endif
6160
// pwtest.initgrids(lat0,latvec,wfcecut);
6261

63-
GlobalC::rhopw->initgrids(ucell.lat0, ucell.latvec, wfcecut);
62+
pwtest.initgrids(ucell.lat0, ucell.latvec, wfcecut);
6463

65-
GlobalC::rhopw->initparameters(gamma_only, wfcecut, distribution_type, xprime);
66-
GlobalC::rhopw->setuptransform();
67-
GlobalC::rhopw->collect_local_pw();
68-
GlobalC::rhopw->collect_uniqgg();
64+
pwtest.initparameters(gamma_only, wfcecut, distribution_type, xprime);
65+
pwtest.setuptransform();
66+
pwtest.collect_local_pw();
67+
pwtest.collect_uniqgg();
6968

70-
const int npw = GlobalC::rhopw->npw;
71-
const int nrxx = GlobalC::rhopw->nrxx;
69+
const int npw = pwtest.npw;
70+
const int nrxx = pwtest.nrxx;
7271
complex<double>* N = new complex<double>[npw];
7372
ModuleBase::GlobalFunc::ZEROS(N, npw);
7473
complex<double>* TOTN = new complex<double>[npw];
@@ -88,7 +87,7 @@ TEST_F(cal_totn_test, cal_totn)
8887
vloc[i] = 0.1;
8988
}
9089

91-
solvent_model.cal_totn(ucell, GlobalC::rhopw, Porter_g, N, TOTN, vloc);
90+
solvent_model.cal_totn(ucell, &pwtest, Porter_g, N, TOTN, vloc);
9291

9392
EXPECT_NEAR(TOTN[0].real(), -0.0999496256, 1e-10);
9493
EXPECT_NEAR(TOTN[0].imag(), -1.299621928166352e-7, 1e-10);
@@ -107,7 +106,6 @@ TEST_F(cal_totn_test, induced_charge)
107106
Setcell::setupcell(ucell);
108107

109108
ModulePW::PW_Basis pwtest(device_flag, precision_flag);
110-
GlobalC::rhopw = &pwtest;
111109
ModuleBase::Matrix3 latvec;
112110
int nx, ny, nz; // f*G
113111
double wfcecut;
@@ -126,19 +124,19 @@ TEST_F(cal_totn_test, induced_charge)
126124
#endif
127125

128126
#ifdef __MPI
129-
GlobalC::rhopw->initmpi(1, 0, POOL_WORLD);
127+
pwtest.initmpi(1, 0, POOL_WORLD);
130128
#endif
131129
// pwtest.initgrids(lat0,latvec,wfcecut);
132130

133-
GlobalC::rhopw->initgrids(ucell.lat0, ucell.latvec, wfcecut);
131+
pwtest.initgrids(ucell.lat0, ucell.latvec, wfcecut);
134132

135-
GlobalC::rhopw->initparameters(gamma_only, wfcecut, distribution_type, xprime);
136-
GlobalC::rhopw->setuptransform();
137-
GlobalC::rhopw->collect_local_pw();
138-
GlobalC::rhopw->collect_uniqgg();
133+
pwtest.initparameters(gamma_only, wfcecut, distribution_type, xprime);
134+
pwtest.setuptransform();
135+
pwtest.collect_local_pw();
136+
pwtest.collect_uniqgg();
139137

140138
double fac;
141-
fac = ModuleBase::e2 * ModuleBase::FOUR_PI / (ucell.tpiba2 * GlobalC::rhopw->gg[0]);
139+
fac = ModuleBase::e2 * ModuleBase::FOUR_PI / (ucell.tpiba2 * pwtest.gg[0]);
142140
complex<double> delta_phi{-2.0347933860e-05, 4.5900395826e-07};
143141
complex<double> induced_charge;
144142
induced_charge = -delta_phi / fac;

0 commit comments

Comments
 (0)