#8103 Ensemble Well Logs: Index_K not available as property for geogrid

Made "Index K" available for grdecl, fixed crash, and disabled the depth
equalization when "Index K" is missing in the las files.

Fixes #8103.
This commit is contained in:
Kristian Bendiksen 2021-10-14 19:25:25 +02:00
parent db45b47121
commit 6069a771ea
5 changed files with 40 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#include "RiaOptionItemFactory.h"
#include "RiaPreferences.h"
#include "RiaResultNames.h"
#include "RigWellLogCurveData.h"
#include "RigWellPath.h"
@ -890,6 +891,13 @@ void RimDepthTrackPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
caf::PdmUiGroup* ensembleWellLogGroup = uiOrdering.addNewGroup( "Ensemble Well Log" );
ensembleWellLogGroup->add( &m_depthEqualization );
ensembleWellLogGroup->add( &m_ensembleCurveSet );
// Disable depth equalization if any of the ensmble is missing k-layer info
bool hasKLayerIndex = true;
for ( auto wellLogCurveSet : ensembleWellLogCurveSets )
if ( !wellLogCurveSet->hasPropertyInFile( RiaResultNames::indexKResultName() ) ) hasKLayerIndex = false;
m_depthEqualization.uiCapability()->setUiReadOnly( !hasKLayerIndex );
}
uiOrdering.skipRemainingFields( true );

View File

@ -179,6 +179,8 @@ bool RimEclipseInputCase::openDataFileSet( const QStringList& fileNames )
this->ensureFaultDataIsComputed();
}
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->createPlaceholderResultEntries();
return true;
}

View File

@ -472,6 +472,9 @@ void RimEnsembleWellLogCurveSet::defineUiOrdering( QString uiConfigName, caf::Pd
uiOrdering.add( &m_ensembleCurveSet );
uiOrdering.add( &m_depthEqualization );
bool hasKLayerIndex = hasPropertyInFile( RiaResultNames::indexKResultName() );
m_depthEqualization.uiCapability()->setUiReadOnly( !hasKLayerIndex );
appendColorGroup( uiOrdering );
{
@ -1265,3 +1268,27 @@ cvf::ref<RigWellPathFormations>
new RigWellPathFormations( wellPathFormationItems, unusedFilePath, "Ensemble formation" );
return wellPathFormations;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEnsembleWellLogCurveSet::hasPropertyInFile( const QString& property ) const
{
RimEnsembleWellLogs* group = m_ensembleWellLogs;
if ( !group ) return false;
std::vector<RimWellLogFile*> allWellLogFiles = group->wellLogFiles();
for ( auto& wellLogFile : allWellLogFiles )
{
QString errorMessage;
if ( !wellLogFile->readFile( &errorMessage ) ) return false;
RigWellLogFile* wellLogDataFile = wellLogFile->wellLogFileData();
CVF_ASSERT( wellLogDataFile );
std::vector<double> values = wellLogDataFile->values( RiaResultNames::indexKResultName() );
if ( values.empty() ) return false;
}
return true;
}

View File

@ -126,6 +126,8 @@ public:
void setFilterByEnsembleCurveSet( RimEnsembleCurveSet* ensembleCurveSet );
bool hasPropertyInFile( const QString& property ) const;
private:
void updateEnsembleCurves( const std::vector<RimWellLogFile*>& curves );
void updateStatisticsCurves( const std::vector<RimWellLogFile*>& curves );

View File

@ -169,6 +169,7 @@ void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellL
{
std::shared_ptr<RigWellLogIndexDepthOffset> offsets =
RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles );
if ( !offsets ) return;
std::map<int, std::vector<double>> topValues;
std::map<int, std::vector<double>> bottomValues;