Finish the first stablizeNewton().

This commit is contained in:
Kai Bao
2014-05-19 18:41:38 +02:00
parent ab8636b57d
commit 5b6c325a32
2 changed files with 25 additions and 3 deletions

View File

@@ -1708,10 +1708,27 @@ namespace {
template<class T>
void
FullyImplicitBlackoilSolver<T>::stablizeNewton( V &dx, const bool &oscillate, const bool &stagnate,
const int omega ) const {
const V dxold = dx;
const double omega, const RelaxType relax_type) const {
switch (relax_type) {
case DAMPEN:
if (omega == 1.) {
return;
}
dx = dx*omega;
return;
case SOR:
if (omega == 1.) {
return;
}
const V dxold = dx;
dx = dx*omega + (1.-omega)*dxold;
return;
default:
OPM_THROW(std::runtime_error, "Can only handle DAMPEN and SOR relaxation type.");
}
return;
}
template<class T>