diff --git a/source/module_elecstate/elecstate.h b/source/module_elecstate/elecstate.h index 1a1e2f3013..f4954a8d58 100644 --- a/source/module_elecstate/elecstate.h +++ b/source/module_elecstate/elecstate.h @@ -166,23 +166,6 @@ class ElecState ModuleBase::matrix ekb; ///< band energy at each k point, each band. ModuleBase::matrix wg; ///< occupation weight for each k-point and band - public: // print something. See elecstate_print.cpp - void print_etot(const Magnetism& magnet, - const bool converged, - const int& iter, - const double& scf_thr, - const double& scf_thr_kin, - const double& duration, - const int printe, - const double& pw_diag_thr = 0, - const double& avg_iter = 0, - bool print = true); - void print_format(const std::string& name, const double& value); - - void print_band(const int& ik, const int& printe, const int& iter); - - void print_eigenvalue(std::ofstream& ofs); - public: // calculate ebands for all k points and all occupied bands void calEBand(); diff --git a/source/module_elecstate/elecstate_print.cpp b/source/module_elecstate/elecstate_print.cpp index 508e79ada7..57b625db8a 100644 --- a/source/module_elecstate/elecstate_print.cpp +++ b/source/module_elecstate/elecstate_print.cpp @@ -149,19 +149,21 @@ void print_scf_iterinfo(const std::string& ks_solver, } /// @brief print and check for band energy and occupations /// @param ofs -void ElecState::print_eigenvalue(std::ofstream& ofs) +void print_eigenvalue(const ModuleBase::matrix& ekb, + const ModuleBase::matrix& wg, + const K_Vectors* klist, + std::ofstream& ofs) { - bool wrong = false; - const int nks = this->klist->get_nks(); - const int nkstot = this->klist->get_nkstot(); + bool wrong = false; + const int nks = klist->get_nks(); + const int nkstot = klist->get_nkstot(); for (int ik = 0; ik < nks; ++ik) { - for (int ib = 0; ib < this->ekb.nc; ++ib) + for (int ib = 0; ib < ekb.nc; ++ib) { - if (std::abs(this->ekb(ik, ib)) > 1.0e10) + if (std::abs(ekb(ik, ib)) > 1.0e10) { - GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 << " " << this->ekb(ik, ib) << " Ry" - << std::endl; + GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 << " " << ekb(ik, ib) << " Ry" << std::endl; wrong = true; } } @@ -175,7 +177,7 @@ void ElecState::print_eigenvalue(std::ofstream& ofs) } std::string filename = PARAM.globalv.global_out_dir + PARAM.globalv.log_file; - std::vector ngk_tot = this->klist->ngk; + std::vector ngk_tot = klist->ngk; #ifdef __MPI MPI_Allreduce(MPI_IN_PLACE, ngk_tot.data(), nks, MPI_INT, MPI_SUM, POOL_WORLD); @@ -214,16 +216,16 @@ void ElecState::print_eigenvalue(std::ofstream& ofs) std::ofstream ofs_eig(filename.c_str(), std::ios::app); ofs_eig << std::setprecision(5); ofs_eig << std::setiosflags(std::ios::showpoint); - ofs_eig << " " << this->klist->ik2iktot[ik] + 1 - is * nkstot_np << "/" << nkstot_np - << " kpoint (Cartesian) = " << this->klist->kvec_c[ik].x << " " << this->klist->kvec_c[ik].y - << " " << this->klist->kvec_c[ik].z << " (" << ngk_tot[ik] << " pws)" << std::endl; + ofs_eig << " " << klist->ik2iktot[ik] + 1 - is * nkstot_np << "/" << nkstot_np + << " kpoint (Cartesian) = " << klist->kvec_c[ik].x << " " << klist->kvec_c[ik].y + << " " << klist->kvec_c[ik].z << " (" << ngk_tot[ik] << " pws)" << std::endl; ofs_eig << std::setprecision(6); ofs_eig << std::setiosflags(std::ios::showpoint); - for (int ib = 0; ib < this->ekb.nc; ib++) + for (int ib = 0; ib < ekb.nc; ib++) { - ofs_eig << std::setw(8) << ib + 1 << std::setw(15) << this->ekb(ik, ib) * ModuleBase::Ry_to_eV - << std::setw(15) << this->wg(ik, ib) << std::endl; + ofs_eig << std::setw(8) << ib + 1 << std::setw(15) << ekb(ik, ib) * ModuleBase::Ry_to_eV + << std::setw(15) << wg(ik, ib) << std::endl; } ofs_eig << std::endl; ofs_eig.close(); @@ -242,16 +244,20 @@ void ElecState::print_eigenvalue(std::ofstream& ofs) /// @param ik: index of kpoints /// @param printe: print energy every 'printe' electron iteration. /// @param iter: index of iterations -void ElecState::print_band(const int& ik, const int& printe, const int& iter) +void print_band(const ModuleBase::matrix& ekb, + const ModuleBase::matrix& wg, + const K_Vectors* klist, + const int& ik, + const int& printe, + const int& iter) { // check the band energy. bool wrong = false; for (int ib = 0; ib < PARAM.globalv.nbands_l; ++ib) { - if (std::abs(this->ekb(ik, ib)) > 1.0e10) + if (std::abs(ekb(ik, ib)) > 1.0e10) { - GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 << " " << this->ekb(ik, ib) << " Ry" - << std::endl; + GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 << " " << ekb(ik, ib) << " Ry" << std::endl; wrong = true; } } @@ -265,16 +271,16 @@ void ElecState::print_band(const int& ik, const int& printe, const int& iter) if (printe > 0 && ((iter + 1) % printe == 0)) { GlobalV::ofs_running << std::setprecision(6); - GlobalV::ofs_running << " Energy (eV) & Occupations for spin=" << this->klist->isk[ik] + 1 + GlobalV::ofs_running << " Energy (eV) & Occupations for spin=" << klist->isk[ik] + 1 << " K-point=" << ik + 1 << std::endl; GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); for (int ib = 0; ib < PARAM.globalv.nbands_l; ib++) { GlobalV::ofs_running << " " << std::setw(6) << ib + 1 << std::setw(15) - << this->ekb(ik, ib) * ModuleBase::Ry_to_eV; + << ekb(ik, ib) * ModuleBase::Ry_to_eV; // for the first electron iteration, we don't have the energy // spectrum, so we can't get the occupations. - GlobalV::ofs_running << std::setw(15) << this->wg(ik, ib); + GlobalV::ofs_running << std::setw(15) << wg(ik, ib); GlobalV::ofs_running << std::endl; } } @@ -291,25 +297,25 @@ void ElecState::print_band(const int& ik, const int& printe, const int& iter) /// @param pw_diag_thr: threshold for diagonalization /// @param avg_iter: averaged diagonalization iteration of each scf iteration /// @param print: if print to screen -void ElecState::print_etot(const Magnetism& magnet, - const bool converged, - const int& iter_in, - const double& scf_thr, - const double& scf_thr_kin, - const double& duration, - const int printe, - const double& pw_diag_thr, - const double& avg_iter, - const bool print) +void print_etot(const Magnetism& magnet, + const ElecState& elec, + const bool converged, + const int& iter_in, + const double& scf_thr, + const double& scf_thr_kin, + const double& duration, + const int printe, + const double& pw_diag_thr, + const double& avg_iter, + const bool print) { ModuleBase::TITLE("energy", "print_etot"); const int iter = iter_in; - const int nrxx = this->charge->nrxx; - const int nxyz = this->charge->nxyz; + const int nrxx = elec.charge->nrxx; + const int nxyz = elec.charge->nxyz; GlobalV::ofs_running << std::setprecision(12); GlobalV::ofs_running << std::setiosflags(std::ios::right); - GlobalV::ofs_running << "\n Density error is " << scf_thr << std::endl; if (PARAM.inp.basis_type == "pw") @@ -324,46 +330,46 @@ void ElecState::print_etot(const Magnetism& magnet, { int n_order = std::max(0, Occupy::gaussian_type); titles.push_back("E_KohnSham"); - energies_Ry.push_back(this->f_en.etot); + energies_Ry.push_back(elec.f_en.etot); titles.push_back("E_KS(sigma->0)"); - energies_Ry.push_back(this->f_en.etot - this->f_en.demet / (2 + n_order)); + energies_Ry.push_back(elec.f_en.etot - elec.f_en.demet / (2 + n_order)); titles.push_back("E_Harris"); - energies_Ry.push_back(this->f_en.etot_harris); + energies_Ry.push_back(elec.f_en.etot_harris); titles.push_back("E_band"); - energies_Ry.push_back(this->f_en.eband); + energies_Ry.push_back(elec.f_en.eband); titles.push_back("E_one_elec"); - energies_Ry.push_back(this->f_en.eband + this->f_en.deband); + energies_Ry.push_back(elec.f_en.eband + elec.f_en.deband); titles.push_back("E_Hartree"); - energies_Ry.push_back(this->f_en.hartree_energy); + energies_Ry.push_back(elec.f_en.hartree_energy); titles.push_back("E_xc"); - energies_Ry.push_back(this->f_en.etxc - this->f_en.etxcc); + energies_Ry.push_back(elec.f_en.etxc - elec.f_en.etxcc); titles.push_back("E_Ewald"); - energies_Ry.push_back(this->f_en.ewald_energy); + energies_Ry.push_back(elec.f_en.ewald_energy); titles.push_back("E_entropy(-TS)"); - energies_Ry.push_back(this->f_en.demet); + energies_Ry.push_back(elec.f_en.demet); titles.push_back("E_descf"); - energies_Ry.push_back(this->f_en.descf); + energies_Ry.push_back(elec.f_en.descf); titles.push_back("E_LocalPP"); - energies_Ry.push_back(this->f_en.e_local_pp); + energies_Ry.push_back(elec.f_en.e_local_pp); std::string vdw_method = PARAM.inp.vdw_method; if (vdw_method == "d2") // Peize Lin add 2014-04, update 2021-03-09 { titles.push_back("E_vdwD2"); - energies_Ry.push_back(this->f_en.evdw); + energies_Ry.push_back(elec.f_en.evdw); } else if (vdw_method == "d3_0" || vdw_method == "d3_bj") // jiyy add 2019-05, update 2021-05-02 { titles.push_back("E_vdwD3"); - energies_Ry.push_back(this->f_en.evdw); + energies_Ry.push_back(elec.f_en.evdw); } titles.push_back("E_exx"); - energies_Ry.push_back(this->f_en.exx); + energies_Ry.push_back(elec.f_en.exx); if (PARAM.inp.imp_sol) { titles.push_back("E_sol_el"); - energies_Ry.push_back(this->f_en.esol_el); + energies_Ry.push_back(elec.f_en.esol_el); titles.push_back("E_sol_cav"); - energies_Ry.push_back(this->f_en.esol_cav); + energies_Ry.push_back(elec.f_en.esol_cav); } if (PARAM.inp.efield_flag) { @@ -380,43 +386,43 @@ void ElecState::print_etot(const Magnetism& magnet, if (PARAM.inp.deepks_scf) // caoyu add 2021-08-10 { titles.push_back("E_DeePKS"); - energies_Ry.push_back(this->f_en.edeepks_delta); + energies_Ry.push_back(elec.f_en.edeepks_delta); } #endif } else { titles.push_back("E_KohnSham"); - energies_Ry.push_back(this->f_en.etot); + energies_Ry.push_back(elec.f_en.etot); titles.push_back("E_Harris"); - energies_Ry.push_back(this->f_en.etot_harris); + energies_Ry.push_back(elec.f_en.etot_harris); } if (PARAM.globalv.two_fermi) { titles.push_back("E_Fermi_up"); - energies_Ry.push_back(this->eferm.ef_up); + energies_Ry.push_back(elec.eferm.ef_up); titles.push_back("E_Fermi_dw"); - energies_Ry.push_back(this->eferm.ef_dw); + energies_Ry.push_back(elec.eferm.ef_dw); } else { titles.push_back("E_Fermi"); - energies_Ry.push_back(this->eferm.ef); + energies_Ry.push_back(elec.eferm.ef); } if (PARAM.inp.out_bandgap) { if (!PARAM.globalv.two_fermi) { titles.push_back("E_bandgap"); - energies_Ry.push_back(this->bandgap); + energies_Ry.push_back(elec.bandgap); } else { titles.push_back("E_bandgap_up"); - energies_Ry.push_back(this->bandgap_up); + energies_Ry.push_back(elec.bandgap_up); titles.push_back("E_bandgap_dw"); - energies_Ry.push_back(this->bandgap_dw); + energies_Ry.push_back(elec.bandgap_dw); } } energies_eV.resize(energies_Ry.size()); @@ -457,8 +463,8 @@ void ElecState::print_etot(const Magnetism& magnet, 6, mag, 10, - this->f_en.etot * ModuleBase::Ry_to_eV, - this->f_en.etot_delta * ModuleBase::Ry_to_eV, + elec.f_en.etot * ModuleBase::Ry_to_eV, + elec.f_en.etot_delta * ModuleBase::Ry_to_eV, 16, drho, 12, @@ -471,12 +477,10 @@ void ElecState::print_etot(const Magnetism& magnet, /// @brief function to print name, value and value*Ry_to_eV /// @param name: name /// @param value: value -void ElecState::print_format(const std::string& name, const double& value) +void print_format(const std::string& name, const double& value) { GlobalV::ofs_running << std::setiosflags(std::ios::showpos); - std::stringstream name2; - name2 << name; - GlobalV::ofs_running << " " << std::setw(16) << name2.str() << std::setw(30) << value << std::setw(30) + GlobalV::ofs_running << " " << std::setw(16) << name << std::setw(30) << value << std::setw(30) << value * ModuleBase::Ry_to_eV << std::endl; GlobalV::ofs_running << std::resetiosflags(std::ios::showpos); return; diff --git a/source/module_elecstate/elecstate_print.h b/source/module_elecstate/elecstate_print.h new file mode 100644 index 0000000000..a20c2278cc --- /dev/null +++ b/source/module_elecstate/elecstate_print.h @@ -0,0 +1,33 @@ +#ifndef ELECSATE_PRINT_H +#define ELECSATE_PRINT_H +#include "module_elecstate/elecstate.h" +namespace elecstate +{ + void print_band(const ModuleBase::matrix& ekb, + const ModuleBase::matrix& wg, + const K_Vectors* klist, + const int& ik, + const int& printe, + const int& iter); + + void print_format(const std::string& name, + const double& value); + + void print_eigenvalue(const ModuleBase::matrix& ekb, + const ModuleBase::matrix& wg, + const K_Vectors* klist, + std::ofstream& ofs); + + void print_etot(const Magnetism& magnet, + const ElecState& elec, + const bool converged, + const int& iter_in, + const double& scf_thr, + const double& scf_thr_kin, + const double& duration, + const int printe, + const double& pw_diag_thr = 0, + const double& avg_iter = 0, + bool print = true); +} +#endif \ No newline at end of file diff --git a/source/module_elecstate/test/elecstate_print_test.cpp b/source/module_elecstate/test/elecstate_print_test.cpp index 1ab1337540..226e84c176 100644 --- a/source/module_elecstate/test/elecstate_print_test.cpp +++ b/source/module_elecstate/test/elecstate_print_test.cpp @@ -10,7 +10,8 @@ #include "module_elecstate/potentials/gatefield.h" #include "module_hamilt_general/module_xc/xc_functional.h" #include "module_parameter/parameter.h" - +#include "module_elecstate/elecstate_print.h" +#undef private /*************************************************************** * mock functions ****************************************************************/ @@ -107,7 +108,7 @@ class ElecStatePrintTest : public ::testing::Test TEST_F(ElecStatePrintTest, PrintFormat) { GlobalV::ofs_running.open("test.dat", std::ios::out); - elecstate.print_format("test", 0.1); + elecstate::print_format("test", 0.1); GlobalV::ofs_running.close(); ifs.open("test.dat", std::ios::in); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); @@ -121,7 +122,7 @@ TEST_F(ElecStatePrintTest, PrintEigenvalueS2) PARAM.input.nspin = 2; GlobalV::ofs_running.open("test.dat", std::ios::out); // print eigenvalue - elecstate.print_eigenvalue(GlobalV::ofs_running); + elecstate::print_eigenvalue(elecstate.ekb,elecstate.wg,elecstate.klist,GlobalV::ofs_running); GlobalV::ofs_running.close(); ifs.open("test.dat", std::ios::in); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); @@ -144,7 +145,7 @@ TEST_F(ElecStatePrintTest, PrintEigenvalueS4) PARAM.input.nspin = 4; GlobalV::ofs_running.open("test.dat", std::ios::out); // print eigenvalue - elecstate.print_eigenvalue(GlobalV::ofs_running); + elecstate::print_eigenvalue(elecstate.ekb,elecstate.wg,elecstate.klist,GlobalV::ofs_running); GlobalV::ofs_running.close(); ifs.open("test.dat", std::ios::in); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); @@ -168,7 +169,7 @@ TEST_F(ElecStatePrintTest, PrintBand) GlobalV::MY_RANK = 0; GlobalV::ofs_running.open("test.dat", std::ios::out); // print eigenvalue - elecstate.print_band(0, 1, 0); + elecstate::print_band(elecstate.ekb,elecstate.wg,elecstate.klist, 0, 1, 0); GlobalV::ofs_running.close(); ifs.open("test.dat", std::ios::in); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); @@ -185,7 +186,7 @@ TEST_F(ElecStatePrintTest, PrintEigenvalueWarning) PARAM.input.nspin = 4; GlobalV::ofs_running.open("test.dat", std::ios::out); testing::internal::CaptureStdout(); - EXPECT_EXIT(elecstate.print_eigenvalue(GlobalV::ofs_running), ::testing::ExitedWithCode(1), ""); + EXPECT_EXIT(elecstate::print_eigenvalue(elecstate.ekb,elecstate.wg,elecstate.klist,GlobalV::ofs_running), ::testing::ExitedWithCode(1), ""); output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output, testing::HasSubstr("Eigenvalues are too large!")); GlobalV::ofs_running.close(); @@ -198,7 +199,7 @@ TEST_F(ElecStatePrintTest, PrintBandWarning) PARAM.input.nspin = 4; GlobalV::ofs_running.open("test.dat", std::ios::out); testing::internal::CaptureStdout(); - EXPECT_EXIT(elecstate.print_band(0, 1, 0), ::testing::ExitedWithCode(1), ""); + EXPECT_EXIT(elecstate::print_band(elecstate.ekb,elecstate.wg,elecstate.klist, 0, 1, 0), ::testing::ExitedWithCode(1), ""); output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output, testing::HasSubstr("Eigenvalues are too large!")); GlobalV::ofs_running.close(); @@ -233,7 +234,7 @@ TEST_F(ElecStatePrintTest, PrintEtot) for (int i = 0; i < vdw_methods.size(); i++) { PARAM.input.vdw_method = vdw_methods[i]; - elecstate.print_etot(ucell.magnet,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, false); + elecstate::print_etot(ucell.magnet,elecstate, converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, false); } // iteration of different ks_solver std::vector ks_solvers = {"cg", "lapack", "genelpa", "dav", "scalapack_gvx", "cusolver"}; @@ -241,7 +242,7 @@ TEST_F(ElecStatePrintTest, PrintEtot) { PARAM.input.ks_solver = ks_solvers[i]; testing::internal::CaptureStdout(); - elecstate.print_etot(ucell.magnet,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); + elecstate::print_etot(ucell.magnet,elecstate,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); output = testing::internal::GetCapturedStdout(); if (PARAM.input.ks_solver == "cg") { @@ -309,7 +310,7 @@ TEST_F(ElecStatePrintTest, PrintEtot2) PARAM.input.basis_type = "pw"; PARAM.input.scf_nmax = 100; - elecstate.print_etot(ucell.magnet,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); + elecstate::print_etot(ucell.magnet,elecstate,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); GlobalV::ofs_running.close(); ifs.open("test.dat", std::ios::in); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); @@ -345,7 +346,7 @@ TEST_F(ElecStatePrintTest, PrintEtotColorS2) PARAM.input.out_bandgap = true; PARAM.input.nspin = 2; GlobalV::MY_RANK = 0; - elecstate.print_etot(ucell.magnet,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); + elecstate::print_etot(ucell.magnet,elecstate,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); delete elecstate.charge; } @@ -371,6 +372,6 @@ TEST_F(ElecStatePrintTest, PrintEtotColorS4) PARAM.input.nspin = 4; PARAM.input.noncolin = true; GlobalV::MY_RANK = 0; - elecstate.print_etot(ucell.magnet,converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); + elecstate::print_etot(ucell.magnet,elecstate, converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, print); delete elecstate.charge; } \ No newline at end of file diff --git a/source/module_esolver/esolver_ks.cpp b/source/module_esolver/esolver_ks.cpp index 50c5a1facf..55511a1977 100644 --- a/source/module_esolver/esolver_ks.cpp +++ b/source/module_esolver/esolver_ks.cpp @@ -9,6 +9,7 @@ #include "module_io/print_info.h" #include "module_io/write_istate_info.h" #include "module_parameter/parameter.h" +#include "module_elecstate/elecstate_print.h" #include #include @@ -540,7 +541,12 @@ void ESolver_KS::iter_finish(UnitCell& ucell, const int istep, int& i for (int ik = 0; ik < this->kv.get_nks(); ++ik) { - this->pelec->print_band(ik, PARAM.inp.printe, iter); + elecstate::print_band(this->pelec->ekb, + this->pelec->wg, + this->pelec->klist, + ik, + PARAM.inp.printe, + iter); } // compute magnetization, only for LSDA(spin==2) @@ -673,7 +679,8 @@ void ESolver_KS::iter_finish(UnitCell& ucell, const int istep, int& i dkin = p_chgmix->get_dkin(pelec->charge, PARAM.inp.nelec); } - this->pelec->print_etot(ucell.magnet,conv_esolver, iter, drho, dkin, duration, PARAM.inp.printe, diag_ethr); + + elecstate::print_etot(ucell.magnet, *pelec,conv_esolver, iter, drho, dkin, duration, PARAM.inp.printe, diag_ethr); // Json, need to be moved to somewhere else #ifdef __RAPIDJSON @@ -708,7 +715,7 @@ void ESolver_KS::after_scf(UnitCell& ucell, const int istep, const bo // 2) write eigenvalues if (istep % PARAM.inp.out_interval == 0) { - this->pelec->print_eigenvalue(GlobalV::ofs_running); + elecstate::print_eigenvalue(this->pelec->ekb,this->pelec->wg,this->pelec->klist,GlobalV::ofs_running); } } diff --git a/source/module_hsolver/test/hsolver_supplementary_mock.h b/source/module_hsolver/test/hsolver_supplementary_mock.h index 808aa8ed5c..c7ead79fff 100644 --- a/source/module_hsolver/test/hsolver_supplementary_mock.h +++ b/source/module_hsolver/test/hsolver_supplementary_mock.h @@ -31,16 +31,6 @@ void ElecState::calEBand() return; } -void ElecState::print_band(const int& ik, const int& printe, const int& iter) -{ - return; -} - -void ElecState::print_eigenvalue(std::ofstream& ofs) -{ - return; -} - void ElecState::init_scf(const int istep, const UnitCell& ucell, const Parallel_Grid& pgrid,