Skip to content

Commit

Permalink
unify the notation of unit in timer and scf stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
kirk0830 committed May 23, 2024
1 parent a8f71f8 commit c4c14d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/module_base/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void timer::print_all(std::ofstream &ofs)
assert(class_names.size() == calls.size());
assert(class_names.size() == avgs.size());
assert(class_names.size() == pers.size());
std::vector<std::string> titles = {"CLASS_NAME", "NAME", "TIME(Sec)", "CALLS", "AVG(Sec)", "PER(%)"};
std::vector<std::string> titles = {"CLASS_NAME", "NAME", "TIME/s", "CALLS", "AVG/s", "PER/%"};
std::vector<std::string> formats = {"%-10s", "%-10s", "%6.2f", "%8d", "%6.2f", "%6.2f"};
FmtTable time_statistics(titles, pers.size(), formats, {FmtTable::Align::LEFT, FmtTable::Align::CENTER});
time_statistics << class_names << names << times << calls << avgs << pers;
Expand Down
8 changes: 4 additions & 4 deletions source/module_elecstate/elecstate_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ namespace elecstate
{
case 2:
titles = {"ITER", FmtCore::center("TMAG", wmag), FmtCore::center("AMAG", wmag),
FmtCore::center("ETOT (eV)", wener), FmtCore::center("EDIFF (eV)", wener), FmtCore::center("DRHO", wrho)};
FmtCore::center("ETOT/eV", wener), FmtCore::center("EDIFF/eV", wener), FmtCore::center("DRHO", wrho)};
values = {double(istep), mag[0], mag[1], etot, ediff, drho[0]}; break;
case 4:
titles = {"ITER", FmtCore::center("TMAGX", wmag), FmtCore::center("TMAGY", wmag), FmtCore::center("TMAGZ", wmag),
FmtCore::center("AMAG", wmag), FmtCore::center("ETOT (eV)", wener), FmtCore::center("EDIFF (eV)", wener), FmtCore::center("DRHO", wrho)};
FmtCore::center("AMAG", wmag), FmtCore::center("ETOT/eV", wener), FmtCore::center("EDIFF/eV", wener), FmtCore::center("DRHO", wrho)};
values = {double(istep), mag[0], mag[1], mag[2], mag[3], etot, ediff, drho[0]}; break;
default:
titles = {"ITER", FmtCore::center("ETOT (eV)", wener), FmtCore::center("EDIFF (eV)", wener), FmtCore::center("DRHO", wrho)};
titles = {"ITER", FmtCore::center("ETOT/eV", wener), FmtCore::center("EDIFF/eV", wener), FmtCore::center("DRHO", wrho)};
values = {double(istep), etot, ediff, drho[0]}; break;
}
if(drho.size() > 1) {titles.push_back(FmtCore::center("DKIN", wrho)); values.push_back(drho[1]);}
titles.push_back(FmtCore::center("TIME (s)", wtime)); values.push_back(time);
titles.push_back(FmtCore::center("TIME/s", wtime)); values.push_back(time);
std::string buf;
if(istep == 1) { for(int i = 0; i < titles.size(); i++) {buf += FmtCore::format(th_fmt[i].c_str(), titles[i]);} }
for(int i = 0; i < values.size(); i++) {buf += FmtCore::format(td_fmt[i].c_str(), values[i]);}
Expand Down

0 comments on commit c4c14d4

Please sign in to comment.