#7942 Summary Plot: Make reading of summary data file more robust

- remove the gsl::not_null for pointer to curve data
- For summary cases linked to a grid model case, do not try to read the original location of file if grid file location is not valid (will happen when a project file is moved)
This commit is contained in:
Magne Sjaastad 2021-09-02 15:09:50 +02:00
parent e961dce97d
commit 640c59d682
4 changed files with 13 additions and 8 deletions

View File

@ -37,7 +37,7 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( gsl::not_null<RimSummaryCase*> summaryCase,
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* summaryCase,
const RifEclipseSummaryAddress& summaryAddress,
bool isEnsembleCurve )
: m_summaryCase( summaryCase )
@ -55,8 +55,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( gsl::not_null<RimSummaryCa
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( gsl::not_null<RimSummaryCaseCollection*> ensemble,
const RifEclipseSummaryAddress& summaryAddress )
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble,
const RifEclipseSummaryAddress& summaryAddress )
: m_summaryCase( nullptr )
, m_summaryAddress( summaryAddress )
, m_ensemble( ensemble )

View File

@ -37,11 +37,10 @@ class RiaSummaryCurveDefinition
{
public:
RiaSummaryCurveDefinition();
explicit RiaSummaryCurveDefinition( gsl::not_null<RimSummaryCase*> summaryCase,
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase,
const RifEclipseSummaryAddress& summaryAddress,
bool isEnsembleCurve );
explicit RiaSummaryCurveDefinition( gsl::not_null<RimSummaryCaseCollection*> ensemble,
const RifEclipseSummaryAddress& summaryAddress );
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress );
RimSummaryCase* summaryCase() const;
const RifEclipseSummaryAddress& summaryAddress() const;

View File

@ -145,9 +145,13 @@ RimEclipseCase* RimGridSummaryCase::associatedEclipseCase()
//--------------------------------------------------------------------------------------------------
QString RimGridSummaryCase::summaryHeaderFilename() const
{
if ( !m_eclipseCase() ) return m_summaryHeaderFilename().path();
if ( m_eclipseCase() )
{
auto candidate = summaryHeaderFilenameFromEclipseCase( m_eclipseCase );
if ( QFileInfo::exists( candidate ) ) return candidate;
}
return summaryHeaderFilenameFromEclipseCase( m_eclipseCase() );
return m_summaryHeaderFilename().path();
}
//--------------------------------------------------------------------------------------------------

View File

@ -6369,6 +6369,8 @@ 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 );
// util_exit("% : no cell with a valid geometry description found in (i,j) = %d,%d - then what? \n",__func__ , i,j);
// https://github.com/OPM/ResInsight/issues/7944
if (top_index == -1) return false;
{