From e961dce97d9e4ef825573f7915a69da7d1d5de93 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Sep 2021 13:15:14 +0200 Subject: [PATCH] #7944 Cell selection: Avoid crash for Pflotran simulation case --- .../ReservoirDataModel/RigFlowDiagSolverInterface.cpp | 10 +++++----- ThirdParty/Ert/lib/ecl/ecl_grid.cpp | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 85b20e8eda..e3ebbb1781 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -121,13 +121,13 @@ public: { Opm::ECLInitFileData initData( init ); - m_eclGraph.reset( new Opm::ECLGraph( Opm::ECLGraph::load( mainGrid, initData ) ) ); - - m_hasUnifiedRestartFile = false; - m_poreVolume = m_eclGraph->poreVolume(); - try { + m_eclGraph.reset( new Opm::ECLGraph( Opm::ECLGraph::load( mainGrid, initData ) ) ); + + m_hasUnifiedRestartFile = false; + m_poreVolume = m_eclGraph->poreVolume(); + m_eclSaturationFunc.reset( new Opm::ECLSaturationFunc( *m_eclGraph, initData ) ); } catch ( ... ) diff --git a/ThirdParty/Ert/lib/ecl/ecl_grid.cpp b/ThirdParty/Ert/lib/ecl/ecl_grid.cpp index 6c5140dc12..5877f15a71 100644 --- a/ThirdParty/Ert/lib/ecl/ecl_grid.cpp +++ b/ThirdParty/Ert/lib/ecl/ecl_grid.cpp @@ -6369,8 +6369,7 @@ static bool ecl_grid_init_coord_section__( const ecl_grid_type * grid , int i, i const int top_index = ecl_grid_get_top_valid_index( grid , i , j ); const int bottom_index = ecl_grid_get_bottom_valid_index( grid , i , j ); - if (top_index == -1) - util_exit("% : no cell with a valid geometry description found in (i,j) = %d,%d - then what? \n",__func__ , i,j); + if (top_index == -1) return false; { point_type top_point;