mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5856 Well Disks : Guard recompute and limit evaluation to visible wells
This commit is contained in:
@@ -671,7 +671,7 @@ void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
|
||||
updateVisibleGeometriesAndCellColors();
|
||||
|
||||
wellCollection()->updateWellDisks();
|
||||
wellCollection()->scaleWellDisks();
|
||||
|
||||
appendWellsAndFracturesToModel();
|
||||
|
||||
@@ -997,7 +997,7 @@ void RimEclipseView::onLoadDataAndUpdate()
|
||||
|
||||
this->faultCollection()->syncronizeFaults();
|
||||
|
||||
this->m_wellCollection->updateWellDisks();
|
||||
this->m_wellCollection->scaleWellDisks();
|
||||
|
||||
scheduleReservoirGridGeometryRegen();
|
||||
m_simWellsPartManager->clearGeometryCache();
|
||||
|
||||
@@ -641,6 +641,26 @@ size_t RimSimWellInView::resultWellIndex() const
|
||||
return m_resultWellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSimWellInView::isWellDiskVisible() const
|
||||
{
|
||||
const RimEclipseView* reservoirView = nullptr;
|
||||
this->firstAncestorOrThisOfType( reservoirView );
|
||||
|
||||
if ( reservoirView == nullptr ) return false;
|
||||
if ( this->simWellData() == nullptr ) return false;
|
||||
|
||||
if ( !reservoirView->wellCollection()->isActive() ) return false;
|
||||
|
||||
if ( !this->showWell() ) return false;
|
||||
|
||||
if ( !this->showWellDisks() ) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
const RigSimWellData* simWellData() const;
|
||||
size_t resultWellIndex() const;
|
||||
|
||||
bool isWellDiskVisible() const;
|
||||
bool isWellCellsVisible() const;
|
||||
bool isWellPipeVisible( size_t frameIndex ) const;
|
||||
bool isWellSpheresVisible( size_t frameIndex ) const;
|
||||
|
||||
@@ -508,8 +508,6 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
if ( &isActive == changedField || &m_showWellLabel == changedField || &m_showWellCells == changedField ||
|
||||
&m_showWellCellFence == changedField || &wellCellFenceType == changedField )
|
||||
{
|
||||
RimWellDiskConfig wellDiskConfig = getActiveWellDiskConfig();
|
||||
updateWellDisks( wellDiskConfig );
|
||||
m_reservoirView->scheduleGeometryRegen( VISIBLE_WELL_CELLS );
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
@@ -520,11 +518,9 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
else if ( &m_wellDiskQuantity == changedField || &m_wellDiskPropertyType == changedField ||
|
||||
&m_wellDiskPropertyConfigType == changedField || &m_wellDiskshowLabelsBackground == changedField ||
|
||||
&m_wellDiskShowQuantityLabels == changedField || &m_wellDiskSummaryCase == changedField ||
|
||||
&m_wellDiskScaleFactor == changedField || &m_showWellDisks == changedField ||
|
||||
&wellDiskColor == changedField )
|
||||
&m_wellDiskScaleFactor == changedField || &wellDiskColor == changedField ||
|
||||
&m_showWellDisks == changedField )
|
||||
{
|
||||
RimWellDiskConfig wellDiskConfig = getActiveWellDiskConfig();
|
||||
updateWellDisks( wellDiskConfig );
|
||||
m_reservoirView->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
}
|
||||
else if ( &spheresScaleFactor == changedField || &m_showWellSpheres == changedField ||
|
||||
@@ -1057,21 +1053,26 @@ bool RimSimWellInViewCollection::showWellDiskQuantityLables() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSimWellInViewCollection::updateWellDisks()
|
||||
void RimSimWellInViewCollection::scaleWellDisks()
|
||||
{
|
||||
if ( !isActive ) return;
|
||||
if ( m_showWellDisks().isFalse() ) return;
|
||||
|
||||
RimWellDiskConfig wellDiskConfig = getActiveWellDiskConfig();
|
||||
updateWellDisks( wellDiskConfig );
|
||||
scaleWellDisksFromConfig( wellDiskConfig );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSimWellInViewCollection::updateWellDisks( const RimWellDiskConfig& wellDiskConfig )
|
||||
void RimSimWellInViewCollection::scaleWellDisksFromConfig( const RimWellDiskConfig& wellDiskConfig )
|
||||
{
|
||||
double minValue = std::numeric_limits<double>::max();
|
||||
double maxValue = -minValue;
|
||||
for ( RimSimWellInView* w : wells )
|
||||
{
|
||||
if ( !w->isWellDiskVisible() ) continue;
|
||||
|
||||
bool isOk = true;
|
||||
double value = w->calculateInjectionProductionFractions( wellDiskConfig, &isOk );
|
||||
if ( isOk )
|
||||
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
static void updateWellAllocationPlots();
|
||||
|
||||
void setDefaultSourceCaseForWellDisks();
|
||||
void updateWellDisks();
|
||||
void scaleWellDisks();
|
||||
double wellDiskScaleFactor() const;
|
||||
|
||||
caf::PdmField<cvf::Color3f> wellDiskColor;
|
||||
@@ -177,7 +177,7 @@ protected:
|
||||
private:
|
||||
void calculateWellGeometryVisibility( size_t frameIndex );
|
||||
void updateStateFromEnabledChildCount( size_t showLabelCount, caf::PdmField<caf::Tristate>* fieldToUpdate );
|
||||
void updateWellDisks( const RimWellDiskConfig& wellDiskConfig );
|
||||
void scaleWellDisksFromConfig( const RimWellDiskConfig& wellDiskConfig );
|
||||
RimWellDiskConfig getActiveWellDiskConfig() const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user