diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index b9ee122af6..fb721a7486 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -1494,8 +1494,8 @@ These variables are used to control the output of properties. ### out_band -- **Type**: Boolean -- **Description**: Whether to output the band structure (in eV). For more information, refer to the [band.md](../elec_properties/band.md) +- **Type**: Boolean Integer(optional) +- **Description**: Whether to output the band structure (in eV), optionally output precision can be set by a second parameter, default is 8. For more information, refer to the [band.md](../elec_properties/band.md) - **Default**: False ### out_proj_band diff --git a/source/module_cell/klist.cpp b/source/module_cell/klist.cpp index 52bc42440d..e11ab183f5 100644 --- a/source/module_cell/klist.cpp +++ b/source/module_cell/klist.cpp @@ -362,6 +362,10 @@ bool K_Vectors::read_kpoints(const std::string &fn) //recalculate nkstot. nkstot = 0; + /* ISSUE#3482: to distinguish different kline segments */ + std::vector kpt_segids; + kl_segids.clear(); kl_segids.shrink_to_fit(); + int kpt_segid = 0; for(int iks=0; iks> ksx[iks]; @@ -371,6 +375,9 @@ bool K_Vectors::read_kpoints(const std::string &fn) //std::cout << " nkl[" << iks << "]=" << nkl[iks] << std::endl; assert(nkl[iks] >= 0); nkstot += nkl[iks]; + /* ISSUE#3482: to distinguish different kline segments */ + if((nkl[iks] == 1)&&(iks!=(nks_special-1))) kpt_segid++; + kpt_segids.push_back(kpt_segid); } assert( nkl[nks_special-1] == 1); @@ -389,6 +396,7 @@ bool K_Vectors::read_kpoints(const std::string &fn) kvec_c[count].x = ksx[iks-1] + is*dx; kvec_c[count].y = ksy[iks-1] + is*dy; kvec_c[count].z = ksz[iks-1] + is*dz; + kl_segids.push_back(kpt_segids[iks-1]); /* ISSUE#3482: to distinguish different kline segments */ ++count; } } @@ -397,15 +405,14 @@ bool K_Vectors::read_kpoints(const std::string &fn) kvec_c[count].x = ksx[nks_special-1]; kvec_c[count].y = ksy[nks_special-1]; kvec_c[count].z = ksz[nks_special-1]; + kl_segids.push_back(kpt_segids[nks_special-1]); /* ISSUE#3482: to distinguish different kline segments */ ++count; //std::cout << " count = " << count << std::endl; - assert (count == nkstot ); - - for(int ik=0; ikkc_done = true; @@ -439,15 +446,22 @@ bool K_Vectors::read_kpoints(const std::string &fn) //recalculate nkstot. nkstot = 0; + /* ISSUE#3482: to distinguish different kline segments */ + std::vector kpt_segids; + kl_segids.clear(); kl_segids.shrink_to_fit(); + int kpt_segid = 0; for(int iks=0; iks> ksx[iks]; ifk >> ksy[iks]; ifk >> ksz[iks]; - ModuleBase::GlobalFunc::READ_VALUE( ifk, nkl[iks] ); + ModuleBase::GlobalFunc::READ_VALUE( ifk, nkl[iks] ); /* so ifk is ifstream for kpoint, then nkl is number of kpoints on line */ //std::cout << " nkl[" << iks << "]=" << nkl[iks] << std::endl; assert(nkl[iks] >= 0); nkstot += nkl[iks]; + /* ISSUE#3482: to distinguish different kline segments */ + if((nkl[iks] == 1)&&(iks!=(nks_special-1))) kpt_segid++; + kpt_segids.push_back(kpt_segid); } assert( nkl[nks_special-1] == 1); @@ -466,6 +480,7 @@ bool K_Vectors::read_kpoints(const std::string &fn) kvec_d[count].x = ksx[iks-1] + is*dx; kvec_d[count].y = ksy[iks-1] + is*dy; kvec_d[count].z = ksz[iks-1] + is*dz; + kl_segids.push_back(kpt_segids[iks-1]); /* ISSUE#3482: to distinguish different kline segments */ ++count; } } @@ -474,18 +489,16 @@ bool K_Vectors::read_kpoints(const std::string &fn) kvec_d[count].x = ksx[nks_special-1]; kvec_d[count].y = ksy[nks_special-1]; kvec_d[count].z = ksz[nks_special-1]; + kl_segids.push_back(kpt_segids[nks_special-1]); /* ISSUE#3482: to distinguish different kline segments */ ++count; //std::cout << " count = " << count << std::endl; - assert (count == nkstot ); + assert(count == nkstot ); + assert(kl_segids.size() == nkstot); /* ISSUE#3482: to distinguish different kline segments */ - for(int ik=0; ikkd_done = true; - } else @@ -1122,6 +1135,9 @@ void K_Vectors::mpi_k(void) Parallel_Common::bcast_int(nmp, 3); + kl_segids.resize(nkstot); + Parallel_Common::bcast_int(kl_segids.data(), nkstot); + Parallel_Common::bcast_double(koffset, 3); this->nks = GlobalC::Pkpoints.nks_pool[GlobalV::MY_POOL]; @@ -1352,6 +1368,8 @@ void K_Vectors::mpi_k_after_vc(void) Parallel_Common::bcast_int(nspin); Parallel_Common::bcast_int(nkstot); Parallel_Common::bcast_int(nmp, 3); + kl_segids.resize(nkstot); + Parallel_Common::bcast_int(kl_segids.data(), nkstot); Parallel_Common::bcast_double(koffset, 3); this->nks = GlobalC::Pkpoints.nks_pool[GlobalV::MY_POOL]; diff --git a/source/module_cell/klist.h b/source/module_cell/klist.h index a9e06f8614..aa92cf29fd 100644 --- a/source/module_cell/klist.h +++ b/source/module_cell/klist.h @@ -29,6 +29,7 @@ class K_Vectors int nkstot_full; /// number of k points in full k mesh int nmp[3]; // Number of Monhorst-Pack + std::vector kl_segids; // index of kline segment K_Vectors(); ~K_Vectors(); diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index 8fdc9217fd..a7d0a5abdd 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -309,7 +309,7 @@ namespace ModuleESolver GlobalV::ofs_running << " !FINAL_ETOT_IS " << this->pelec->f_en.etot * ModuleBase::Ry_to_eV << " eV" << std::endl; GlobalV::ofs_running << " --------------------------------------------\n\n" << std::endl; - if (INPUT.out_dos != 0 || INPUT.out_band != 0 || INPUT.out_proj_band != 0) + if (INPUT.out_dos != 0 || INPUT.out_band[0] != 0 || INPUT.out_proj_band != 0) { GlobalV::ofs_running << "\n\n\n\n"; GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; @@ -331,7 +331,7 @@ namespace ModuleESolver int nspin0 = (GlobalV::NSPIN == 2) ? 2 : 1; - if (INPUT.out_band) // pengfei 2014-10-13 + if (INPUT.out_band[0]) // pengfei 2014-10-13 { int nks = 0; if (nspin0 == 1) @@ -348,7 +348,15 @@ namespace ModuleESolver std::stringstream ss2; ss2 << GlobalV::global_out_dir << "BANDS_" << is + 1 << ".dat"; GlobalV::ofs_running << "\n Output bands in file: " << ss2.str() << std::endl; - ModuleIO::nscf_band(is, ss2.str(), nks, GlobalV::NBANDS, 0.0, this->pelec->ekb, this->kv, &(GlobalC::Pkpoints)); + ModuleIO::nscf_band(is, + ss2.str(), + nks, + GlobalV::NBANDS, + 0.0, + INPUT.out_band[1], + this->pelec->ekb, + this->kv, + &(GlobalC::Pkpoints)); } } // out_band diff --git a/source/module_esolver/esolver_ks_pw.cpp b/source/module_esolver/esolver_ks_pw.cpp index 294f1636f7..2e81938ae2 100644 --- a/source/module_esolver/esolver_ks_pw.cpp +++ b/source/module_esolver/esolver_ks_pw.cpp @@ -959,7 +959,7 @@ void ESolver_KS_PW::postprocess() GlobalV::ofs_running << " !FINAL_ETOT_IS " << this->pelec->f_en.etot * ModuleBase::Ry_to_eV << " eV" << std::endl; GlobalV::ofs_running << " --------------------------------------------\n\n" << std::endl; - if (INPUT.out_dos != 0 || INPUT.out_band != 0) + if (INPUT.out_dos != 0 || INPUT.out_band[0] != 0) { GlobalV::ofs_running << "\n\n\n\n"; GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; @@ -1001,7 +1001,7 @@ void ESolver_KS_PW::postprocess() } } - if (INPUT.out_band) // pengfei 2014-10-13 + if (INPUT.out_band[0]) // pengfei 2014-10-13 { int nks = 0; if (nspin0 == 1) @@ -1022,6 +1022,7 @@ void ESolver_KS_PW::postprocess() nks, GlobalV::NBANDS, 0.0, + INPUT.out_band[1], this->pelec->ekb, this->kv, &(GlobalC::Pkpoints)); diff --git a/source/module_io/input.cpp b/source/module_io/input.cpp index 2685ba540e..abe8f28ebd 100644 --- a/source/module_io/input.cpp +++ b/source/module_io/input.cpp @@ -336,7 +336,7 @@ void Input::Default(void) out_wfc_pw = 0; out_wfc_r = 0; out_dos = 0; - out_band = 0; + out_band = {0, 8}; out_proj_band = 0; out_mat_hs = {0, 8}; out_mat_xc = 0; @@ -1378,13 +1378,13 @@ bool Input::Read(const std::string& fn) } else if (strcmp("out_band", word) == 0) { - read_bool(ifs, out_band); + read_value2stdvector(ifs, out_band); + if(out_band.size() == 1) out_band.push_back(8); } else if (strcmp("out_proj_band", word) == 0) { read_bool(ifs, out_proj_band); } - else if (strcmp("out_mat_hs", word) == 0) { read_value2stdvector(ifs, out_mat_hs); @@ -2826,7 +2826,7 @@ void Input::Default_2(void) // jiyy add 2019-08-04 this->relax_nmax = 1; out_stru = 0; out_dos = 0; - out_band = 0; + out_band[0] = 0; out_proj_band = 0; cal_force = 0; init_wfc = "file"; @@ -2843,7 +2843,7 @@ void Input::Default_2(void) // jiyy add 2019-08-04 this->relax_nmax = 1; out_stru = 0; out_dos = 0; - out_band = 0; + out_band[0] = 0; out_proj_band = 0; cal_force = 0; init_wfc = "file"; @@ -3325,7 +3325,8 @@ void Input::Bcast() Parallel_Common::bcast_int(out_wfc_pw); Parallel_Common::bcast_bool(out_wfc_r); Parallel_Common::bcast_int(out_dos); - Parallel_Common::bcast_bool(out_band); + if(GlobalV::MY_RANK != 0) out_band.resize(2); /* If this line is absent, will cause segmentation fault in io_input_test_para */ + Parallel_Common::bcast_int(out_band.data(), 2); Parallel_Common::bcast_bool(out_proj_band); if(GlobalV::MY_RANK != 0) out_mat_hs.resize(2); /* If this line is absent, will cause segmentation fault in io_input_test_para */ Parallel_Common::bcast_int(out_mat_hs.data(), 2); diff --git a/source/module_io/input.h b/source/module_io/input.h index b4e983abad..6393483cb4 100644 --- a/source/module_io/input.h +++ b/source/module_io/input.h @@ -263,7 +263,7 @@ class Input int out_wfc_pw; // 0: no; 1: txt; 2: dat bool out_wfc_r; // 0: no; 1: yes int out_dos; // dos calculation. mohan add 20090909 - bool out_band; // band calculation pengfei 2014-10-13 + std::vector out_band; // band calculation pengfei 2014-10-13 bool out_proj_band; // projected band structure calculation jiyy add 2022-05-11 std::vector out_mat_hs; // output H matrix and S matrix in local basis. bool out_mat_xc; // output exchange-correlation matrix in KS-orbital representation. @@ -667,7 +667,15 @@ class Input template typename std::enable_if::value, T>::type cast_string(const std::string& str) { return std::stod(str); } template - typename std::enable_if::value, T>::type cast_string(const std::string& str) { return std::stoi(str); } + typename std::enable_if::value, T>::type cast_string(const std::string& str) + { + if (str == "true" || str == "1") + return 1; + else if (str == "false" || str == "0") + return 0; + else + return std::stoi(str); + } template typename std::enable_if::value, T>::type cast_string(const std::string& str) { return (str == "true" || str == "1"); } template diff --git a/source/module_io/nscf_band.cpp b/source/module_io/nscf_band.cpp index d8b7b05ca6..290dc58bd3 100644 --- a/source/module_io/nscf_band.cpp +++ b/source/module_io/nscf_band.cpp @@ -3,6 +3,7 @@ #include "module_base/global_variable.h" #include "module_base/timer.h" #include "module_base/tool_title.h" +#include "module_base/formatter_physfmt.h" void ModuleIO::nscf_band( const int &is, @@ -10,6 +11,7 @@ void ModuleIO::nscf_band( const int &nks, const int &nband, const double &fermie, + const int &precision, const ModuleBase::matrix& ekb, const K_Vectors& kv, const Parallel_Kpoints* Pkpoints) @@ -33,23 +35,28 @@ void ModuleIO::nscf_band( if (ik>0) { auto delta=kv.kvec_c[ik]-kv.kvec_c[ik-1]; - klength[ik] = klength[ik-1] + delta.norm(); + klength[ik] = klength[ik-1]; + klength[ik] += (kv.kl_segids[ik] == kv.kl_segids[ik-1]) ? delta.norm() : 0.0; } + /* first find if present kpoint in present pool */ if ( GlobalV::MY_POOL == Pkpoints->whichpool[ik] ) { + /* then get the local kpoint index, which starts definitly from 0 */ const int ik_now = ik - Pkpoints->startk_pool[GlobalV::MY_POOL]; + /* if present kpoint corresponds the spin of the present one */ if( kv.isk[ik_now+is*nks] == is ) { if ( GlobalV::RANK_IN_POOL == 0) { - std::ofstream ofs(out_band_dir.c_str(),std::ios::app); - ofs << std::setprecision(8); - //start from 1 - ofs << ik+1; - ofs << " " << klength[ik] << " "; + formatter::PhysicalFmt physfmt; // create a physical formatter temporarily + std::ofstream ofs(out_band_dir.c_str(), std::ios::app); + physfmt.adjust_formatter_flexible(4, 0, false); // for integer + ofs << physfmt.get_p_formatter()->format(ik+1); + physfmt.adjust_formatter_flexible(precision, 4.0/double(precision), false); // for decimal + ofs << physfmt.get_p_formatter()->format(klength[ik]); for(int ib = 0; ib < nband; ib++) { - ofs << " " << (ekb(ik_now+is*nks, ib)-fermie) * ModuleBase::Ry_to_eV; + ofs << physfmt.get_p_formatter()->format((ekb(ik_now+is*nks, ib)-fermie) * ModuleBase::Ry_to_eV); } ofs << std::endl; ofs.close(); @@ -83,18 +90,30 @@ void ModuleIO::nscf_band( #else // std::cout<<"\n nband = "< klength; + klength.resize(nks); + klength[0] = 0.0; std::ofstream ofs(out_band_dir.c_str()); for(int ik=0;ik0) + { + auto delta=kv.kvec_c[ik]-kv.kvec_c[ik-1]; + klength[ik] = klength[ik-1]; + klength[ik] += (kv.kl_segids[ik] == kv.kl_segids[ik-1]) ? delta.norm() : 0.0; + } if( kv.isk[ik] == is) { - ofs<format(ik+1); + physfmt.adjust_formatter_flexible(precision, 4.0/double(precision), false); // for decimal + ofs << physfmt.get_p_formatter()->format(klength[ik]); // add klength, in accordance with the MPI version for(int ibnd = 0; ibnd < nband; ibnd++) { - ofs <format((ekb(ik, ibnd)-fermie) * ModuleBase::Ry_to_eV); } - ofs< input_parameters } else if (input_parameters.count("out_band") != 0) { - INPUT.out_band = *static_cast(input_parameters["out_band"].get()); + INPUT.out_band = *static_cast*>(input_parameters["out_band"].get()); } else if (input_parameters.count("out_proj_band") != 0) { diff --git a/source/module_io/test/input_test.cpp b/source/module_io/test/input_test.cpp index 02a5a19e10..11bce873ab 100644 --- a/source/module_io/test/input_test.cpp +++ b/source/module_io/test/input_test.cpp @@ -176,9 +176,11 @@ TEST_F(InputTest, Default) EXPECT_EQ(INPUT.out_wfc_pw,0); EXPECT_EQ(INPUT.out_wfc_r,0); EXPECT_EQ(INPUT.out_dos,0); - EXPECT_EQ(INPUT.out_band,0); + EXPECT_EQ(INPUT.out_band[0],0); + EXPECT_EQ(INPUT.out_band[1],8); EXPECT_EQ(INPUT.out_proj_band,0); EXPECT_EQ(INPUT.out_mat_hs[0],0); + EXPECT_EQ(INPUT.out_mat_hs[1],8); EXPECT_EQ(INPUT.out_mat_hs2,0); EXPECT_EQ(INPUT.out_mat_xc, 0); EXPECT_EQ(INPUT.out_interval,1); @@ -539,9 +541,11 @@ TEST_F(InputTest, Read) EXPECT_EQ(INPUT.out_wfc_pw,0); EXPECT_EQ(INPUT.out_wfc_r,0); EXPECT_EQ(INPUT.out_dos,0); - EXPECT_EQ(INPUT.out_band,0); + EXPECT_EQ(INPUT.out_band[0],0); + EXPECT_EQ(INPUT.out_band[1],8); EXPECT_EQ(INPUT.out_proj_band,0); EXPECT_EQ(INPUT.out_mat_hs[0],0); + EXPECT_EQ(INPUT.out_mat_hs[1],8); EXPECT_EQ(INPUT.out_mat_hs2,0); EXPECT_EQ(INPUT.out_mat_xc, 0); EXPECT_EQ(INPUT.out_interval,1); @@ -921,7 +925,8 @@ TEST_F(InputTest, Default_2) EXPECT_EQ(INPUT.relax_nmax, 1); EXPECT_EQ(INPUT.out_stru, 0); EXPECT_EQ(INPUT.symmetry, "0"); - EXPECT_EQ(INPUT.out_band,0); + EXPECT_EQ(INPUT.out_band[0],0); + EXPECT_EQ(INPUT.out_band[1],8); EXPECT_EQ(INPUT.out_proj_band,0); EXPECT_EQ(INPUT.cal_force,0); EXPECT_EQ(INPUT.init_wfc,"file"); @@ -943,7 +948,8 @@ TEST_F(InputTest, Default_2) EXPECT_EQ(INPUT.relax_nmax, 1); EXPECT_EQ(INPUT.symmetry, "0"); EXPECT_EQ(INPUT.out_stru, 0); - EXPECT_EQ(INPUT.out_band,0); + EXPECT_EQ(INPUT.out_band[0],0); + EXPECT_EQ(INPUT.out_band[1],8); EXPECT_EQ(INPUT.out_proj_band,0); EXPECT_EQ(INPUT.cal_force,0); EXPECT_EQ(INPUT.init_wfc,"file"); diff --git a/source/module_io/test/input_test_para.cpp b/source/module_io/test/input_test_para.cpp index 8ae4bf63d1..7cc4d6bc73 100644 --- a/source/module_io/test/input_test_para.cpp +++ b/source/module_io/test/input_test_para.cpp @@ -181,7 +181,8 @@ TEST_F(InputParaTest, Bcast) EXPECT_EQ(INPUT.out_wfc_pw, 0); EXPECT_EQ(INPUT.out_wfc_r, 0); EXPECT_EQ(INPUT.out_dos, 0); - EXPECT_EQ(INPUT.out_band, 0); + EXPECT_EQ(INPUT.out_band[0], 0); + EXPECT_EQ(INPUT.out_band[1], 8); EXPECT_EQ(INPUT.out_proj_band, 0); EXPECT_EQ(INPUT.out_mat_hs[0], 0); EXPECT_EQ(INPUT.out_mat_hs[1], 8); diff --git a/source/module_io/test/support/INPUT b/source/module_io/test/support/INPUT index 469dff2ff4..4fbde867db 100644 --- a/source/module_io/test/support/INPUT +++ b/source/module_io/test/support/INPUT @@ -59,7 +59,7 @@ out_pot 2 #output realspace potential out_wfc_pw 0 #output wave functions out_wfc_r 0 #output wave functions in realspace out_dos 0 #output energy and dos -out_band false #output energy and band structure +out_band 0 #output energy and band structure out_proj_band FaLse #output projected band structure restart_save f #print to disk every step for restart restart_load F #restart from disk diff --git a/source/module_io/test/support/witestfile b/source/module_io/test/support/witestfile index 4043773876..4db819d53f 100644 --- a/source/module_io/test/support/witestfile +++ b/source/module_io/test/support/witestfile @@ -55,7 +55,7 @@ out_pot 2 #output realspace potential out_wfc_pw 0 #output wave functions out_wfc_r 0 #output wave functions in realspace out_dos 0 #output energy and dos -out_band false #output energy and band structure +out_band 0 #output energy and band structure out_proj_band FaLse #output projected band structure restart_save f #print to disk every step for restart restart_load F #restart from disk diff --git a/source/module_io/test_serial/nscf_band_test.cpp b/source/module_io/test_serial/nscf_band_test.cpp index 4483bf37cd..db9bf752fb 100644 --- a/source/module_io/test_serial/nscf_band_test.cpp +++ b/source/module_io/test_serial/nscf_band_test.cpp @@ -54,9 +54,16 @@ class BandTest : public ::testing::Test ekb(1,1) = 2.0; ekb(1,2) = 3.0; kv = new K_Vectors; + // specify the kpoints + kv->kvec_c.resize(nks); + kv->kvec_c[0] = ModuleBase::Vector3(0.0, 0.0, 0.0); + kv->kvec_c[1] = ModuleBase::Vector3(1.0, 0.0, 0.0); kv->isk.resize(nks); kv->isk[0] = 0; kv->isk[1] = 1; + kv->kl_segids.resize(nks); + kv->kl_segids[0] = 0; + kv->kl_segids[1] = 0; Pkpoints = new Parallel_Kpoints; } @@ -81,12 +88,12 @@ class BandTest : public ::testing::Test TEST_F(BandTest, nscf_band) { // Call the function to be tested - ModuleIO::nscf_band(is, out_band_dir, nks, nband, fermie, ekb, *kv, Pkpoints); + ModuleIO::nscf_band(is, out_band_dir, nks, nband, fermie, 8, ekb, *kv, Pkpoints); // Check the output file std::ifstream ifs(out_band_dir); std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); ASSERT_TRUE(ifs.is_open()); - EXPECT_THAT(str, testing::HasSubstr("1 -27.2114 -13.6057 0")); + EXPECT_THAT(str, testing::HasSubstr("1 0.00000000 -27.21139600 -13.60569800 0.00000000")); ifs.close(); } diff --git a/source/module_io/write_input.cpp b/source/module_io/write_input.cpp index 5c0fc4cada..b7e49901c8 100644 --- a/source/module_io/write_input.cpp +++ b/source/module_io/write_input.cpp @@ -122,7 +122,7 @@ void Input::Print(const std::string &fn) const ModuleBase::GlobalFunc::OUTP(ofs, "out_wfc_pw", out_wfc_pw, "output wave functions"); ModuleBase::GlobalFunc::OUTP(ofs, "out_wfc_r", out_wfc_r, "output wave functions in realspace"); ModuleBase::GlobalFunc::OUTP(ofs, "out_dos", out_dos, "output energy and dos"); - ModuleBase::GlobalFunc::OUTP(ofs, "out_band", out_band, "output energy and band structure"); + ModuleBase::GlobalFunc::OUTP(ofs, "out_band", out_band[0], "output energy and band structure (with precision "+std::to_string(out_band[1])+")"); ModuleBase::GlobalFunc::OUTP(ofs, "out_proj_band", out_proj_band, "output projected band structure"); ModuleBase::GlobalFunc::OUTP(ofs, "restart_save", restart_save, "print to disk every step for restart"); ModuleBase::GlobalFunc::OUTP(ofs, "restart_load", restart_load, "restart from disk"); @@ -222,7 +222,7 @@ ModuleBase::GlobalFunc::OUTP(ofs, "out_bandgap", out_bandgap, "if true, print ou ModuleBase::GlobalFunc::OUTP(ofs, "lcao_dk", lcao_dk, "delta k for 1D integration in LCAO"); ModuleBase::GlobalFunc::OUTP(ofs, "lcao_dr", lcao_dr, "delta r for 1D integration in LCAO"); ModuleBase::GlobalFunc::OUTP(ofs, "lcao_rmax", lcao_rmax, "max R for 1D two-center integration table"); - ModuleBase::GlobalFunc::OUTP(ofs, "out_mat_hs", out_mat_hs[0], "output H and S matrix"); + ModuleBase::GlobalFunc::OUTP(ofs, "out_mat_hs", out_mat_hs[0], "output H and S matrix (with precision "+std::to_string(out_mat_hs[1])+")"); ModuleBase::GlobalFunc::OUTP(ofs, "out_mat_hs2", out_mat_hs2, "output H(R) and S(R) matrix"); ModuleBase::GlobalFunc::OUTP(ofs, "out_mat_dh", out_mat_dh, "output of derivative of H(R) matrix"); ModuleBase::GlobalFunc::OUTP(ofs, "out_mat_xc", out_mat_xc, "output exchange-correlation matrix in KS-orbital representation"); diff --git a/tests/integrate/107_PW_OBOD_MemSaver/refBANDS_1.dat b/tests/integrate/107_PW_OBOD_MemSaver/refBANDS_1.dat index af0ad58c0d..1aa4b94ac1 100644 --- a/tests/integrate/107_PW_OBOD_MemSaver/refBANDS_1.dat +++ b/tests/integrate/107_PW_OBOD_MemSaver/refBANDS_1.dat @@ -1,6 +1,6 @@ -1 0 -3.3870593 -0.79801307 5.0648821 5.0648821 7.8411435 9.605949 -2 0.17320508 -3.8620194 -0.075179882 5.1365314 5.1365314 7.9181006 9.6849562 -3 0.34641016 -4.6307963 1.434193 5.3528485 5.3528485 8.1554014 9.8149803 -4 0.51961524 -5.2581292 3.25095 5.6954121 5.6954121 8.5186442 9.653424 -5 0.69282032 -5.6519805 5.1370698 6.0846605 6.0846605 8.8678468 9.1370653 -6 0.8660254 -5.7858738 6.2887673 6.2887673 6.2887673 8.8364355 8.8364355 + 1 0.00000000 -3.38705933 -0.79801307 5.06488210 5.06488210 7.84114355 9.60594903 + 2 0.17320508 -3.86201936 -0.07517988 5.13653145 5.13653145 7.91810064 9.68495616 + 3 0.34641016 -4.63079629 1.43419304 5.35284854 5.35284854 8.15540136 9.81498032 + 4 0.51961524 -5.25812925 3.25094996 5.69541211 5.69541211 8.51864422 9.65342396 + 5 0.69282032 -5.65198054 5.13706981 6.08466055 6.08466055 8.86784679 9.13706533 + 6 0.86602540 -5.78587376 6.28876728 6.28876728 6.28876728 8.83643550 8.83643550 diff --git a/tests/integrate/107_PW_OB_outputbands/refBANDS_1.dat b/tests/integrate/107_PW_OB_outputbands/refBANDS_1.dat index ced64a27bf..0a1088ceb5 100644 --- a/tests/integrate/107_PW_OB_outputbands/refBANDS_1.dat +++ b/tests/integrate/107_PW_OB_outputbands/refBANDS_1.dat @@ -1,6 +1,6 @@ -1 0 -3.3870489 -0.79801666 5.0648903 5.0649025 7.841159 9.6059536 -2 0.17320508 -3.861988 -0.075180055 5.1365331 5.136532 7.9181141 9.6849637 -3 0.34641016 -4.6307948 1.43421 5.3529077 5.3528526 8.1553806 9.8149771 -4 0.51961524 -5.2581202 3.2509597 5.6954124 5.6954235 8.5188338 9.6533658 -5 0.69282032 -5.6519785 5.1370872 6.0846758 6.0846914 8.8679617 9.1370593 -6 0.8660254 -5.7858674 6.288817 6.2887755 6.2887815 8.8365307 8.8365071 + 1 0.00000000 -3.38704889 -0.79801666 5.06489026 5.06490253 7.84115900 9.60595365 + 2 0.17320508 -3.86198803 -0.07518005 5.13653307 5.13653200 7.91811409 9.68496369 + 3 0.34641016 -4.63079483 1.43421001 5.35290770 5.35285262 8.15538060 9.81497711 + 4 0.51961524 -5.25812025 3.25095973 5.69541240 5.69542353 8.51883375 9.65336577 + 5 0.69282032 -5.65197852 5.13708720 6.08467575 6.08469139 8.86796173 9.13705931 + 6 0.86602540 -5.78586742 6.28881704 6.28877545 6.28878152 8.83653074 8.83650706 diff --git a/tests/integrate/207_NO_KP_OB/refBANDS_1.dat b/tests/integrate/207_NO_KP_OB/refBANDS_1.dat index c3cd3a0b6d..87a35be1b0 100644 --- a/tests/integrate/207_NO_KP_OB/refBANDS_1.dat +++ b/tests/integrate/207_NO_KP_OB/refBANDS_1.dat @@ -1,6 +1,6 @@ -1 0 -3.2007432 -0.55268317 5.3411505 5.3411505 8.2951616 10.292492 -2 0.17320508 -3.6638913 0.16302859 5.4122469 5.4122469 8.3831312 10.350824 -3 0.34641016 -4.4233335 1.6715127 5.6238068 5.6238068 8.6434268 10.399663 -4 0.51961524 -5.0448087 3.4994417 5.9592422 5.9592422 9.0296871 10.132257 -5 0.69282032 -5.4330707 5.3995429 6.3414385 6.3414385 9.3569963 9.5807977 -6 0.8660254 -5.5643351 6.5398122 6.5398122 6.5398122 9.280228 9.280228 + 1 0.00000000 -3.20074324 -0.55268317 5.34115051 5.34115051 8.29516160 10.29249200 + 2 0.17320508 -3.66389133 0.16302859 5.41224692 5.41224692 8.38313120 10.35082356 + 3 0.34641016 -4.42333349 1.67151268 5.62380682 5.62380682 8.64342675 10.39966330 + 4 0.51961524 -5.04480873 3.49944170 5.95924219 5.95924219 9.02968708 10.13225743 + 5 0.69282032 -5.43307067 5.39954292 6.34143853 6.34143853 9.35699627 9.58079775 + 6 0.86602540 -5.56433513 6.53981221 6.53981221 6.53981221 9.28022796 9.28022796