2017-10-03 01:19:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
2017-10-03 01:19:38 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
2017-10-03 01:19:38 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-10-03 01:19:38 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-11-13 04:10:27 -06:00
|
|
|
#include "RifDataSourceForRftPlt.h"
|
2022-02-23 06:57:02 -06:00
|
|
|
|
2023-01-30 04:12:26 -06:00
|
|
|
#include "RigEclipseCaseData.h"
|
2022-02-23 06:57:02 -06:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2022-02-23 06:57:02 -06:00
|
|
|
#include "RimEclipseResultCase.h"
|
2019-08-20 08:09:13 -05:00
|
|
|
#include "RimObservedFmuRftData.h"
|
2023-01-13 08:26:39 -06:00
|
|
|
#include "RimPressureDepthData.h"
|
2019-07-25 00:38:46 -05:00
|
|
|
#include "RimSummaryCase.h"
|
2024-07-29 08:38:17 -05:00
|
|
|
#include "RimSummaryEnsemble.h"
|
2023-10-02 05:39:44 -05:00
|
|
|
#include "RimWellLogLasFile.h"
|
2017-10-19 09:12:22 -05:00
|
|
|
|
2017-10-03 01:19:38 -05:00
|
|
|
#include "cafAppEnum.h"
|
2017-10-19 09:12:22 -05:00
|
|
|
#include "cvfAssert.h"
|
2022-02-23 06:57:02 -06:00
|
|
|
|
2017-10-03 01:19:38 -05:00
|
|
|
#include <QString>
|
|
|
|
#include <QTextStream>
|
|
|
|
|
2023-01-30 04:12:26 -06:00
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
template <>
|
|
|
|
void caf::AppEnum<RifDataSourceForRftPlt::SourceType>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::NONE, "NONE", "None" );
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::OBSERVED_LAS_FILE, "OBSERVED", "Observed Data" );
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::RFT_SIM_WELL_DATA, "RFT", "RFT Data" );
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::GRID_MODEL_CELL_DATA, "GRID", "Grid Cases" );
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::SUMMARY_RFT, "SUMMARY_RFT", "Summary Data" );
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::ENSEMBLE_RFT, "ENSEMBLE", "Ensembles with RFT Data" );
|
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::OBSERVED_FMU_RFT, "OBSERVED_FMU", "Observed FMU Data" );
|
2023-02-26 03:48:40 -06:00
|
|
|
addItem( RifDataSourceForRftPlt::SourceType::OBSERVED_PRESSURE_DEPTH, "OBSERVED_PRESSURE_DEPTH", "Observed Pressure/Depth Data" );
|
2023-01-30 04:12:26 -06:00
|
|
|
setDefault( RifDataSourceForRftPlt::SourceType::NONE );
|
|
|
|
}
|
|
|
|
} // namespace caf
|
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt()
|
2019-09-06 03:40:57 -05:00
|
|
|
: m_sourceType( SourceType::NONE )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt( SourceType sourceType, RimEclipseCase* eclCase )
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
CVF_ASSERT( sourceType == SourceType::RFT_SIM_WELL_DATA || sourceType == SourceType::GRID_MODEL_CELL_DATA );
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( eclCase != nullptr );
|
2017-10-19 09:12:22 -05:00
|
|
|
|
|
|
|
m_sourceType = sourceType;
|
2019-07-25 00:38:46 -05:00
|
|
|
m_eclCase = eclCase;
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-10-02 05:39:44 -05:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt( RimWellLogLasFile* wellLogFile )
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
m_sourceType = SourceType::OBSERVED_LAS_FILE;
|
2017-10-19 09:12:22 -05:00
|
|
|
m_wellLogFile = wellLogFile;
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2024-07-29 08:38:17 -05:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt( RimSummaryEnsemble* ensemble )
|
2019-07-25 00:38:46 -05:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
m_sourceType = SourceType::ENSEMBLE_RFT;
|
2019-07-25 00:38:46 -05:00
|
|
|
m_ensemble = ensemble;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2024-07-29 08:38:17 -05:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt( RimSummaryCase* summaryCase, RimSummaryEnsemble* ensemble, RimEclipseCase* eclipseCase )
|
2019-07-25 00:38:46 -05:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
m_sourceType = SourceType::SUMMARY_RFT;
|
2019-07-25 00:38:46 -05:00
|
|
|
m_summaryCase = summaryCase;
|
|
|
|
m_ensemble = ensemble;
|
2023-08-15 06:37:23 -05:00
|
|
|
m_eclCase = eclipseCase;
|
2019-07-25 00:38:46 -05:00
|
|
|
}
|
|
|
|
|
2019-08-20 08:09:13 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-01-30 04:12:26 -06:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt( RimObservedFmuRftData* observedFmuRftData )
|
2019-08-20 08:09:13 -05:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
m_sourceType = SourceType::OBSERVED_FMU_RFT;
|
2019-08-20 08:09:13 -05:00
|
|
|
m_observedFmuRftData = observedFmuRftData;
|
|
|
|
}
|
|
|
|
|
2023-01-13 08:26:39 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-01-30 04:12:26 -06:00
|
|
|
RifDataSourceForRftPlt::RifDataSourceForRftPlt( RimPressureDepthData* observedFmuRftData )
|
2023-01-13 08:26:39 -06:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
m_sourceType = SourceType::OBSERVED_FMU_RFT;
|
2023-01-13 08:26:39 -06:00
|
|
|
m_pressureDepthData = observedFmuRftData;
|
|
|
|
}
|
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-13 04:10:27 -06:00
|
|
|
RifDataSourceForRftPlt::SourceType RifDataSourceForRftPlt::sourceType() const
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
|
|
|
return m_sourceType;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-13 04:10:27 -06:00
|
|
|
RimEclipseCase* RifDataSourceForRftPlt::eclCase() const
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
return m_eclCase;
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
|
2023-01-30 04:12:26 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RiaDefines::EclipseUnitSystem> RifDataSourceForRftPlt::availableUnitSystems() const
|
|
|
|
{
|
|
|
|
std::vector<RiaDefines::EclipseUnitSystem> systems;
|
|
|
|
|
|
|
|
if ( m_eclCase && m_eclCase->eclipseCaseData() )
|
|
|
|
{
|
|
|
|
systems.push_back( m_eclCase->eclipseCaseData()->unitsType() );
|
|
|
|
}
|
|
|
|
|
2024-05-27 07:48:28 -05:00
|
|
|
if ( m_wellLogFile && m_wellLogFile->wellLogData() )
|
2023-01-30 04:12:26 -06:00
|
|
|
{
|
2024-05-27 07:48:28 -05:00
|
|
|
auto eclipseUnit = RiaDefines::fromDepthUnit( m_wellLogFile->wellLogData()->depthUnit() );
|
2023-01-30 04:12:26 -06:00
|
|
|
systems.push_back( eclipseUnit );
|
|
|
|
}
|
|
|
|
|
|
|
|
return systems;
|
|
|
|
}
|
2023-03-13 08:34:16 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
auto RifDataSourceForRftPlt::operator<=>( const RifDataSourceForRftPlt& addr2 ) const -> std::strong_ordering
|
|
|
|
{
|
|
|
|
if ( m_sourceType != addr2.m_sourceType )
|
|
|
|
{
|
|
|
|
return m_sourceType <=> addr2.m_sourceType;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( m_sourceType == RifDataSourceForRftPlt::SourceType::NONE ) return std::strong_ordering::less;
|
|
|
|
|
|
|
|
if ( m_sourceType == RifDataSourceForRftPlt::SourceType::OBSERVED_LAS_FILE )
|
|
|
|
{
|
|
|
|
if ( wellLogFile() && addr2.wellLogFile() )
|
|
|
|
{
|
|
|
|
return wellLogFile()->fileName().toStdString() <=> addr2.wellLogFile()->fileName().toStdString();
|
|
|
|
}
|
|
|
|
return wellLogFile() <=> addr2.wellLogFile();
|
|
|
|
}
|
|
|
|
else if ( m_sourceType == RifDataSourceForRftPlt::SourceType::SUMMARY_RFT )
|
|
|
|
{
|
|
|
|
if ( summaryCase() && addr2.summaryCase() )
|
|
|
|
{
|
|
|
|
if ( summaryCase()->displayCaseName() == addr2.summaryCase()->displayCaseName() )
|
|
|
|
{
|
|
|
|
if ( ensemble() && addr2.ensemble() )
|
|
|
|
{
|
|
|
|
return ensemble()->name().toStdString() <=> addr2.ensemble()->name().toStdString();
|
|
|
|
}
|
|
|
|
return ensemble() <=> addr2.ensemble();
|
|
|
|
}
|
|
|
|
return summaryCase()->displayCaseName().toStdString() <=> addr2.summaryCase()->displayCaseName().toStdString();
|
|
|
|
}
|
|
|
|
return summaryCase() <=> addr2.summaryCase();
|
|
|
|
}
|
|
|
|
else if ( m_sourceType == RifDataSourceForRftPlt::SourceType::ENSEMBLE_RFT )
|
|
|
|
{
|
|
|
|
if ( ensemble() && addr2.ensemble() )
|
|
|
|
{
|
|
|
|
return ensemble()->name().toStdString() <=> addr2.ensemble()->name().toStdString();
|
|
|
|
}
|
|
|
|
return ensemble() <=> addr2.ensemble();
|
|
|
|
}
|
|
|
|
else if ( m_sourceType == RifDataSourceForRftPlt::SourceType::OBSERVED_FMU_RFT )
|
|
|
|
{
|
|
|
|
if ( observedFmuRftData() || addr2.observedFmuRftData() )
|
|
|
|
{
|
|
|
|
if ( observedFmuRftData() && addr2.observedFmuRftData() )
|
|
|
|
{
|
|
|
|
return observedFmuRftData()->name().toStdString() <=> addr2.observedFmuRftData()->name().toStdString();
|
|
|
|
}
|
|
|
|
return observedFmuRftData() <=> addr2.observedFmuRftData();
|
|
|
|
}
|
|
|
|
if ( pressureDepthData() || addr2.pressureDepthData() )
|
|
|
|
{
|
|
|
|
if ( pressureDepthData() && addr2.pressureDepthData() )
|
|
|
|
{
|
|
|
|
return pressureDepthData()->name().toStdString() <=> addr2.pressureDepthData()->name().toStdString();
|
|
|
|
}
|
|
|
|
return pressureDepthData() <=> addr2.pressureDepthData();
|
|
|
|
}
|
|
|
|
return std::strong_ordering::less;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( eclCase() && addr2.eclCase() )
|
|
|
|
{
|
|
|
|
return eclCase()->caseId() <=> addr2.eclCase()->caseId();
|
|
|
|
}
|
|
|
|
return eclCase() <=> addr2.eclCase();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-13 08:12:46 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2024-07-29 08:38:17 -05:00
|
|
|
RimSummaryEnsemble* RifDataSourceForRftPlt::ensemble() const
|
2019-07-25 00:38:46 -05:00
|
|
|
{
|
|
|
|
return m_ensemble;
|
2017-11-13 08:12:46 -06:00
|
|
|
}
|
|
|
|
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryCase* RifDataSourceForRftPlt::summaryCase() const
|
|
|
|
{
|
|
|
|
return m_summaryCase;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-10-02 05:39:44 -05:00
|
|
|
RimWellLogLasFile* RifDataSourceForRftPlt::wellLogFile() const
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
return m_wellLogFile;
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
|
2019-08-20 08:09:13 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimObservedFmuRftData* RifDataSourceForRftPlt::observedFmuRftData() const
|
|
|
|
{
|
|
|
|
return m_observedFmuRftData;
|
|
|
|
}
|
|
|
|
|
2023-01-13 08:26:39 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimPressureDepthData* RifDataSourceForRftPlt::pressureDepthData() const
|
|
|
|
{
|
|
|
|
return m_pressureDepthData;
|
|
|
|
}
|
|
|
|
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QString RifDataSourceForRftPlt::sourceTypeUiText( SourceType sourceType )
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
switch ( sourceType )
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2023-01-30 04:12:26 -06:00
|
|
|
case SourceType::RFT_SIM_WELL_DATA:
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "RFT File Cases" );
|
2023-01-30 04:12:26 -06:00
|
|
|
case SourceType::GRID_MODEL_CELL_DATA:
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "Grid Cases" );
|
2023-01-30 04:12:26 -06:00
|
|
|
case SourceType::OBSERVED_LAS_FILE:
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "Observed Data" );
|
2019-07-25 00:38:46 -05:00
|
|
|
case SourceType::ENSEMBLE_RFT:
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "Ensembles with RFT Data" );
|
2019-07-25 00:38:46 -05:00
|
|
|
case SourceType::SUMMARY_RFT:
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "Summary case with RFT Data" );
|
2019-08-20 08:09:13 -05:00
|
|
|
case SourceType::OBSERVED_FMU_RFT:
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString( "Observed FMU data" );
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QTextStream& operator<<( QTextStream& str, const RifDataSourceForRftPlt& addr )
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
// Not implemented
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( false );
|
2017-10-03 01:19:38 -05:00
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QTextStream& operator>>( QTextStream& str, RifDataSourceForRftPlt& source )
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
// Not implemented
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( false );
|
2017-10-03 01:19:38 -05:00
|
|
|
return str;
|
|
|
|
}
|