Use const where appropriate and polish code formatting.

This commit is contained in:
Markus Blatt 2015-01-30 15:26:55 +01:00
parent 9d2d942396
commit 60c0f30388

View File

@ -1903,7 +1903,9 @@ namespace {
B_avg[idx] = B.col(idx).sum()/nc;
maxCoeff[idx]=tempV.col(idx).maxCoeff();
R_sum[idx] = R.col(idx).sum();
}else{
}
else
{
R_sum[idx] = B_avg[idx] = maxCoeff[idx] =0.;
}
}
@ -1959,10 +1961,10 @@ namespace {
converged_CNV = converged_CNV && (CNV[idx] < tol_cnv);
}
double residualWellFlux = infinityNorm(residual_.well_flux_eq);
double residualWell = infinityNorm(residual_.well_eq);
bool converged_Well = (residualWellFlux < 1./Opm::unit::day) && (residualWell < Opm::unit::barsa);
bool converged = converged_MB && converged_CNV && converged_Well;
const double residualWellFlux = infinityNorm(residual_.well_flux_eq);
const double residualWell = infinityNorm(residual_.well_eq);
const bool converged_Well = (residualWellFlux < 1./Opm::unit::day) && (residualWell < Opm::unit::barsa);
const bool converged = converged_MB && converged_CNV && converged_Well;
// if one of the residuals is NaN, throw exception, so that the solver can be restarted
if( std::isnan(mass_balance_residual[Water]) || mass_balance_residual[Water] > maxResidualAllowed() ||