From 794673d7b4306408e30dc1a129ebf1c1a5bd692a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 25 Sep 2013 15:11:14 +0200 Subject: [PATCH] Fix null-pointer dereference during well construction The three-argument WellsManager constructor needs access to the real permeability field lest a null-pointer dereference result when the problem actually contains any wells. --- examples/wells_example.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/wells_example.cpp b/examples/wells_example.cpp index 2a252338..6af03a78 100644 --- a/examples/wells_example.cpp +++ b/examples/wells_example.cpp @@ -36,14 +36,14 @@ try // Setup grid GridManager grid(parser); - // Finally handle the wells - WellsManager wells(parser, *grid.c_grid(), NULL); - - double gravity[3] = {0.0, 0.0, parameters.getDefault("gravity", 0.0)}; + // Define rock and fluid properties IncompPropertiesFromDeck incomp_properties(parser, *grid.c_grid()); - RockCompressibility rock_comp(parser); + // Finally handle the wells + WellsManager wells(parser, *grid.c_grid(), incomp_properties.permeability()); + + double gravity[3] = {0.0, 0.0, parameters.getDefault("gravity", 0.0)}; Opm::LinearSolverFactory linsolver(parameters); double nl_pressure_residual_tolerance = 1e-8; double nl_pressure_change_tolerance = 0.0;