From 58f3353d3d7796f05f585431591f5f61a48b1081 Mon Sep 17 00:00:00 2001 From: ubuntu <3158793232@qq.com> Date: Fri, 13 Dec 2024 16:24:27 +0800 Subject: [PATCH] change get ucell tpiba in getters --- source/module_elecstate/elecstate_getters.cpp | 4 ---- source/module_elecstate/elecstate_getters.h | 2 -- source/module_elecstate/elecstate_pw.cpp | 2 +- source/module_elecstate/elecstate_pw_cal_tau.cpp | 2 +- source/module_elecstate/test/elecstate_pw_test.cpp | 5 +---- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/source/module_elecstate/elecstate_getters.cpp b/source/module_elecstate/elecstate_getters.cpp index 86ec305b2d..d0ecaf42e6 100644 --- a/source/module_elecstate/elecstate_getters.cpp +++ b/source/module_elecstate/elecstate_getters.cpp @@ -13,10 +13,6 @@ double get_ucell_omega() return GlobalC::ucell.omega; } -double get_ucell_tpiba() -{ - return GlobalC::ucell.tpiba; -} int get_xc_func_type() { diff --git a/source/module_elecstate/elecstate_getters.h b/source/module_elecstate/elecstate_getters.h index 1dd1548f11..5fcb1e8d96 100644 --- a/source/module_elecstate/elecstate_getters.h +++ b/source/module_elecstate/elecstate_getters.h @@ -9,8 +9,6 @@ namespace elecstate /// @brief get the value of GlobalC::ucell.omega double get_ucell_omega(); -/// @brief get the value of GlobalC::ucell.tpiba -double get_ucell_tpiba(); /// @brief get the value of XC_Functional::func_type int get_xc_func_type(); diff --git a/source/module_elecstate/elecstate_pw.cpp b/source/module_elecstate/elecstate_pw.cpp index 696a3a75a2..cf28f35577 100644 --- a/source/module_elecstate/elecstate_pw.cpp +++ b/source/module_elecstate/elecstate_pw.cpp @@ -222,7 +222,7 @@ void ElecStatePW::rhoBandK(const psi::Psi& psi) j, npw, this->basis->npwk_max, - static_cast(get_ucell_tpiba()), + static_cast(ucell->tpiba), this->basis->template get_gcar_data(), this->basis->template get_kvec_c_data(), &psi(ibnd, 0), diff --git a/source/module_elecstate/elecstate_pw_cal_tau.cpp b/source/module_elecstate/elecstate_pw_cal_tau.cpp index 0662bb4425..b699cb20f8 100644 --- a/source/module_elecstate/elecstate_pw_cal_tau.cpp +++ b/source/module_elecstate/elecstate_pw_cal_tau.cpp @@ -38,7 +38,7 @@ void ElecStatePW::cal_tau(const psi::Psi& psi) j, npw, this->basis->npwk_max, - static_cast(get_ucell_tpiba()), + static_cast(ucell->tpiba), this->basis->template get_gcar_data(), this->basis->template get_kvec_c_data(), &psi(ibnd, 0), diff --git a/source/module_elecstate/test/elecstate_pw_test.cpp b/source/module_elecstate/test/elecstate_pw_test.cpp index bc58d610e2..5dd6585b50 100644 --- a/source/module_elecstate/test/elecstate_pw_test.cpp +++ b/source/module_elecstate/test/elecstate_pw_test.cpp @@ -15,10 +15,6 @@ double get_ucell_omega() { return 500.0; } -double get_ucell_tpiba() -{ - return 2.0; -} int tmp_xc_func_type = 1; int get_xc_func_type() { @@ -184,6 +180,7 @@ void Set_GlobalV_Default() GlobalV::KPAR = 1; GlobalV::NPROC_IN_POOL = 1; PARAM.sys.use_uspp = false; + ucell.tpiba = 2.0; } /************************************************