From 17f48c62c85f95b7e170433ebbfb5cb127962392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 25 Nov 2011 18:15:46 +0100 Subject: [PATCH] Introduce macro to control whether or not to initialise NR with prev. soln. On by default. --- src/SinglePointUpwindTwoPhase.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/SinglePointUpwindTwoPhase.hpp b/src/SinglePointUpwindTwoPhase.hpp index fcb08722..62114485 100644 --- a/src/SinglePointUpwindTwoPhase.hpp +++ b/src/SinglePointUpwindTwoPhase.hpp @@ -345,15 +345,24 @@ namespace Opm { const Grid& g , JacobianSystem& sys ) { - // Impose s=0.5 at next time level as an NR initial value. - //const ::std::vector& s = state.saturation(); + (void) state; // Suppress 'unused' warning. + +#define USE_PREVIOUS_SOLUTION 1 +#if !USE_PREVIOUS_SOLUTION + const ::std::vector& s = state.saturation(); +#endif typename JacobianSystem::vector_type& x = sys.vector().writableSolution(); assert (x.size() == (::std::size_t) (g.number_of_cells)); for (int c = 0, nc = g.number_of_cells; c < nc; ++c) { - x[c] = 0.0;//0.5 - s[2*c + 0]; +#if !USE_PREVIOUS_SOLUTION + // Impose s=0.5 at next time level as an NR initial value. + x[c] = 0.5 - s[2*c + 0]; +#else + x[c] = 0.0; +#endif } }