diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index 642b45b774..ec11f4d085 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -8,6 +8,7 @@ #include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" #include "module_hamilt_lcao/module_dftu/dftu.h" #include "module_io/berryphase.h" +#include "module_io/cal_ldos.h" #include "module_io/cube_io.h" #include "module_io/dos_nao.h" #include "module_io/io_dmk.h" @@ -419,6 +420,15 @@ void ESolver_KS_LCAO::after_all_runners(UnitCell& ucell) this->p_hamilt); } + // out ldos + if (PARAM.inp.out_ldos[0]) + { + ModuleIO::Cal_ldos::cal_ldos_lcao(reinterpret_cast*>(this->pelec), + this->psi[0], + this->Pgrid, + ucell); + } + // 6) print out exchange-correlation potential if (PARAM.inp.out_mat_xc) { diff --git a/source/module_esolver/esolver_ks_pw.cpp b/source/module_esolver/esolver_ks_pw.cpp index 23ffd297dd..9f9ebdcff2 100644 --- a/source/module_esolver/esolver_ks_pw.cpp +++ b/source/module_esolver/esolver_ks_pw.cpp @@ -853,12 +853,13 @@ void ESolver_KS_PW::after_all_runners(UnitCell& ucell) } // out ldos - if (PARAM.inp.out_ldos) + if (PARAM.inp.out_ldos[0]) { - ModuleIO::cal_ldos(reinterpret_cast>*>(this->pelec), - this->psi[0], - this->Pgrid, - ucell); + ModuleIO::Cal_ldos>::cal_ldos_pw( + reinterpret_cast>*>(this->pelec), + this->psi[0], + this->Pgrid, + ucell); } //! 5) Calculate the spillage value, used to generate numerical atomic orbitals diff --git a/source/module_io/cal_ldos.cpp b/source/module_io/cal_ldos.cpp index 7947ad1b47..a014dc93df 100644 --- a/source/module_io/cal_ldos.cpp +++ b/source/module_io/cal_ldos.cpp @@ -1,13 +1,18 @@ #include "cal_ldos.h" #include "cube_io.h" +#include "module_base/blas_connector.h" +#include "module_base/scalapack_connector.h" + +#include namespace ModuleIO { -void cal_ldos(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell) +template +void Cal_ldos::cal_ldos_pw(const elecstate::ElecStatePW>* pelec, + const psi::Psi>& psi, + const Parallel_Grid& pgrid, + const UnitCell& ucell) { // energy range for ldos (efermi as reference) const double emin = PARAM.inp.stm_bias < 0 ? PARAM.inp.stm_bias : 0; @@ -19,13 +24,13 @@ void cal_ldos(const elecstate::ElecStatePW>* pelec, for (int ik = 0; ik < pelec->klist->get_nks(); ++ik) { psi.fix_k(ik); - double efermi = pelec->eferm.get_efval(pelec->klist->isk[ik]); + const double efermi = pelec->eferm.get_efval(pelec->klist->isk[ik]); int nbands = psi.get_nbands(); for (int ib = 0; ib < nbands; ib++) { pelec->basis->recip2real(&psi(ib, 0), wfcr.data(), ik); - double eigenval = (pelec->ekb(ik, ib) - efermi) * ModuleBase::Ry_to_eV; + const double eigenval = (pelec->ekb(ik, ib) - efermi) * ModuleBase::Ry_to_eV; if (eigenval >= emin && eigenval <= emax) { for (int ir = 0; ir < pelec->basis->nrxx; ir++) @@ -38,18 +43,90 @@ void cal_ldos(const elecstate::ElecStatePW>* pelec, fn << PARAM.globalv.global_out_dir << "LDOS_" << PARAM.inp.stm_bias << "eV" << ".cube"; - ModuleIO::write_vdata_palgrid(pgrid, ldos.data(), 0, PARAM.inp.nspin, 0, fn.str(), 0, &ucell, 11, 0); + const int precision = PARAM.inp.out_ldos[1]; + ModuleIO::write_vdata_palgrid(pgrid, ldos.data(), 0, PARAM.inp.nspin, 0, fn.str(), 0, &ucell, precision, 0); } #ifdef __LCAO -// lcao multi-k case -// void cal_ldos(elecstate::ElecState* pelec, const psi::Psi>& psi, std::vector& ldos) -// { -// } - -// // lcao Gamma_only case -// void cal_ldos(elecstate::ElecState* pelec, const psi::Psi& psi, std::vector& ldos) -// { -// } +template +void Cal_ldos::cal_ldos_lcao(const elecstate::ElecStateLCAO* pelec, + const psi::Psi& psi, + const Parallel_Grid& pgrid, + const UnitCell& ucell) +{ + // energy range for ldos (efermi as reference) + const double emin = PARAM.inp.stm_bias < 0 ? PARAM.inp.stm_bias : 0; + const double emax = PARAM.inp.stm_bias > 0 ? PARAM.inp.stm_bias : 0; + + // calulate dm-like + const int nbands_local = psi.get_nbands(); + const int nbasis_local = psi.get_nbasis(); + + // psi.T * wk * psi.conj() + // result[ik](iw1,iw2) = \sum_{ib} psi[ik](ib,iw1).T * wk(k) * psi[ik](ib,iw2).conj() + for (int ik = 0; ik < psi.get_nk(); ++ik) + { + psi.fix_k(ik); + const double efermi = pelec->eferm.get_efval(pelec->klist->isk[ik]); + + // T* dmk_pointer = DM.get_DMK_pointer(ik); + + psi::Psi wk_psi(1, psi.get_nbands(), psi.get_nbasis(), psi.get_nbasis(), true); + const T* ppsi = psi.get_pointer(); + T* pwk_psi = wk_psi.get_pointer(); + + // #ifdef _OPENMP + // #pragma omp parallel for schedule(static, 1024) + // #endif + // for (int i = 0; i < wk_psi.size(); ++i) + // { + // pwk_psi[i] = my_conj(ppsi[i]); + // } + + // int ib_global = 0; + // for (int ib_local = 0; ib_local < nbands_local; ++ib_local) + // { + // while (ib_local != ParaV->global2local_col(ib_global)) + // { + // ++ib_global; + // if (ib_global >= wg.nc) + // { + // ModuleBase::WARNING_QUIT("cal_ldos", "please check global2local_col!"); + // } + // } + + // const double eigenval = (pelec->ekb(ik, ib_global) - efermi) * ModuleBase::Ry_to_eV; + // if (eigenval >= emin && eigenval <= emax) + // { + // for (int ir = 0; ir < pelec->basis->nrxx; ir++) + // ldos[ir] += pelec->klist->wk[ik] * norm(wfcr[ir]); + // } + + // double* wg_wfc_pointer = &(wk_psi(0, ib_local, 0)); + // BlasConnector::scal(nbasis_local, pelec->klist->wk[ik], wg_wfc_pointer, 1); + // } + + // // C++: dm(iw1,iw2) = psi(ib,iw1).T * wk_psi(ib,iw2) + // #ifdef __MPI + // psiMulPsiMpi(wk_psi, psi, dmk_pointer, ParaV->desc_wfc, ParaV->desc); + // #else + // psiMulPsi(wk_psi, psi, dmk_pointer); + // #endif + } +} + +double my_conj(double x) +{ + return x; +} + +std::complex my_conj(const std::complex& z) +{ + return {z.real(), -z.imag()}; +} + #endif + +template class Cal_ldos; // Gamma_only case +template class Cal_ldos>; // multi-k case } // namespace elecstate diff --git a/source/module_io/cal_ldos.h b/source/module_io/cal_ldos.h index e761b6f200..6eee90a823 100644 --- a/source/module_io/cal_ldos.h +++ b/source/module_io/cal_ldos.h @@ -1,16 +1,29 @@ #ifndef CAL_LDOS_H #define CAL_LDOS_H +#include "module_elecstate/elecstate_lcao.h" #include "module_elecstate/elecstate_pw.h" namespace ModuleIO { +template +class Cal_ldos +{ + public: + Cal_ldos(){}; + ~Cal_ldos(){}; + + static void cal_ldos_pw(const elecstate::ElecStatePW>* pelec, + const psi::Psi>& psi, + const Parallel_Grid& pgrid, + const UnitCell& ucell); -void cal_ldos(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell); + static void cal_ldos_lcao(const elecstate::ElecStateLCAO* pelec, + const psi::Psi& psi, + const Parallel_Grid& pgrid, + const UnitCell& ucell); +}; // namespace Cal_ldos } // namespace ModuleIO #endif // CAL_LDOS_H \ No newline at end of file diff --git a/source/module_io/read_input_item_output.cpp b/source/module_io/read_input_item_output.cpp index e4f7d59d78..a26993ece1 100644 --- a/source/module_io/read_input_item_output.cpp +++ b/source/module_io/read_input_item_output.cpp @@ -145,8 +145,17 @@ void ReadInput::item_output() } { Input_Item item("out_ldos"); - item.annotation = "output local density of states"; - read_sync_bool(input.out_ldos); + item.annotation = "output local density of states, second parameter controls the precision"; + item.read_value = [](const Input_Item& item, Parameter& para) { + const size_t count = item.get_size(); + if (count != 1 && count != 2) + { + ModuleBase::WARNING_QUIT("ReadInput", "out_ldos should have 1 or 2 values"); + } + para.input.out_ldos[0] = assume_as_boolean(item.str_values[0]); + para.input.out_ldos[1] = (count == 2) ? std::stoi(item.str_values[1]) : 3; + }; + sync_intvec(input.out_ldos, 2, 0); this->add_item(item); } { diff --git a/source/module_io/read_input_item_postprocess.cpp b/source/module_io/read_input_item_postprocess.cpp index fec3cbf7fe..11eb0e7954 100644 --- a/source/module_io/read_input_item_postprocess.cpp +++ b/source/module_io/read_input_item_postprocess.cpp @@ -58,7 +58,7 @@ void ReadInput::item_postprocess() item.annotation = "bias voltage used to calculate ldos"; read_sync_double(input.stm_bias); item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_ldos && para.input.stm_bias == 0.0) + if (para.input.out_ldos[0] && para.input.stm_bias == 0.0) { ModuleBase::WARNING_QUIT("ReadInput", "a nonzero stm_bias is required for ldos calculation"); } diff --git a/source/module_io/test/read_input_ptest.cpp b/source/module_io/test/read_input_ptest.cpp index f72796268c..ee17de7dcf 100644 --- a/source/module_io/test/read_input_ptest.cpp +++ b/source/module_io/test/read_input_ptest.cpp @@ -201,7 +201,8 @@ TEST_F(InputParaTest, ParaRead) EXPECT_EQ(param.inp.out_wfc_pw, 0); EXPECT_EQ(param.inp.out_wfc_r, 0); EXPECT_EQ(param.inp.out_dos, 0); - EXPECT_EQ(param.inp.out_ldos, true); + EXPECT_EQ(param.inp.out_ldos[0], 1); + EXPECT_EQ(param.inp.out_ldos[1], 3); EXPECT_EQ(param.inp.out_band[0], 0); EXPECT_EQ(param.inp.out_band[1], 8); EXPECT_EQ(param.inp.out_proj_band, 0); diff --git a/source/module_io/test/support/INPUT b/source/module_io/test/support/INPUT index f168ee2eab..2b70f7c836 100644 --- a/source/module_io/test/support/INPUT +++ b/source/module_io/test/support/INPUT @@ -65,7 +65,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_ldos True #output local density of states +out_ldos 1 #output local density of states, second parameter controls the precision 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 diff --git a/source/module_io/test_serial/read_input_item_test.cpp b/source/module_io/test_serial/read_input_item_test.cpp index 21d3e3f3c2..bb96a58316 100644 --- a/source/module_io/test_serial/read_input_item_test.cpp +++ b/source/module_io/test_serial/read_input_item_test.cpp @@ -393,7 +393,7 @@ TEST_F(InputTest, Item_test) } { // stm_bias auto it = find_label("stm_bias", readinput.input_lists); - param.input.out_ldos = true; + param.input.out_ldos[0] = 1; param.input.stm_bias = 0.0; testing::internal::CaptureStdout(); diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 73d6671bd3..b3b08150c7 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -363,7 +363,7 @@ struct Input_para int printe = 0; ///< Print out energy for each band for every printe step, default is scf_nmax std::vector out_band = {0, 8}; ///< band calculation pengfei 2014-10-13 int out_dos = 0; ///< dos calculation. mohan add 20090909 - bool out_ldos = false; ///< ldos calculation + std::vector out_ldos = {0, 3}; ///< ldos calculation bool out_mul = false; ///< qifeng add 2019-9-10 bool out_proj_band = false; ///< projected band structure calculation jiyy add 2022-05-11 std::string out_level = "ie"; ///< control the output information. diff --git a/tests/integrate/101_PW_15_pseudopots/INPUT b/tests/integrate/101_PW_15_pseudopots/INPUT index a2944455c4..0fe9d3b8db 100644 --- a/tests/integrate/101_PW_15_pseudopots/INPUT +++ b/tests/integrate/101_PW_15_pseudopots/INPUT @@ -23,3 +23,6 @@ smearing_sigma 0.002 #Parameters (5.Mixing) mixing_type broyden mixing_beta 0.7 + +out_ldos 1 +stm_bias 2 \ No newline at end of file diff --git a/tests/integrate/101_PW_15_pseudopots/LDOS.cube.ref b/tests/integrate/101_PW_15_pseudopots/LDOS.cube.ref new file mode 100644 index 0000000000..14debf4b5f --- /dev/null +++ b/tests/integrate/101_PW_15_pseudopots/LDOS.cube.ref @@ -0,0 +1,170 @@ +STEP: 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +1 (nspin) +2 0.0 0.0 0.0 +9 0.000000 0.277778 0.277778 +9 0.277778 0.000000 0.277778 +9 0.277778 0.277778 0.000000 + 14 4.000000 0.000000 0.000000 0.000000 + 14 4.000000 1.250000 1.250000 1.250000 + 3.302e-11 2.962e-01 2.976e+00 7.391e+00 1.003e+01 1.004e+01 + 7.423e+00 3.000e+00 3.010e-01 + 2.962e-01 1.731e+00 5.090e+00 8.602e+00 1.003e+01 8.645e+00 + 5.137e+00 1.748e+00 2.963e-01 + 2.976e+00 5.090e+00 5.058e+00 3.767e+00 3.793e+00 5.104e+00 + 5.107e+00 2.967e+00 1.541e+00 + 7.391e+00 8.602e+00 3.767e+00 1.656e-05 3.786e+00 8.601e+00 + 7.364e+00 3.652e+00 3.669e+00 + 1.003e+01 1.003e+01 3.793e+00 3.786e+00 1.000e+01 9.988e+00 + 4.821e+00 2.277e+00 4.854e+00 + 1.004e+01 8.645e+00 5.104e+00 8.601e+00 9.988e+00 4.984e+00 + 1.137e+00 1.152e+00 5.026e+00 + 7.423e+00 5.137e+00 5.107e+00 7.364e+00 4.821e+00 1.137e+00 + 3.969e-05 1.160e+00 4.869e+00 + 2.999e+00 1.748e+00 2.967e+00 3.652e+00 2.277e+00 1.152e+00 + 1.161e+00 2.302e+00 3.691e+00 + 3.010e-01 2.963e-01 1.541e+00 3.669e+00 4.854e+00 5.026e+00 + 4.869e+00 3.691e+00 1.556e+00 + 2.962e-01 1.731e+00 5.090e+00 8.602e+00 1.003e+01 8.645e+00 + 5.137e+00 1.748e+00 2.963e-01 + 1.731e+00 4.466e-11 2.112e+00 5.656e+00 5.674e+00 2.139e+00 + 1.103e-04 1.713e+00 3.396e+00 + 5.090e+00 2.112e+00 9.729e-01 1.008e+00 9.830e-01 2.102e+00 + 5.059e+00 7.717e+00 7.734e+00 + 8.601e+00 5.656e+00 1.008e+00 1.006e+00 5.641e+00 8.567e+00 + 8.327e+00 7.783e+00 8.357e+00 + 1.003e+01 5.673e+00 9.830e-01 5.641e+00 9.979e+00 7.281e+00 + 3.939e+00 3.955e+00 7.322e+00 + 8.645e+00 2.139e+00 2.102e+00 8.567e+00 7.281e+00 2.303e+00 + 5.171e-01 2.336e+00 7.347e+00 + 5.137e+00 1.101e-04 5.058e+00 8.327e+00 3.939e+00 5.171e-01 + 5.355e-01 3.997e+00 8.417e+00 + 1.748e+00 1.713e+00 7.716e+00 7.783e+00 3.955e+00 2.336e+00 + 3.997e+00 7.858e+00 7.795e+00 + 2.963e-01 3.396e+00 7.734e+00 8.357e+00 7.322e+00 7.347e+00 + 8.418e+00 7.795e+00 3.429e+00 + 2.976e+00 5.090e+00 5.058e+00 3.767e+00 3.793e+00 5.104e+00 + 5.107e+00 2.967e+00 1.541e+00 + 5.090e+00 2.112e+00 9.729e-01 1.008e+00 9.830e-01 2.102e+00 + 5.059e+00 7.717e+00 7.734e+00 + 5.058e+00 9.728e-01 4.867e-11 2.946e-06 9.642e-01 5.035e+00 + 9.661e+00 1.147e+01 9.682e+00 + 3.767e+00 1.008e+00 2.956e-06 1.003e+00 3.758e+00 6.329e+00 + 7.266e+00 7.271e+00 6.339e+00 + 3.793e+00 9.830e-01 9.642e-01 3.758e+00 4.207e+00 2.811e+00 + 2.150e+00 2.823e+00 4.233e+00 + 5.104e+00 2.102e+00 5.035e+00 6.329e+00 2.811e+00 3.704e-01 + 3.831e-01 2.853e+00 6.402e+00 + 5.107e+00 5.058e+00 9.661e+00 7.266e+00 2.150e+00 3.831e-01 + 2.192e+00 7.350e+00 9.761e+00 + 2.967e+00 7.716e+00 1.147e+01 7.271e+00 2.823e+00 2.853e+00 + 7.350e+00 1.157e+01 7.785e+00 + 1.541e+00 7.734e+00 9.682e+00 6.339e+00 4.233e+00 6.402e+00 + 9.761e+00 7.785e+00 1.555e+00 + 7.391e+00 8.602e+00 3.767e+00 1.657e-05 3.786e+00 8.601e+00 + 7.364e+00 3.653e+00 3.669e+00 + 8.602e+00 5.656e+00 1.008e+00 1.006e+00 5.641e+00 8.568e+00 + 8.327e+00 7.783e+00 8.357e+00 + 3.767e+00 1.008e+00 2.960e-06 1.003e+00 3.758e+00 6.329e+00 + 7.266e+00 7.271e+00 6.339e+00 + 1.672e-05 1.006e+00 1.003e+00 2.004e-09 1.243e+00 2.811e+00 + 3.206e+00 2.805e+00 1.234e+00 + 3.786e+00 5.640e+00 3.758e+00 1.242e+00 5.624e-01 5.572e-01 + 5.568e-01 5.653e-01 1.261e+00 + 8.601e+00 8.567e+00 6.329e+00 2.811e+00 5.571e-01 2.758e-05 + 5.718e-01 2.850e+00 6.390e+00 + 7.364e+00 8.327e+00 7.266e+00 3.206e+00 5.567e-01 5.718e-01 + 3.252e+00 7.337e+00 8.388e+00 + 3.652e+00 7.783e+00 7.271e+00 2.805e+00 5.653e-01 2.850e+00 + 7.337e+00 7.839e+00 3.674e+00 + 3.669e+00 8.357e+00 6.339e+00 1.234e+00 1.261e+00 6.390e+00 + 8.388e+00 3.674e+00 2.748e-08 + 1.003e+01 1.003e+01 3.793e+00 3.786e+00 1.000e+01 9.988e+00 + 4.821e+00 2.277e+00 4.854e+00 + 1.003e+01 5.674e+00 9.830e-01 5.641e+00 9.979e+00 7.281e+00 + 3.939e+00 3.955e+00 7.322e+00 + 3.793e+00 9.830e-01 9.642e-01 3.758e+00 4.207e+00 2.811e+00 + 2.150e+00 2.823e+00 4.233e+00 + 3.786e+00 5.640e+00 3.758e+00 1.243e+00 5.625e-01 5.572e-01 + 5.568e-01 5.653e-01 1.261e+00 + 1.000e+01 9.979e+00 4.207e+00 5.624e-01 1.060e-09 3.743e-02 + 1.985e-05 5.745e-01 4.241e+00 + 9.988e+00 7.281e+00 2.810e+00 5.571e-01 3.742e-02 3.939e-02 + 5.689e-01 2.844e+00 7.320e+00 + 4.821e+00 3.939e+00 2.150e+00 5.567e-01 1.992e-05 5.689e-01 + 2.177e+00 3.975e+00 4.839e+00 + 2.277e+00 3.955e+00 2.823e+00 5.653e-01 5.745e-01 2.843e+00 + 3.975e+00 2.287e+00 8.466e-01 + 4.854e+00 7.322e+00 4.233e+00 1.261e+00 4.241e+00 7.320e+00 + 4.839e+00 8.466e-01 8.556e-01 + 1.004e+01 8.645e+00 5.104e+00 8.601e+00 9.988e+00 4.984e+00 + 1.137e+00 1.152e+00 5.026e+00 + 8.645e+00 2.139e+00 2.102e+00 8.567e+00 7.281e+00 2.303e+00 + 5.171e-01 2.336e+00 7.347e+00 + 5.104e+00 2.102e+00 5.035e+00 6.329e+00 2.811e+00 3.705e-01 + 3.831e-01 2.853e+00 6.402e+00 + 8.601e+00 8.567e+00 6.329e+00 2.811e+00 5.572e-01 2.748e-05 + 5.718e-01 2.850e+00 6.390e+00 + 9.988e+00 7.281e+00 2.810e+00 5.571e-01 3.742e-02 3.938e-02 + 5.689e-01 2.844e+00 7.320e+00 + 4.984e+00 2.303e+00 3.704e-01 2.773e-05 3.939e-02 1.117e-11 + 3.810e-01 2.327e+00 4.999e+00 + 1.137e+00 5.171e-01 3.831e-01 5.718e-01 5.689e-01 3.810e-01 + 5.246e-01 1.148e+00 1.535e+00 + 1.152e+00 2.336e+00 2.853e+00 2.850e+00 2.844e+00 2.327e+00 + 1.148e+00 2.072e-01 2.080e-01 + 5.026e+00 7.347e+00 6.402e+00 6.390e+00 7.320e+00 4.999e+00 + 1.535e+00 2.080e-01 1.551e+00 + 7.423e+00 5.137e+00 5.107e+00 7.364e+00 4.821e+00 1.137e+00 + 3.974e-05 1.161e+00 4.869e+00 + 5.137e+00 1.102e-04 5.058e+00 8.327e+00 3.939e+00 5.171e-01 + 5.355e-01 3.997e+00 8.418e+00 + 5.107e+00 5.058e+00 9.661e+00 7.266e+00 2.150e+00 3.831e-01 + 2.192e+00 7.350e+00 9.762e+00 + 7.364e+00 8.327e+00 7.266e+00 3.206e+00 5.568e-01 5.718e-01 + 3.252e+00 7.337e+00 8.388e+00 + 4.821e+00 3.939e+00 2.150e+00 5.568e-01 1.982e-05 5.689e-01 + 2.177e+00 3.975e+00 4.839e+00 + 1.137e+00 5.171e-01 3.831e-01 5.718e-01 5.689e-01 3.810e-01 + 5.246e-01 1.148e+00 1.535e+00 + 3.952e-05 5.355e-01 2.192e+00 3.252e+00 2.177e+00 5.246e-01 + 3.087e-11 1.582e-01 1.563e-01 + 1.160e+00 3.997e+00 7.350e+00 7.337e+00 3.975e+00 1.148e+00 + 1.582e-01 1.768e-06 1.610e-01 + 4.869e+00 8.417e+00 9.761e+00 8.388e+00 4.839e+00 1.535e+00 + 1.563e-01 1.610e-01 1.551e+00 + 2.999e+00 1.748e+00 2.967e+00 3.652e+00 2.277e+00 1.152e+00 + 1.161e+00 2.302e+00 3.691e+00 + 1.748e+00 1.713e+00 7.716e+00 7.783e+00 3.955e+00 2.336e+00 + 3.997e+00 7.858e+00 7.795e+00 + 2.967e+00 7.716e+00 1.147e+01 7.271e+00 2.823e+00 2.853e+00 + 7.350e+00 1.157e+01 7.785e+00 + 3.652e+00 7.783e+00 7.271e+00 2.805e+00 5.653e-01 2.850e+00 + 7.337e+00 7.839e+00 3.674e+00 + 2.277e+00 3.955e+00 2.823e+00 5.653e-01 5.745e-01 2.843e+00 + 3.975e+00 2.288e+00 8.466e-01 + 1.152e+00 2.336e+00 2.853e+00 2.850e+00 2.843e+00 2.327e+00 + 1.148e+00 2.072e-01 2.080e-01 + 1.160e+00 3.997e+00 7.350e+00 7.337e+00 3.975e+00 1.148e+00 + 1.582e-01 1.741e-06 1.610e-01 + 2.302e+00 7.858e+00 1.157e+01 7.839e+00 2.288e+00 2.072e-01 + 1.775e-06 4.969e-10 2.106e-01 + 3.691e+00 7.795e+00 7.785e+00 3.674e+00 8.466e-01 2.080e-01 + 1.611e-01 2.106e-01 8.556e-01 + 3.010e-01 2.963e-01 1.541e+00 3.669e+00 4.854e+00 5.026e+00 + 4.869e+00 3.691e+00 1.556e+00 + 2.963e-01 3.396e+00 7.734e+00 8.357e+00 7.322e+00 7.347e+00 + 8.418e+00 7.795e+00 3.429e+00 + 1.541e+00 7.734e+00 9.682e+00 6.339e+00 4.233e+00 6.402e+00 + 9.762e+00 7.785e+00 1.555e+00 + 3.669e+00 8.357e+00 6.339e+00 1.234e+00 1.261e+00 6.390e+00 + 8.388e+00 3.674e+00 2.525e-08 + 4.854e+00 7.322e+00 4.233e+00 1.261e+00 4.241e+00 7.320e+00 + 4.839e+00 8.466e-01 8.556e-01 + 5.026e+00 7.347e+00 6.402e+00 6.390e+00 7.320e+00 4.999e+00 + 1.535e+00 2.080e-01 1.551e+00 + 4.869e+00 8.417e+00 9.761e+00 8.388e+00 4.839e+00 1.535e+00 + 1.563e-01 1.610e-01 1.551e+00 + 3.691e+00 7.795e+00 7.785e+00 3.674e+00 8.466e-01 2.080e-01 + 1.611e-01 2.106e-01 8.555e-01 + 1.556e+00 3.429e+00 1.555e+00 1.886e-08 8.556e-01 1.551e+00 + 1.551e+00 8.557e-01 3.092e-09 diff --git a/tests/integrate/101_PW_15_pseudopots/STRU b/tests/integrate/101_PW_15_pseudopots/STRU index 0041740d12..c374e6fc02 100644 --- a/tests/integrate/101_PW_15_pseudopots/STRU +++ b/tests/integrate/101_PW_15_pseudopots/STRU @@ -2,7 +2,7 @@ ATOMIC_SPECIES Si 14 Si_ONCV_PBE-1.0.upf upf201 LATTICE_CONSTANT -10.2 // add lattice constant +5 // add lattice constant LATTICE_VECTORS 0.0 0.5 0.5 diff --git a/tests/integrate/101_PW_15_pseudopots/result.ref b/tests/integrate/101_PW_15_pseudopots/result.ref index 1b0b9343b5..60735dc192 100644 --- a/tests/integrate/101_PW_15_pseudopots/result.ref +++ b/tests/integrate/101_PW_15_pseudopots/result.ref @@ -1,6 +1,7 @@ -etotref -197.1405644352682 -etotperatomref -98.5702822176 +etotref 13.59535887413501 +etotperatomref 6.7976794371 +LDOS.cube_pass 0 pointgroupref T_d spacegroupref O_h nksibzref 1 -totaltimeref +totaltimeref 0.19 diff --git a/tests/integrate/tools/catch_properties.sh b/tests/integrate/tools/catch_properties.sh index f8d25085b5..3d76e6e37d 100755 --- a/tests/integrate/tools/catch_properties.sh +++ b/tests/integrate/tools/catch_properties.sh @@ -69,6 +69,7 @@ has_mat_t=$(get_input_key_value "out_mat_t" "INPUT") has_mat_dh=$(get_input_key_value "out_mat_dh" "INPUT") has_scan=$(get_input_key_value "dft_functional" "INPUT") out_chg=$(get_input_key_value "out_chg" "INPUT") +has_ldos=$(get_input_key_value "out_ldos" "INPUT") esolver_type=$(get_input_key_value "esolver_type" "INPUT") rdmft=$(get_input_key_value "rdmft" "INPUT") #echo $running_path @@ -375,6 +376,16 @@ if ! test -z "$has_scan" && [ $has_scan == "scan" ] && \ echo "SPIN1_TAU.cube_pass $?" >>$1 fi +#--------------------------------------- +# local density of states +# echo $has_ldos +#--------------------------------------- +if ! test -z "$has_ldos" && [ $has_ldos == 1 ]; then + stm_bias=$(get_input_key_value "stm_bias" "OUT.autotest/INPUT") + python3 ../tools/CompareFile.py LDOS.cube.ref OUT.autotest/LDOS_"$stm_bias"eV.cube 8 + echo "LDOS.cube_pass $?" >> $1 +fi + #--------------------------------------- # wave functions in real space # echo "$has_wfc_r" ## test out_wfc_r > 0