mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'main' into dev
This commit is contained in:
@@ -102,6 +102,10 @@ bool RiaResultNames::isFlowResultWithBothPosAndNegValues( const QString& resultN
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaResultNames::isCategoryResult( const QString& resultName )
|
||||
{
|
||||
static std::set<QString> excludedResultNames = { "FIPOIL", "FIPGAS", "FIPWAT" };
|
||||
|
||||
if ( excludedResultNames.find( resultName.toUpper() ) != excludedResultNames.end() ) return false;
|
||||
|
||||
if ( resultName.endsWith( "NUM", Qt::CaseInsensitive ) ) return true;
|
||||
if ( resultName.startsWith( "FIP", Qt::CaseInsensitive ) ) return true;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
|
||||
#include "Polygons/RimPolygonInView.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
@@ -37,8 +38,7 @@
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include "RimGeoMechContourMapViewCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimPolygonFilter.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimSurfaceInViewCollection.h"
|
||||
@@ -277,6 +277,30 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMapFr
|
||||
|
||||
eclipseCase->contourMapCollection()->updateConnectedEditors();
|
||||
|
||||
// Polygon cell filters are not working due to different organization of the project tree for Eclipse view and contour map view
|
||||
// Manually assign pointers to polygon objects
|
||||
//
|
||||
// TODO: Find a more robust solution, perhaps introduce a root token making it possible to have a reference string pointing to objects
|
||||
// relative root "$root$ PolygonCollection 0 Polygon 2"
|
||||
// Make sure this concept works for geomech contour maps
|
||||
|
||||
auto sourceFilters = sourceView->cellFilterCollection()->filters();
|
||||
auto destinationFilters = contourMap->cellFilterCollection()->filters();
|
||||
if ( sourceFilters.size() == destinationFilters.size() )
|
||||
{
|
||||
for ( size_t i = 0; i < sourceFilters.size(); ++i )
|
||||
{
|
||||
auto sourcePolygonFilter = dynamic_cast<RimPolygonFilter*>( sourceFilters[i] );
|
||||
auto destinationPolygonFilter = dynamic_cast<RimPolygonFilter*>( destinationFilters[i] );
|
||||
|
||||
if ( sourcePolygonFilter && sourcePolygonFilter->polygonInView() && destinationPolygonFilter )
|
||||
{
|
||||
destinationPolygonFilter->setPolygon( sourcePolygonFilter->polygonInView()->polygon() );
|
||||
destinationPolygonFilter->configurePolygonEditor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return contourMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "RicNewPltPlotFeature.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
@@ -84,6 +86,15 @@ bool RicNewPltPlotFeature::isCommandEnabled() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
if ( RimWellPlotTools::wellPathsContainingFlow().empty() )
|
||||
{
|
||||
QString displayMessage =
|
||||
"To create a PLT plot, either import a LAS file with observed production data or import a well path trajectory.";
|
||||
|
||||
RiaLogging::errorInMessageBox( nullptr, "No well data available to create a PLT plot", displayMessage );
|
||||
return;
|
||||
}
|
||||
|
||||
RimPltPlotCollection* pltPlotColl = RimMainPlotCollection::current()->pltPlotCollection();
|
||||
if ( pltPlotColl )
|
||||
{
|
||||
@@ -116,7 +127,6 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
||||
pltPlot->nameConfig()->setCustomName( plotName );
|
||||
pltPlot->setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
|
||||
|
||||
// pltPlot->applyInitialSelections();
|
||||
pltPlot->loadDataAndUpdate();
|
||||
pltPlotColl->updateConnectedEditors();
|
||||
|
||||
|
||||
@@ -705,6 +705,20 @@ RimWellPath* RimWellPlotTools::wellPathByWellPathNameOrSimWellName( const QStrin
|
||||
return wellPath != nullptr ? wellPath : proj->wellPathFromSimWellName( wellPathNameOrSimwellName );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RimWellPlotTools::wellPathsContainingFlow()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
for ( RimWellPath* wellPath : RimProject::current()->allWellPaths() )
|
||||
{
|
||||
if ( wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData( wellPath ) ) wellPaths.push_back( wellPath );
|
||||
}
|
||||
|
||||
return wellPaths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -77,6 +77,7 @@ public:
|
||||
|
||||
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow( const QString& wellName );
|
||||
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||
static std::vector<RimWellPath*> wellPathsContainingFlow();
|
||||
|
||||
// RFT Only
|
||||
private:
|
||||
|
||||
@@ -1031,18 +1031,11 @@ void RimWellPltPlot::syncSourcesIoFieldFromGuiField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::calculateValueOptionsForWells( QList<caf::PdmOptionItemInfo>& options )
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
|
||||
if ( proj != nullptr )
|
||||
auto wellPathsContainingFlowData = RimWellPlotTools::wellPathsContainingFlow();
|
||||
for ( const RimWellPath* const wellPath : wellPathsContainingFlowData )
|
||||
{
|
||||
// Observed wells
|
||||
for ( const RimWellPath* const wellPath : proj->allWellPaths() )
|
||||
{
|
||||
const QString wellName = wellPath->name();
|
||||
|
||||
if ( wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData( wellPath ) )
|
||||
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
||||
}
|
||||
const QString wellName = wellPath->name();
|
||||
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
||||
}
|
||||
|
||||
options.push_back( caf::PdmOptionItemInfo( "None", "" ) );
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "RiuViewer.h"
|
||||
#include "RivContourMapProjectionPartMgr.h"
|
||||
|
||||
#include "Polygons/RimPolygonInViewCollection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimCase.h"
|
||||
@@ -231,9 +232,10 @@ void RimEclipseContourMapView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
|
||||
cellResult()->uiCapability()->setUiReadOnly( m_contourMapProjection->isColumnResult() );
|
||||
uiTreeOrdering.add( wellCollection() );
|
||||
uiTreeOrdering.add( faultCollection() );
|
||||
uiTreeOrdering.add( annotationCollection() );
|
||||
uiTreeOrdering.add( m_cellFilterCollection() );
|
||||
uiTreeOrdering.add( nativePropertyFilterCollection() );
|
||||
uiTreeOrdering.add( m_polygonInViewCollection );
|
||||
uiTreeOrdering.add( annotationCollection() );
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaColorTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RigAllanDiagramData.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
@@ -633,12 +634,6 @@ void RimEclipseResultDefinitionTools::updateCellResultLegend( const RimEclipseRe
|
||||
std::iota( uniqueValues.begin(), uniqueValues.end(), 0 );
|
||||
}
|
||||
|
||||
cvf::Color3ubArray legendBaseColors = legendConfigToUpdate->colorLegend()->colorArray();
|
||||
|
||||
cvf::ref<caf::CategoryMapper> categoryMapper = new caf::CategoryMapper;
|
||||
categoryMapper->setCategories( uniqueValues );
|
||||
categoryMapper->setInterpolateColors( legendBaseColors );
|
||||
|
||||
std::vector<int> visibleCategoryValues = uniqueValues;
|
||||
|
||||
if ( resultDefinition->showOnlyVisibleCategoriesInLegend() )
|
||||
@@ -658,6 +653,26 @@ void RimEclipseResultDefinitionTools::updateCellResultLegend( const RimEclipseRe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const size_t maxCategoryCount = 500;
|
||||
if ( legendConfigToUpdate->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER &&
|
||||
visibleCategoryValues.size() > maxCategoryCount )
|
||||
{
|
||||
QString txt = QString( "Detected %1 category values. Maximum number of categories is %2. Only the first %2 "
|
||||
"categories will be displayed. Please use a different color mapping." )
|
||||
.arg( visibleCategoryValues.size() )
|
||||
.arg( maxCategoryCount );
|
||||
RiaLogging::error( txt );
|
||||
|
||||
visibleCategoryValues.resize( maxCategoryCount );
|
||||
}
|
||||
|
||||
cvf::Color3ubArray legendBaseColors = legendConfigToUpdate->colorLegend()->colorArray();
|
||||
|
||||
cvf::ref<caf::CategoryMapper> categoryMapper = new caf::CategoryMapper;
|
||||
categoryMapper->setCategories( visibleCategoryValues );
|
||||
categoryMapper->setInterpolateColors( legendBaseColors );
|
||||
|
||||
std::vector<std::tuple<QString, int, cvf::Color3ub>> categoryVector;
|
||||
|
||||
for ( auto value : visibleCategoryValues )
|
||||
|
||||
@@ -651,23 +651,24 @@ std::vector<caf::PdmFieldHandle*> RimSummaryMultiPlot::fieldsToShowInToolbar()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryMultiPlot::handleGlobalKeyEvent( QKeyEvent* keyEvent )
|
||||
{
|
||||
if ( !RimSummaryPlotControls::handleKeyEvents( m_sourceStepping(), keyEvent ) )
|
||||
bool isHandled = RimSummaryPlotControls::handleKeyEvents( m_sourceStepping(), keyEvent );
|
||||
|
||||
if ( !isHandled && isMouseCursorInsidePlot() )
|
||||
{
|
||||
if ( isMouseCursorInsidePlot() )
|
||||
if ( keyEvent->key() == Qt::Key_PageUp )
|
||||
{
|
||||
if ( keyEvent->key() == Qt::Key_PageUp )
|
||||
{
|
||||
m_viewer->goToPrevPage();
|
||||
return true;
|
||||
}
|
||||
else if ( keyEvent->key() == Qt::Key_PageDown )
|
||||
{
|
||||
m_viewer->goToNextPage();
|
||||
return true;
|
||||
}
|
||||
m_viewer->goToPrevPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( keyEvent->key() == Qt::Key_PageDown )
|
||||
{
|
||||
m_viewer->goToNextPage();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return isHandled;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -2942,7 +2942,10 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
|
||||
RigEclipseResultAddress( RiaDefines::ResultCatType::FORMATION_NAMES,
|
||||
RiaResultNames::activeFormationNamesResultName() ) );
|
||||
|
||||
curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
|
||||
if ( resultAccessor.notNull() )
|
||||
{
|
||||
curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1617,11 +1617,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep( const Rig
|
||||
|
||||
size_t scalarResultIndex = findScalarResultIndexFromAddress( resVarAddr );
|
||||
if ( scalarResultIndex == cvf::UNDEFINED_SIZE_T ) return cvf::UNDEFINED_SIZE_T;
|
||||
|
||||
if ( type == RiaDefines::ResultCatType::GENERATED )
|
||||
{
|
||||
return cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
if ( type == RiaDefines::ResultCatType::GENERATED ) return scalarResultIndex;
|
||||
|
||||
if ( m_readerInterface.notNull() )
|
||||
{
|
||||
|
||||
@@ -737,6 +737,28 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
|
||||
return retCurveArr;
|
||||
}
|
||||
|
||||
// For unknown reasons, the ECLSaturationFunc returns a KROG curve when there is no gas in the system.
|
||||
// Remove invalid KROG curve if no KRG curve is present
|
||||
// https://github.com/OPM/ResInsight/issues/11396
|
||||
|
||||
bool hasKRG = false;
|
||||
for ( const RelPermCurve& curve : retCurveArr )
|
||||
{
|
||||
if ( curve.ident == RelPermCurve::KRG )
|
||||
{
|
||||
hasKRG = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !hasKRG )
|
||||
{
|
||||
retCurveArr.erase( std::remove_if( retCurveArr.begin(),
|
||||
retCurveArr.end(),
|
||||
[]( const RelPermCurve& curve ) { return curve.ident == RelPermCurve::KROG; } ),
|
||||
retCurveArr.end() );
|
||||
}
|
||||
|
||||
return retCurveArr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user