Skip to content

Commit

Permalink
Support ensemble cross plot curves
Browse files Browse the repository at this point in the history
* Remove use of RifEnsembleStatisticsReader
* Add RimSummaryAddressSelector and RimEnsembleCrossPlotStatisticsCase
* Remove RifEnsembleStatisticsReader
* Add support for cross plot x-axis selection
* Support source stepping on ensemble cross plot curves
* Add isXAxisSummaryVector
  • Loading branch information
magnesj authored Sep 25, 2023
1 parent 55687c4 commit fb288f6
Show file tree
Hide file tree
Showing 21 changed files with 1,205 additions and 338 deletions.
12 changes: 6 additions & 6 deletions ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* summaryCase,
const RifEclipseSummaryAddress& summaryAddress,
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* summaryCaseY,
const RifEclipseSummaryAddress& summaryAddressY,
bool isEnsembleCurve )
: m_summaryCaseY( summaryCase )
, m_summaryAddressY( summaryAddress )
: m_summaryCaseY( summaryCaseY )
, m_summaryAddressY( summaryAddressY )
, m_summaryCaseX( nullptr )
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
, m_ensemble( nullptr )
Expand All @@ -56,9 +56,9 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress )
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddressY )
: m_summaryCaseY( nullptr )
, m_summaryAddressY( summaryAddress )
, m_summaryAddressY( summaryAddressY )
, m_summaryCaseX( nullptr )
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
, m_ensemble( ensemble )
Expand Down
4 changes: 2 additions & 2 deletions ApplicationLibCode/Application/RiaSummaryCurveDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class RiaSummaryCurveDefinition
{
public:
RiaSummaryCurveDefinition();
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve );
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress );
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCaseY, const RifEclipseSummaryAddress& summaryAddressY, bool isEnsembleCurve );
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddressY );

// Y Axis
RimSummaryCase* summaryCaseY() const;
Expand Down
2 changes: 0 additions & 2 deletions ApplicationLibCode/FileInterface/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RifSummaryCaseRestartSelector.h
${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader.h
${CMAKE_CURRENT_LIST_DIR}/RifFileParseTools.h
${CMAKE_CURRENT_LIST_DIR}/RifEnsembleStatisticsReader.h
${CMAKE_CURRENT_LIST_DIR}/RifReaderEnsembleStatisticsRft.h
${CMAKE_CURRENT_LIST_DIR}/RifDerivedEnsembleReader.h
${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader.h
Expand Down Expand Up @@ -136,7 +135,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RifSummaryCaseRestartSelector.cpp
${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader.cpp
${CMAKE_CURRENT_LIST_DIR}/RifFileParseTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RifEnsembleStatisticsReader.cpp
${CMAKE_CURRENT_LIST_DIR}/RifDerivedEnsembleReader.cpp
${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader.cpp
${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.cpp
Expand Down
116 changes: 0 additions & 116 deletions ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp

This file was deleted.

78 changes: 21 additions & 57 deletions ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,16 @@ void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField*
bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue,
const QVariant& newValue,
RifEclipseSummaryAddressDefines::SummaryCategory category,
RifEclipseSummaryAddress* adr )
RifEclipseSummaryAddress& adr )
{
if ( !adr ) return false;

if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION )
{
int oldInt = oldValue.toInt();
int newInt = newValue.toInt();

if ( adr->regionNumber() == oldInt )
if ( adr.regionNumber() == oldInt )
{
adr->setRegion( newInt );
adr.setRegion( newInt );

return true;
}
Expand All @@ -98,9 +96,9 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
int oldInt = oldValue.toInt();
int newInt = newValue.toInt();

if ( adr->aquiferNumber() == oldInt )
if ( adr.aquiferNumber() == oldInt )
{
adr->setAquiferNumber( newInt );
adr.setAquiferNumber( newInt );

return true;
}
Expand All @@ -110,9 +108,9 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();

if ( adr->groupName() == oldString )
if ( adr.groupName() == oldString )
{
adr->setGroupName( newString );
adr.setGroupName( newString );

return true;
}
Expand All @@ -122,9 +120,9 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();

if ( adr->networkName() == oldString )
if ( adr.networkName() == oldString )
{
adr->setNetworkName( newString );
adr.setNetworkName( newString );

return true;
}
Expand All @@ -134,9 +132,9 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();

if ( adr->wellName() == oldString )
if ( adr.wellName() == oldString )
{
adr->setWellName( newString );
adr.setWellName( newString );

return true;
}
Expand All @@ -146,9 +144,9 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
{
std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();
if ( adr->blockAsString() == oldString )
if ( adr.blockAsString() == oldString )
{
adr->setCellIjk( newString );
adr.setCellIjk( newString );

return true;
}
Expand All @@ -157,11 +155,11 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
{
std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();
if ( adr->formatUiTextRegionToRegion() == oldString )
if ( adr.formatUiTextRegionToRegion() == oldString )
{
auto [region1, region2] = RifEclipseSummaryAddress::regionToRegionPairFromUiText( newString );
adr->setRegion( region1 );
adr->setRegion2( region2 );
adr.setRegion( region1 );
adr.setRegion2( region2 );

return true;
}
Expand All @@ -170,9 +168,9 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
{
int oldInt = oldValue.toInt();
int newInt = newValue.toInt();
if ( adr->wellSegmentNumber() == oldInt )
if ( adr.wellSegmentNumber() == oldInt )
{
adr->setWellSegmentNumber( newInt );
adr.setWellSegmentNumber( newInt );

return true;
}
Expand All @@ -184,48 +182,14 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
const QVariant& newValue,
RifEclipseSummaryAddress* adr )
{
if ( !adr ) return false;

std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();

if ( adr->vectorName() == oldString )
{
adr->setVectorName( newString );

return true;
}

std::string correspondingOldString = RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( oldString );
std::string correspondingNewString = RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( newString );

if ( adr->vectorName() == correspondingOldString )
{
adr->setVectorName( correspondingNewString );

return true;
}

return false;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDataSourceSteppingTools::updateQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr )
bool RimDataSourceSteppingTools::updateQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress& adr )
{
if ( !adr ) return false;

std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();

if ( adr->vectorName() == oldString )
if ( adr.vectorName() == oldString )
{
adr->setVectorName( newString );
adr.setVectorName( newString );

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ class RimDataSourceSteppingTools
static bool updateAddressIfMatching( const QVariant& oldValue,
const QVariant& newValue,
RifEclipseSummaryAddressDefines::SummaryCategory category,
RifEclipseSummaryAddress* adr );
RifEclipseSummaryAddress& adr );

static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr );

static bool updateQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr );
static bool updateQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress& adr );
};
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void RimSummaryCalculation::substituteVariables( std::vector<SummaryCalculationV
{
if ( v.summaryAddress.category() == address.category() )
{
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, address.category(), &v.summaryAddress );
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, address.category(), v.summaryAddress );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimSummaryTableTools.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryDeclineCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryRegressionAnalysisCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddressSelector.h
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCrossPlotStatisticsCase.h
)

set(SOURCE_GROUP_SOURCE_FILES
Expand Down Expand Up @@ -108,6 +110,8 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimSummaryTableTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryDeclineCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryRegressionAnalysisCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddressSelector.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCrossPlotStatisticsCase.cpp
)

list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
Expand Down
Loading

0 comments on commit fb288f6

Please sign in to comment.