mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 17:20:59 -06:00
Add convergence check, local whitespace cleanup.
This commit is contained in:
parent
ec03062b51
commit
307cd6ef33
@ -189,7 +189,6 @@ namespace Opm
|
||||
const double tolerance = 1e-3;
|
||||
const int maxit = 5000;
|
||||
const int verbosity = 1;
|
||||
// Dune::BiCGSTABSolver<Vector> linsolve(opA, sp, precond, tolerance, maxit, verbosity);
|
||||
const int restart = 40;
|
||||
Dune::RestartedGMResSolver<Vector> linsolve(opA, sp, precond, tolerance, restart, maxit, verbosity);
|
||||
|
||||
@ -197,19 +196,14 @@ namespace Opm
|
||||
Dune::InverseOperatorResult result;
|
||||
linsolve.apply(x, b, result);
|
||||
|
||||
// Output results.
|
||||
LinearSolverInterface::LinearSolverReport res;
|
||||
res.converged = result.converged;
|
||||
res.iterations = result.iterations;
|
||||
res.residual_reduction = result.reduction;
|
||||
// Check for failure of linear solver.
|
||||
if (!result.converged) {
|
||||
OPM_THROW(std::runtime_error, "Convergence failure for linear solver.");
|
||||
}
|
||||
|
||||
// Copy solver output to dx.
|
||||
std::copy(x.begin(), x.end(), dx.data());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Compute full solution using the eliminated equations.
|
||||
// Recovery in inverse order of elimination.
|
||||
dx = recoverVariable(elim_eqs[1], dx, np);
|
||||
|
Loading…
Reference in New Issue
Block a user