Skip to content

Commit e039267

Browse files
committed
Remove parameter.h
1 parent f09748a commit e039267

5 files changed

Lines changed: 24 additions & 13 deletions

File tree

source/source_basis/module_ao/ORB_read.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "source_base/parallel_common.h"
55
#include "source_base/timer.h"
66
#include "source_base/tool_check.h"
7-
#include "source_io/module_parameter/parameter.h"
87

98
#include <algorithm>
109
#include <cassert>
@@ -58,6 +57,7 @@ void LCAO_Orbitals::init(
5857
const double& lcao_rmax_in,
5958
const bool& deepks_setorb,
6059
const int& out_mat_r,
60+
const bool& out_element_info,
6161
const bool& force_flag,
6262
const int& my_rank
6363
)
@@ -86,7 +86,7 @@ void LCAO_Orbitals::init(
8686
#ifdef __MPI
8787
bcast_files(ntype, my_rank);
8888
#endif
89-
Read_Orbitals(ofs_in, ntype, lmax, deepks_setorb, out_mat_r, force_flag, my_rank);
89+
Read_Orbitals(ofs_in, ntype, lmax, deepks_setorb, out_mat_r, out_element_info, force_flag, my_rank);
9090
return;
9191
}
9292

@@ -156,6 +156,7 @@ void LCAO_Orbitals::Read_Orbitals(std::ofstream& ofs_in,
156156
const int& lmax_in,
157157
const bool& deepks_setorb,
158158
const int& out_mat_r,
159+
const bool& out_element_info,
159160
const bool& force_flag, // mohan add 2021-05-07
160161
const int& my_rank) // mohan add 2021-04-26
161162
{
@@ -247,7 +248,7 @@ void LCAO_Orbitals::Read_Orbitals(std::ofstream& ofs_in,
247248
this->Phi = new Numerical_Orbital[ntype];
248249
for (int it = 0; it < ntype; it++)
249250
{
250-
this->Read_PAO(ofs_in, it, force_flag, my_rank);
251+
this->Read_PAO(ofs_in, it, out_element_info, force_flag, my_rank);
251252
// caoyu add 2021-05-24 to reconstruct atom_arrange::set_sr_NL
252253
this->rcutmax_Phi = std::max(this->rcutmax_Phi, this->Phi[it].getRcut());
253254
}
@@ -263,7 +264,7 @@ void LCAO_Orbitals::Read_Orbitals(std::ofstream& ofs_in,
263264

264265
delete[] this->Alpha;
265266
this->Alpha = new Numerical_Orbital[1]; // not related to atom type -- remain to be discussed
266-
this->Read_Descriptor(ofs_in, force_flag, my_rank);
267+
this->Read_Descriptor(ofs_in, out_element_info, force_flag, my_rank);
267268
}
268269

269270
ModuleBase::timer::end("LCAO_Orbitals", "Read_Orbitals");
@@ -279,6 +280,7 @@ void LCAO_Orbitals::Read_Orbitals(std::ofstream& ofs_in,
279280
//-------------------------------------------------------
280281
void LCAO_Orbitals::Read_PAO(std::ofstream& ofs_in,
281282
const int& it,
283+
const bool& out_element_info,
282284
const bool& force_flag, // mohan add 2021-05-07
283285
const int& my_rank) // mohan add 2021-04-26
284286
{
@@ -311,7 +313,7 @@ void LCAO_Orbitals::Read_PAO(std::ofstream& ofs_in,
311313
int lmaxt = 0;
312314
int nchimaxt = 0;
313315

314-
this->read_orb_file(ofs_in, in_ao, it, lmaxt, nchimaxt, this->Phi, force_flag, my_rank);
316+
this->read_orb_file(ofs_in, in_ao, it, lmaxt, nchimaxt, this->Phi, out_element_info, force_flag, my_rank);
315317

316318
// lmax and nchimax for all types
317319
this->lmax = std::max(this->lmax, lmaxt);
@@ -323,6 +325,7 @@ void LCAO_Orbitals::Read_PAO(std::ofstream& ofs_in,
323325

324326
// caoyu add 2021-3-16
325327
void LCAO_Orbitals::Read_Descriptor(std::ofstream& ofs_in,
328+
const bool& out_element_info,
326329
const bool& force_flag, // mohan add 2021-05-07
327330
const int& my_rank) // read descriptor basis
328331
{
@@ -355,7 +358,7 @@ void LCAO_Orbitals::Read_Descriptor(std::ofstream& ofs_in,
355358
this->lmax_d = 0;
356359
this->nchimax_d = 0;
357360

358-
this->read_orb_file(ofs_in, in_de, 0, this->lmax_d, this->nchimax_d, this->Alpha, force_flag, my_rank);
361+
this->read_orb_file(ofs_in, in_de, 0, this->lmax_d, this->nchimax_d, this->Alpha, out_element_info, force_flag, my_rank);
359362

360363
in_de.close();
361364

@@ -368,6 +371,7 @@ void LCAO_Orbitals::read_orb_file(std::ofstream& ofs_in, // GlobalV::ofs_running
368371
int& lmax,
369372
int& nchimax,
370373
Numerical_Orbital* ao,
374+
const bool& out_element_info,
371375
const bool& force_flag,
372376
const int& my_rank)
373377
{
@@ -588,7 +592,7 @@ void LCAO_Orbitals::read_orb_file(std::ofstream& ofs_in, // GlobalV::ofs_running
588592
this->kmesh,
589593
this->dk,
590594
this->dr_uniform,
591-
PARAM.inp.out_element_info,
595+
out_element_info,
592596
true,
593597
force_flag); // delta k mesh in reciprocal space
594598

source/source_basis/module_ao/ORB_read.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class LCAO_Orbitals
3434
const double& lcao_rmax_in,
3535
const bool& deepks_setorb,
3636
const int& out_mat_r,
37+
const bool& out_element_info,
3738
const bool& force_flag,
3839
const int& my_rank
3940
);
@@ -44,19 +45,22 @@ class LCAO_Orbitals
4445
const int &lmax_in,
4546
const bool &deepks_setorb, // mohan add 2021-04-25
4647
const int &out_mat_r, // mohan add 2021-04-26
48+
const bool &out_element_info,
4749
const bool &force_flag, // mohan add 2021-05-07
4850
const int &my_rank); // mohan add 2021-04-26
4951

5052
void Read_PAO(
5153
std::ofstream &ofs_in,
5254
const int& it,
55+
const bool &out_element_info,
5356
const bool &force_flag, // mohan add 2021-05-07
5457
const int& my_rank); // mohan add 2021-04-26
5558

5659

5760

5861
void Read_Descriptor(
5962
std::ofstream &ofs_in,
63+
const bool &out_element_info,
6064
const bool &force_flag, // mohan add 2021-05-07
6165
const int &my_rank); //caoyu add 2020-3-16
6266

@@ -119,11 +123,12 @@ class LCAO_Orbitals
119123

120124
void read_orb_file(
121125
std::ofstream &ofs_in,
122-
std::ifstream &ifs,
123-
const int &it,
124-
int &lmax,
125-
int &nchimax,
126+
std::ifstream &ifs,
127+
const int &it,
128+
int &lmax,
129+
int &nchimax,
126130
Numerical_Orbital* ao,
131+
const bool &out_element_info,
127132
const bool &force_flag, // mohan add 2021-05-07
128133
const int &my_rank); //caoyu add 2021-04-26
129134

source/source_basis/module_ao/test/ORB_read_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ void LcaoOrbitalsTest::lcao_read() {
9898
lcao_.dR = dR_;
9999
lcao_.Rmax = Rmax_;
100100

101-
lcao_.Read_Orbitals(ofs_log_, ntype_, lmax_, deepks_setorb_, out_mat_r_,
102-
force_flag_, my_rank_);
101+
lcao_.Read_Orbitals(ofs_log_, ntype_, lmax_, deepks_setorb_, out_mat_r_,
102+
false /* out_element_info */, force_flag_, my_rank_);
103103
}
104104

105105

source/source_basis/module_ao/test/ORB_unittest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void test_orb::set_orbs()
8383
lcao_rmax,
8484
0,
8585
0,
86+
false, // out_element_info
8687
1, // force
8788
0); // myrank
8889

source/source_lcao/module_deepks/test/LCAO_deepks_test_prep.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ void test_deepks<T>::set_orbs()
194194
lcao_rmax,
195195
PARAM.sys.deepks_setorb,
196196
out_mat_r,
197+
PARAM.inp.out_element_info,
197198
PARAM.input.cal_force,
198199
my_rank);
199200

0 commit comments

Comments
 (0)