@@ -90,7 +90,7 @@ Magnetism::~Magnetism() { delete[] this->start_magnetization; }
9090 * possible of an element
9191 * - CalNelec: UnitCell::cal_nelec
9292 * - calculate the total number of valence electrons from psp files
93- * - CalNbands: elecstate::ElecState:: cal_nbands()
93+ * - CalNbands: elecstate::cal_nbands()
9494 * - calculate the number of bands
9595 */
9696
@@ -406,22 +406,22 @@ TEST_F(UcellTest, CalNelec) {
406406 EXPECT_EQ (1 , ucell->atoms [0 ].na );
407407 EXPECT_EQ (2 , ucell->atoms [1 ].na );
408408 double nelec = 0 ;
409- cal_nelec (ucell->atoms , ucell->ntype , nelec);
409+ elecstate:: cal_nelec (ucell->atoms , ucell->ntype , nelec);
410410 EXPECT_DOUBLE_EQ (6 , nelec);
411411}
412412
413413TEST_F (UcellTest, CalNbands)
414414{
415415 std::vector<double > nelec_spin (2 , 5.0 );
416- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
416+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
417417 EXPECT_EQ (PARAM.input .nbands , 6 );
418418}
419419
420420TEST_F (UcellTest, CalNbandsFractionElec)
421421{
422422 PARAM.input .nelec = 9.5 ;
423423 std::vector<double > nelec_spin (2 , 5.0 );
424- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
424+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
425425 EXPECT_EQ (PARAM.input .nbands , 6 );
426426}
427427
@@ -430,22 +430,22 @@ TEST_F(UcellTest, CalNbandsSOC)
430430 PARAM.input .lspinorb = true ;
431431 PARAM.input .nbands = 0 ;
432432 std::vector<double > nelec_spin (2 , 5.0 );
433- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
433+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
434434 EXPECT_EQ (PARAM.input .nbands , 20 );
435435}
436436
437437TEST_F (UcellTest, CalNbandsSDFT)
438438{
439439 PARAM.input .esolver_type = " sdft" ;
440440 std::vector<double > nelec_spin (2 , 5.0 );
441- EXPECT_NO_THROW (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ));
441+ EXPECT_NO_THROW (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ));
442442}
443443
444444TEST_F (UcellTest, CalNbandsLCAO)
445445{
446446 PARAM.input .basis_type = " lcao" ;
447447 std::vector<double > nelec_spin (2 , 5.0 );
448- EXPECT_NO_THROW (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ));
448+ EXPECT_NO_THROW (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ));
449449}
450450
451451TEST_F (UcellTest, CalNbandsLCAOINPW)
@@ -454,7 +454,7 @@ TEST_F(UcellTest, CalNbandsLCAOINPW)
454454 PARAM.sys .nlocal = PARAM.input .nbands - 1 ;
455455 std::vector<double > nelec_spin (2 , 5.0 );
456456 testing::internal::CaptureStdout ();
457- EXPECT_EXIT (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
457+ EXPECT_EXIT (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
458458 output = testing::internal::GetCapturedStdout ();
459459 EXPECT_THAT (output, testing::HasSubstr (" NLOCAL < NBANDS" ));
460460}
@@ -464,7 +464,7 @@ TEST_F(UcellTest, CalNbandsWarning1)
464464 PARAM.input .nbands = PARAM.input .nelec / 2 - 1 ;
465465 std::vector<double > nelec_spin (2 , 5.0 );
466466 testing::internal::CaptureStdout ();
467- EXPECT_EXIT (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
467+ EXPECT_EXIT (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
468468 output = testing::internal::GetCapturedStdout ();
469469 EXPECT_THAT (output, testing::HasSubstr (" Too few bands!" ));
470470}
@@ -477,7 +477,7 @@ TEST_F(UcellTest, CalNbandsWarning2)
477477 nelec_spin[0 ] = (PARAM.input .nelec + PARAM.input .nupdown ) / 2.0 ;
478478 nelec_spin[1 ] = (PARAM.input .nelec - PARAM.input .nupdown ) / 2.0 ;
479479 testing::internal::CaptureStdout ();
480- EXPECT_EXIT (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
480+ EXPECT_EXIT (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
481481 output = testing::internal::GetCapturedStdout ();
482482 EXPECT_THAT (output, testing::HasSubstr (" Too few spin up bands!" ));
483483}
@@ -490,7 +490,7 @@ TEST_F(UcellTest, CalNbandsWarning3)
490490 nelec_spin[0 ] = (PARAM.input .nelec + PARAM.input .nupdown ) / 2.0 ;
491491 nelec_spin[1 ] = (PARAM.input .nelec - PARAM.input .nupdown ) / 2.0 ;
492492 testing::internal::CaptureStdout ();
493- EXPECT_EXIT (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
493+ EXPECT_EXIT (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
494494 output = testing::internal::GetCapturedStdout ();
495495 EXPECT_THAT (output, testing::HasSubstr (" Too few spin down bands!" ));
496496}
@@ -500,7 +500,7 @@ TEST_F(UcellTest, CalNbandsSpin1)
500500 PARAM.input .nspin = 1 ;
501501 PARAM.input .nbands = 0 ;
502502 std::vector<double > nelec_spin (2 , 5.0 );
503- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
503+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
504504 EXPECT_EQ (PARAM.input .nbands , 15 );
505505}
506506
@@ -510,7 +510,7 @@ TEST_F(UcellTest, CalNbandsSpin1LCAO)
510510 PARAM.input .nbands = 0 ;
511511 PARAM.input .basis_type = " lcao" ;
512512 std::vector<double > nelec_spin (2 , 5.0 );
513- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
513+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
514514 EXPECT_EQ (PARAM.input .nbands , 6 );
515515}
516516
@@ -519,7 +519,7 @@ TEST_F(UcellTest, CalNbandsSpin4)
519519 PARAM.input .nspin = 4 ;
520520 PARAM.input .nbands = 0 ;
521521 std::vector<double > nelec_spin (2 , 5.0 );
522- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
522+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
523523 EXPECT_EQ (PARAM.input .nbands , 30 );
524524}
525525
@@ -529,7 +529,7 @@ TEST_F(UcellTest, CalNbandsSpin4LCAO)
529529 PARAM.input .nbands = 0 ;
530530 PARAM.input .basis_type = " lcao" ;
531531 std::vector<double > nelec_spin (2 , 5.0 );
532- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
532+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
533533 EXPECT_EQ (PARAM.input .nbands , 6 );
534534}
535535
@@ -538,7 +538,7 @@ TEST_F(UcellTest, CalNbandsSpin2)
538538 PARAM.input .nspin = 2 ;
539539 PARAM.input .nbands = 0 ;
540540 std::vector<double > nelec_spin (2 , 5.0 );
541- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
541+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
542542 EXPECT_EQ (PARAM.input .nbands , 16 );
543543}
544544
@@ -548,7 +548,7 @@ TEST_F(UcellTest, CalNbandsSpin2LCAO)
548548 PARAM.input .nbands = 0 ;
549549 PARAM.input .basis_type = " lcao" ;
550550 std::vector<double > nelec_spin (2 , 5.0 );
551- cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
551+ elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands );
552552 EXPECT_EQ (PARAM.input .nbands , 6 );
553553}
554554
@@ -558,7 +558,7 @@ TEST_F(UcellTest, CalNbandsGaussWarning)
558558 std::vector<double > nelec_spin (2 , 5.0 );
559559 PARAM.input .smearing_method = " gaussian" ;
560560 testing::internal::CaptureStdout ();
561- EXPECT_EXIT (cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
561+ EXPECT_EXIT (elecstate:: cal_nbands (PARAM.input .nelec , PARAM.sys .nlocal , nelec_spin, PARAM.input .nbands ), ::testing::ExitedWithCode (1 ), " " );
562562 output = testing::internal::GetCapturedStdout ();
563563 EXPECT_THAT (output, testing::HasSubstr (" for smearing, num. of bands > num. of occupied bands" ));
564564}
0 commit comments