mirror of
https://asciireactor.com/otho/cloudy-agn.git
synced 2025-04-18 13:35:43 +00:00
create_fort_files now also creates a cautions report for non-convergence
This commit is contained in:
parent
7f4bc149e3
commit
6b4849f75c
@ -43,10 +43,46 @@ int main(int argc, char const *argv[]) {
|
|||||||
fortfilenum++;
|
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";
|
std::cout << "Done.\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user