From 28c3d9f64364b553bedc0ece80dc9e22f2f0dba3 Mon Sep 17 00:00:00 2001 From: Tianqi Zhao Date: Thu, 15 Dec 2022 16:11:42 +0800 Subject: [PATCH] refactor: re-arrange output flags for scf and nscf calculation (#1686) --- source/module_relax/relax_driver.cpp | 4 ++- source/src_io/print_info.cpp | 39 +++++++++++++++------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/source/module_relax/relax_driver.cpp b/source/module_relax/relax_driver.cpp index af1659342c..7839278560 100644 --- a/source/module_relax/relax_driver.cpp +++ b/source/module_relax/relax_driver.cpp @@ -30,7 +30,9 @@ void Relax_Driver::relax_driver(ModuleESolver::ESolver *p_esolver) { time_t estart = time(NULL); - if(GlobalV::OUT_LEVEL=="ie" && (GlobalV::CALCULATION=="relax" || GlobalV::CALCULATION=="cell-relax")) + if(GlobalV::OUT_LEVEL=="ie" && + (GlobalV::CALCULATION=="relax" || GlobalV::CALCULATION=="cell-relax" + || GlobalV::CALCULATION=="scf" || GlobalV::CALCULATION=="nscf")) { Print_Info::print_screen(stress_step, force_step, istep); } diff --git a/source/src_io/print_info.cpp b/source/src_io/print_info.cpp index 10727f0faa..248f829913 100644 --- a/source/src_io/print_info.cpp +++ b/source/src_io/print_info.cpp @@ -277,24 +277,7 @@ void Print_Info::print_screen(const int &stress_step, const int &force_step, con std::cout << " -------------------------------------------" << std::endl; GlobalV::ofs_running << "\n -------------------------------------------" << std::endl; - if(GlobalV::relax_new) - { - std::cout << " STEP OF RELAXATION : " << unsigned(istep) << std::endl; - GlobalV::ofs_running << " STEP OF RELAXATION : " << unsigned(istep) << std::endl; - } - else if(GlobalV::CALCULATION=="relax") //pengfei 2014-10-13 - { - std::cout << " STEP OF ION RELAXATION : " << unsigned(istep) << std::endl; - GlobalV::ofs_running << " STEP OF ION RELAXATION : " << unsigned(istep) << std::endl; - } - else if(GlobalV::CALCULATION=="cell-relax") - { - std::cout << " RELAX CELL : " << unsigned(stress_step) << std::endl; - std::cout << " RELAX IONS : " << unsigned(force_step) << " (in total: " << unsigned(istep) << ")" << std::endl; - GlobalV::ofs_running << " RELAX CELL : " << unsigned(stress_step) << std::endl; - GlobalV::ofs_running << " RELAX IONS : " << unsigned(force_step) << " (in total: " << unsigned(istep) << ")" << std::endl; - } - else if(GlobalV::CALCULATION=="scf") //add 4 lines 2015-09-06, xiaohui + if(GlobalV::CALCULATION=="scf") //add 4 lines 2015-09-06, xiaohui { std::cout << " SELF-CONSISTENT : " << std::endl; GlobalV::ofs_running << " SELF-CONSISTENT" << std::endl; @@ -309,6 +292,26 @@ void Print_Info::print_screen(const int &stress_step, const int &force_step, con std::cout << " STEP OF MOLECULAR DYNAMICS : " << unsigned(istep) << std::endl; GlobalV::ofs_running << " STEP OF MOLECULAR DYNAMICS : " << unsigned(istep) << std::endl; } + else + { + if(GlobalV::relax_new) + { + std::cout << " STEP OF RELAXATION : " << unsigned(istep) << std::endl; + GlobalV::ofs_running << " STEP OF RELAXATION : " << unsigned(istep) << std::endl; + } + else if(GlobalV::CALCULATION=="relax") //pengfei 2014-10-13 + { + std::cout << " STEP OF ION RELAXATION : " << unsigned(istep) << std::endl; + GlobalV::ofs_running << " STEP OF ION RELAXATION : " << unsigned(istep) << std::endl; + } + else if(GlobalV::CALCULATION=="cell-relax") + { + std::cout << " RELAX CELL : " << unsigned(stress_step) << std::endl; + std::cout << " RELAX IONS : " << unsigned(force_step) << " (in total: " << unsigned(istep) << ")" << std::endl; + GlobalV::ofs_running << " RELAX CELL : " << unsigned(stress_step) << std::endl; + GlobalV::ofs_running << " RELAX IONS : " << unsigned(force_step) << " (in total: " << unsigned(istep) << ")" << std::endl; + } + } std::cout << " -------------------------------------------" << std::endl; GlobalV::ofs_running << " -------------------------------------------" << std::endl;