Moved output of report struct into dedicated operator<<().

This commit is contained in:
Atgeirr Flø Rasmussen
2012-01-19 14:24:39 +01:00
parent 2f5bba3835
commit df31c95197
2 changed files with 14 additions and 5 deletions

View File

@@ -311,14 +311,12 @@ main(int argc, char** argv)
<< "\n" << std::endl;
outputState(state, pstep);
psolver.solve(grid, totmob, src, state);
tsolver.solve(*grid, tsrc, stepsize, ctrl, state, linsolve, rpt);
std::cout << "Number of linear solves: " << rpt.nit << '\n'
<< "Process converged: " << (rpt.flag > 0) << '\n'
<< "Convergence flag: " << rpt.flag << '\n'
<< "Final residual norm: " << rpt.norm_res << '\n'
<< "Final increment norm: " << rpt.norm_dx << '\n';
std::cout << rpt;
current_time += stepsize;
}

View File

@@ -64,6 +64,17 @@ namespace Opm {
double norm_res;
double norm_dx;
};
template <class Ostream>
Ostream& operator<<(Ostream& os, const NRReport& rpt)
{
os << "Number of linear solves: " << rpt.nit << '\n'
<< "Process converged: " << (rpt.flag > 0) << '\n'
<< "Convergence flag: " << rpt.flag << '\n'
<< "Final residual norm: " << rpt.norm_res << '\n'
<< "Final increment norm: " << rpt.norm_dx << '\n';
return os;
}
}
template <class Model ,