Skip to content

Commit

Permalink
refactor: re-arrange output flags for scf and nscf calculation (#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongriTianqi authored Dec 15, 2022
1 parent 4c0b28c commit 28c3d9f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
4 changes: 3 additions & 1 deletion source/module_relax/relax_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
39 changes: 21 additions & 18 deletions source/src_io/print_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 28c3d9f

Please sign in to comment.