create_fort_files now also creates a cautions report for non-convergence

This commit is contained in:
caes 2016-06-14 21:16:44 -04:00
parent 7f4bc149e3
commit 6b4849f75c
2 changed files with 49 additions and 13 deletions

View File

@ -43,10 +43,46 @@ int main(int argc, char const *argv[]) {
fortfilenum++;
}
int num_unconverged = 0;
agn::cloudy_grid::iterator result_it = grid.begin();
std::ofstream cautionreportfile;
cautionreportfile.open("cautions");
cautionreportfile
<< "The following solutions probably did not converge."
<< std::endl << std::endl;
while(result_it != grid.end()) {
if (result_it->second.iterations >= 40) {
num_unconverged++;
cautionreportfile
<< "hden = "
<< std::fixed
<< std::setprecision(3)
<< result_it->second.hden
<< ", phi = "
<< result_it->second.phi
<< std::endl
<< "───────────────────────────"
<< std::endl;
std::list<std::string>::iterator caution_it = result_it->second.cautions.begin();
while(caution_it != result_it->second.cautions.end()) {
cautionreportfile
<< *caution_it
<< std::endl;
caution_it++;
}
cautionreportfile << std::endl << std::endl;
}
result_it++;
}
std::cout
<< "Saved cautions for "
<< num_unconverged
<< " unconverged solutions."
<< std::endl;
cautionreportfile.close();
std::cout << "Done.\n";
return 0;
}