66#include " source_cell/check_atomic_stru.h"
77#include " source_cell/unitcell.h"
88#include " source_cell/cal_nelec_nband.h"
9- #include " source_estate /read_pseudo.h"
9+ #include " source_cell /read_pseudo.h"
1010#include < valarray>
1111#include < vector>
1212#include " string.h"
@@ -111,7 +111,7 @@ TEST_F(UcellDeathTest, ReadCellPPWarning1) {
111111 const std::string global_out_dir = " ./" ;
112112 const std::string dft_functional = " default" ;
113113 pp_dir = " ./support/" ;
114- EXPECT_EXIT (elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell,
114+ EXPECT_EXIT (unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell,
115115 global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda),
116116 ::testing::ExitedWithCode (1 ),"");
117117 output = testing::internal::GetCapturedStdout ();
@@ -127,7 +127,7 @@ TEST_F(UcellDeathTest, ReadCellPPWarning2) {
127127 testing::internal::CaptureStdout ();
128128 const std::string global_out_dir = " ./" ;
129129 const std::string dft_functional = " default" ;
130- EXPECT_EXIT (elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell,
130+ EXPECT_EXIT (unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell,
131131 global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda),
132132 ::testing::ExitedWithCode (1 ), "");
133133 output = testing::internal::GetCapturedStdout ();
@@ -145,7 +145,7 @@ TEST_F(UcellDeathTest, ReadCellPPWarning3) {
145145 const std::string global_out_dir = " ./" ;
146146 const std::string dft_functional = " default" ;
147147 pp_dir = " ./support/" ;
148- EXPECT_EXIT (elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell,
148+ EXPECT_EXIT (unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell,
149149 global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda),
150150 ::testing::ExitedWithCode (1 ),"");
151151 output = testing::internal::GetCapturedStdout ();
@@ -160,7 +160,7 @@ TEST_F(UcellDeathTest, ReadCellPPWarning4) {
160160 const std::string dft_functional = " LDA" ;
161161 testing::internal::CaptureStdout ();
162162 const std::string global_out_dir = " ./" ;
163- EXPECT_NO_THROW (elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda));
163+ EXPECT_NO_THROW (unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda));
164164 output = testing::internal::GetCapturedStdout ();
165165 EXPECT_THAT (output, testing::HasSubstr (" DFT FUNC. (PSEUDO) : PBE" ));
166166 EXPECT_THAT (output, testing::HasSubstr (" DFT FUNC. (SET TO) : LDA" ));
@@ -174,7 +174,7 @@ TEST_F(UcellDeathTest, ReadCellPPWarning5) {
174174 testing::internal::CaptureStdout ();
175175 const std::string global_out_dir = " ./" ;
176176 const std::string dft_functional = " default" ;
177- EXPECT_EXIT (elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda),
177+ EXPECT_EXIT (unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda),
178178 ::testing::ExitedWithCode (1 ),
179179 "");
180180 output = testing::internal::GetCapturedStdout ();
@@ -188,7 +188,7 @@ TEST_F(UcellTest, ReadCellPP) {
188188 ucell->atoms [1 ].flag_empty_element = true ;
189189 const std::string global_out_dir = " ./" ;
190190 const std::string dft_functional = " default" ;
191- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
191+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
192192 EXPECT_EQ (ucell->atoms [0 ].ncpp .pp_type , " NC" );
193193 EXPECT_FALSE (ucell->atoms [0 ].ncpp .has_so ); // becomes false in average_p
194194 EXPECT_FALSE (ucell->atoms [1 ].ncpp .has_so );
@@ -216,8 +216,8 @@ TEST_F(UcellTest, CalMeshx) {
216216 const double soc_lambda = 0.0 ;
217217 const std::string global_out_dir = " ./" ;
218218 const std::string dft_functional = " default" ;
219- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
220- elecstate ::cal_meshx (ucell->meshx ,ucell->atoms ,ucell->ntype );
219+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
220+ unitcell ::cal_meshx (ucell->meshx ,ucell->atoms ,ucell->ntype );
221221 EXPECT_EQ (ucell->atoms [0 ].ncpp .msh , 1247 );
222222 EXPECT_EQ (ucell->atoms [1 ].ncpp .msh , 1165 );
223223 EXPECT_EQ (ucell->meshx , 1247 );
@@ -230,10 +230,10 @@ TEST_F(UcellTest, CalNatomwfc1) {
230230 const std::string global_out_dir = " ./" ;
231231 const std::string dft_functional = " default" ;
232232 const int nspin = 1 ;
233- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
233+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
234234 EXPECT_FALSE (ucell->atoms [0 ].ncpp .has_so );
235235 EXPECT_FALSE (ucell->atoms [1 ].ncpp .has_so );
236- elecstate ::cal_natomwfc (ofs,ucell->natomwfc ,ucell->ntype ,ucell->atoms ,nspin);
236+ unitcell ::cal_natomwfc (ofs,ucell->natomwfc ,ucell->ntype ,ucell->atoms ,nspin);
237237 EXPECT_EQ (ucell->atoms [0 ].ncpp .nchi , 2 );
238238 EXPECT_EQ (ucell->atoms [1 ].ncpp .nchi , 1 );
239239 EXPECT_EQ (ucell->atoms [0 ].na , 1 );
@@ -248,10 +248,10 @@ TEST_F(UcellTest, CalNatomwfc2) {
248248 const int nspin = 4 ;
249249 const std::string global_out_dir = " ./" ;
250250 const std::string dft_functional = " default" ;
251- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
251+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
252252 EXPECT_FALSE (ucell->atoms [0 ].ncpp .has_so );
253253 EXPECT_FALSE (ucell->atoms [1 ].ncpp .has_so );
254- elecstate ::cal_natomwfc (ofs,ucell->natomwfc ,ucell->ntype ,ucell->atoms ,nspin);
254+ unitcell ::cal_natomwfc (ofs,ucell->natomwfc ,ucell->ntype ,ucell->atoms ,nspin);
255255 EXPECT_EQ (ucell->atoms [0 ].ncpp .nchi , 2 );
256256 EXPECT_EQ (ucell->atoms [1 ].ncpp .nchi , 1 );
257257 EXPECT_EQ (ucell->atoms [0 ].na , 1 );
@@ -266,10 +266,10 @@ TEST_F(UcellTest, CalNatomwfc3) {
266266 const int nspin = 4 ;
267267 const std::string global_out_dir = " ./" ;
268268 const std::string dft_functional = " default" ;
269- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
269+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
270270 EXPECT_TRUE (ucell->atoms [0 ].ncpp .has_so );
271271 EXPECT_TRUE (ucell->atoms [1 ].ncpp .has_so );
272- elecstate ::cal_natomwfc (ofs,ucell->natomwfc ,ucell->ntype ,ucell->atoms ,nspin);
272+ unitcell ::cal_natomwfc (ofs,ucell->natomwfc ,ucell->ntype ,ucell->atoms ,nspin);
273273 EXPECT_EQ (ucell->atoms [0 ].ncpp .nchi , 3 );
274274 EXPECT_EQ (ucell->atoms [1 ].ncpp .nchi , 1 );
275275 EXPECT_EQ (ucell->atoms [0 ].na , 1 );
@@ -291,10 +291,10 @@ TEST_F(UcellTest, CalNwfc1) {
291291 const std::string esolver_type = " ksdft" ;
292292 const std::string init_wfc = " " ;
293293 const int nbands = 6 ;
294- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
294+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
295295 EXPECT_FALSE (ucell->atoms [0 ].ncpp .has_so );
296296 EXPECT_FALSE (ucell->atoms [1 ].ncpp .has_so );
297- elecstate ::cal_nwfc (ofs,*ucell,ucell->atoms , nspin, nlocal, npol, basis_type, esolver_type, init_wfc, nbands);
297+ unitcell ::cal_nwfc (ofs,*ucell,ucell->atoms , nspin, nlocal, npol, basis_type, esolver_type, init_wfc, nbands);
298298 EXPECT_EQ (ucell->atoms [0 ].iw2l [8 ], 2 );
299299 EXPECT_EQ (ucell->atoms [0 ].iw2n [8 ], 0 );
300300 EXPECT_EQ (ucell->atoms [0 ].iw2m [8 ], 4 );
@@ -366,10 +366,10 @@ TEST_F(UcellTest, CalNwfc2) {
366366 const int nbands = 6 ;
367367 const std::string global_out_dir = " ./" ;
368368 const std::string dft_functional = " default" ;
369- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
369+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
370370 EXPECT_FALSE (ucell->atoms [0 ].ncpp .has_so );
371371 EXPECT_FALSE (ucell->atoms [1 ].ncpp .has_so );
372- EXPECT_NO_THROW (elecstate ::cal_nwfc (ofs,*ucell,ucell->atoms , nspin, nlocal, npol, basis_type, esolver_type, init_wfc, nbands));
372+ EXPECT_NO_THROW (unitcell ::cal_nwfc (ofs,*ucell,ucell->atoms , nspin, nlocal, npol, basis_type, esolver_type, init_wfc, nbands));
373373}
374374
375375TEST_F (UcellDeathTest, CheckStructure) {
@@ -378,7 +378,7 @@ TEST_F(UcellDeathTest, CheckStructure) {
378378 const double soc_lambda = 0.0 ;
379379 const std::string global_out_dir = " ./" ;
380380 const std::string dft_functional = " default" ;
381- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
381+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
382382 EXPECT_FALSE (ucell->atoms [0 ].ncpp .has_so );
383383 EXPECT_FALSE (ucell->atoms [1 ].ncpp .has_so );
384384 // trial 1
@@ -446,7 +446,7 @@ TEST_F(UcellDeathTest, ReadPseudoWarning1) {
446446 testing::internal::CaptureStdout ();
447447 const double nelec = 0.0 ;
448448 const double nupdown = 0.0 ;
449- EXPECT_EXIT (elecstate ::read_pseudo (ofs, *ucell, pseudo_dir, global_out_dir, out_element_info, dft_functional, lspinorb, pseudo_rcut, soc_lambda, nspin, npol, basis_type, esolver_type, init_wfc, nbands, two_fermi, nelec_delta, smearing_method, ks_solver, bndpar, nelec, nupdown), ::testing::ExitedWithCode (1 ), " " );
449+ EXPECT_EXIT (unitcell ::read_pseudo (ofs, *ucell, pseudo_dir, global_out_dir, out_element_info, dft_functional, lspinorb, pseudo_rcut, soc_lambda, nspin, npol, basis_type, esolver_type, init_wfc, nbands, two_fermi, nelec_delta, smearing_method, ks_solver, bndpar, nelec, nupdown), ::testing::ExitedWithCode (1 ), " " );
450450 output = testing::internal::GetCapturedStdout ();
451451 EXPECT_THAT (output,
452452 testing::HasSubstr (" All DFT functional must consistent." ));
@@ -478,7 +478,7 @@ TEST_F(UcellDeathTest, ReadPseudoWarning2) {
478478 ucell->pseudo_fn[0] = "Al_ONCV_PBE-1.0.upf";
479479 testing::internal::CaptureStdout();
480480 const double nelec = 0.0;
481- EXPECT_NO_THROW(elecstate ::read_pseudo(ofs, *ucell, pseudo_dir, global_out_dir, out_element_info, dft_functional, lspinorb, pseudo_rcut, soc_lambda, nspin, npol, basis_type, esolver_type, init_wfc, nbands, two_fermi, nelec_delta, smearing_method, ks_solver, bndpar, nelec));
481+ EXPECT_NO_THROW(unitcell ::read_pseudo(ofs, *ucell, pseudo_dir, global_out_dir, out_element_info, dft_functional, lspinorb, pseudo_rcut, soc_lambda, nspin, npol, basis_type, esolver_type, init_wfc, nbands, two_fermi, nelec_delta, smearing_method, ks_solver, bndpar, nelec));
482482 output = testing::internal::GetCapturedStdout();
483483 EXPECT_THAT(
484484 output,
@@ -493,7 +493,7 @@ TEST_F(UcellTest, CalNelec) {
493493 const double soc_lambda = 0.0 ;
494494 const std::string global_out_dir = " ./" ;
495495 const std::string dft_functional = " default" ;
496- elecstate ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
496+ unitcell ::read_cell_pseudopots (pp_dir, ofs, *ucell, global_out_dir, dft_functional, lspinorb, pseudo_rcut, soc_lambda);
497497 EXPECT_EQ (4 , ucell->atoms [0 ].ncpp .zv );
498498 EXPECT_EQ (1 , ucell->atoms [1 ].ncpp .zv );
499499 EXPECT_EQ (1 , ucell->atoms [0 ].na );
0 commit comments