diff --git a/source/module_hamilt_general/module_xc/test/test_xc1.cpp b/source/module_hamilt_general/module_xc/test/test_xc1.cpp index c1413818b8..ebe1b98261 100644 --- a/source/module_hamilt_general/module_xc/test/test_xc1.cpp +++ b/source/module_hamilt_general/module_xc/test/test_xc1.cpp @@ -18,7 +18,7 @@ namespace ModuleBase namespace GlobalV { std::string BASIS_TYPE = ""; - bool CAL_STRESS = 0; + bool CAL_STRESS = false; int CAL_FORCE = 0; int NSPIN = 1; } diff --git a/source/module_hamilt_general/module_xc/test/xc3_mock.h b/source/module_hamilt_general/module_xc/test/xc3_mock.h index 8f1f08edda..636c5a7590 100644 --- a/source/module_hamilt_general/module_xc/test/xc3_mock.h +++ b/source/module_hamilt_general/module_xc/test/xc3_mock.h @@ -164,7 +164,7 @@ namespace ModuleBase namespace GlobalV { std::string BASIS_TYPE = ""; - bool CAL_STRESS = 0; + bool CAL_STRESS = false; int CAL_FORCE = 0; int NSPIN; int NPOL; diff --git a/source/module_hamilt_general/module_xc/xc_functional.h b/source/module_hamilt_general/module_xc/xc_functional.h index ceb9abfa07..800b8c3f44 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.h +++ b/source/module_hamilt_general/module_xc/xc_functional.h @@ -212,7 +212,7 @@ class XC_Functional ModulePW::PW_Basis* rhopw, const UnitCell* ucell, std::vector& stress_gga, - const bool is_stress = 0); + const bool is_stress = false); template ::type> static void grad_wfc( diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp index 6af9392c88..cb7c450ae6 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp @@ -34,7 +34,8 @@ namespace hamilt } } } - if (need_allocate) hR->allocate(nullptr, true); + if (need_allocate) { hR->allocate(nullptr, true); +} } /// allocate according to BvK cells, used in scf template @@ -64,7 +65,8 @@ namespace hamilt } } } - if (need_allocate) hR->allocate(nullptr, true); + if (need_allocate) { hR->allocate(nullptr, true); +} } template @@ -148,7 +150,8 @@ OperatorEXX>::OperatorEXX(HS_Matrix_K* hsk_in, this->restart = GlobalC::restart.load_disk( "Hexx", ik, pv->get_local_size(), this->Hexxd_k_load[ik].data(), false); - if (!this->restart) break; + if (!this->restart) { break; +} } } else @@ -160,7 +163,8 @@ OperatorEXX>::OperatorEXX(HS_Matrix_K* hsk_in, this->restart = GlobalC::restart.load_disk( "Hexx", ik, pv->get_local_size(), this->Hexxc_k_load[ik].data(), false); - if (!this->restart) break; + if (!this->restart) { break; +} } } } @@ -176,9 +180,10 @@ OperatorEXX>::OperatorEXX(HS_Matrix_K* hsk_in, } } - if (!this->restart) + if (!this->restart) { std::cout << "WARNING: Hexx not found, restart from the non-exx loop." << std::endl << "If the loaded charge density is EXX-solved, this may lead to poor convergence." << std::endl; +} GlobalC::restart.info_load.load_H_finish = this->restart; } } @@ -189,11 +194,12 @@ void OperatorEXX>::contributeHR() { ModuleBase::TITLE("OperatorEXX", "contributeHR"); // Peize Lin add 2016-12-03 - if (GlobalV::CALCULATION != "nscf" && this->two_level_step != nullptr && *this->two_level_step == 0 && !this->restart) return; //in the non-exx loop, do nothing + if (GlobalV::CALCULATION != "nscf" && this->two_level_step != nullptr && *this->two_level_step == 0 && !this->restart) { return; //in the non-exx loop, do nothing +} if (XC_Functional::get_func_type() == 4 || XC_Functional::get_func_type() == 5) { // add H(R) normally - if (PARAM.exx_info.info_ri.real_number) + if (PARAM.exx_info.info_ri.real_number) { RI_2D_Comm::add_HexxR( this->current_spin, PARAM.exx_info.info_global.hybrid_alpha, @@ -202,7 +208,7 @@ void OperatorEXX>::contributeHR() GlobalV::NPOL, *this->hR, this->use_cell_nearest ? &this->cell_nearest : nullptr); - else + } else { RI_2D_Comm::add_HexxR( this->current_spin, PARAM.exx_info.info_global.hybrid_alpha, @@ -211,8 +217,10 @@ void OperatorEXX>::contributeHR() GlobalV::NPOL, *this->hR, this->use_cell_nearest ? &this->cell_nearest : nullptr); +} } - if (GlobalV::NSPIN == 2) this->current_spin = 1 - this->current_spin; + if (GlobalV::NSPIN == 2) { this->current_spin = 1 - this->current_spin; +} } template @@ -220,7 +228,8 @@ void OperatorEXX>::contributeHk(int ik) { ModuleBase::TITLE("OperatorEXX", "constributeHR"); // Peize Lin add 2016-12-03 - if (GlobalV::CALCULATION != "nscf" && this->two_level_step != nullptr && *this->two_level_step == 0 && !this->restart) return; //in the non-exx loop, do nothing + if (GlobalV::CALCULATION != "nscf" && this->two_level_step != nullptr && *this->two_level_step == 0 && !this->restart) { return; //in the non-exx loop, do nothing +} if (XC_Functional::get_func_type() == 4 || XC_Functional::get_func_type() == 5) { if (this->restart && this->two_level_step != nullptr) @@ -246,7 +255,7 @@ void OperatorEXX>::contributeHk(int ik) } // cal H(k) from H(R) normally - if (PARAM.exx_info.info_ri.real_number) + if (PARAM.exx_info.info_ri.real_number) { RI_2D_Comm::add_Hexx( this->kv, ik, @@ -254,7 +263,7 @@ void OperatorEXX>::contributeHk(int ik) *this->Hexxd, *this->hR->get_paraV(), this->hsk->get_hk()); - else + } else { RI_2D_Comm::add_Hexx( this->kv, ik, @@ -262,6 +271,7 @@ void OperatorEXX>::contributeHk(int ik) *this->Hexxc, *this->hR->get_paraV(), this->hsk->get_hk()); +} } } 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 f6e4729f20..e9ab6e1d38 100644 --- a/source/module_io/test_serial/read_input_item_test.cpp +++ b/source/module_io/test_serial/read_input_item_test.cpp @@ -1191,7 +1191,7 @@ TEST_F(InputTest, Item_test) output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - param.input.exx_separate_loop = 0; + param.input.exx_separate_loop = false; param.input.exx_hybrid_step = 2; it->second.reset_value(it->second, param); EXPECT_EQ(param.input.exx_hybrid_step, 1);