#5856 Well Disks : Guard recompute and limit evaluation to visible wells

This commit is contained in:
Magne Sjaastad
2020-04-29 19:50:46 +02:00
parent bc400af345
commit accfa47539
5 changed files with 35 additions and 13 deletions

View File

@@ -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();

View File

@@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -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;

View File

@@ -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 )

View File

@@ -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: