32 const std::string& jobName,
33 const std::string& solverName,
34 const std::vector<std::pair<int, double>>& iterationHistory,
38 std::string msgFile = jobName +
".msg";
39 std::ofstream out(msgFile);
40 if (!out.is_open())
return false;
44 out << fmt::format(
"\n deltaFlow v{:<32s}Date {:>14s} Time {:>8s}\n",
50 out << fmt::format(
" {:>6s} {:>16s} {:>12s} {:>8s}\n",
51 "Iter",
"Max Mismatch",
"Tolerance",
"Status");
54 for (
const auto& [iter, error] : iterationHistory) {
55 std::string status = (error < tolerance) ?
"CONV" :
"";
56 out << fmt::format(
" {:>6d} {:>16.6e} {:>12.6e} {:>8s}\n",
57 iter, error, tolerance, status);
64 out <<
" " << solverName <<
" CONVERGED\n";
66 out <<
" *** WARNING: " << solverName <<
" DID NOT CONVERGE\n";
Display and formatting utilities for terminal and file output.
Writer for the iteration-history message file (.msg).
Shared helpers (hostname/timestamp, bus-type counting, loss calc) used by the OutputFile writer class...
bool write(const std::string &jobName, const std::string &solverName, const std::vector< std::pair< int, double > > &iterationHistory, double tolerance, bool converged) const
Writes the message file (.msg) with iteration history.
constexpr int pageWidth
Standard output page width.
std::string sectionHeader(const std::string &title)
Returns a section header for output files.
std::string fileBanner()
Returns a full plain-text banner for output/log files.
std::string dateStr()
Returns the current date string.
std::string timeStr()
Returns the current time string.