#1266 If not computed, compute staticWellCellPath when needed

This commit is contained in:
Magne Sjaastad 2017-03-01 14:23:01 +01:00
parent da416409aa
commit 68ff093c61
5 changed files with 22 additions and 14 deletions

View File

@ -84,11 +84,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
RigSingleWellResultsData* wellResults = well->wellResults();
if (wellResults->m_staticWellCells.m_wellResultBranches.size() == 0)
{
wellResults->computeStaticWellCellPath();
}
if (wellResults->m_staticWellCells.m_wellResultBranches.size() == 0) return;
if (wellResults->staticWellCells().m_wellResultBranches.size() == 0) return;
if (!wellResults->hasWellResult(frameIndex)) return;

View File

@ -243,7 +243,7 @@ bool RimEclipseWell::intersectsStaticWellCellsFilteredCells() const
if (this->wellResults() == nullptr) return false;
// NOTE: Read out static well cells, union of well cells across all time steps
const RigWellResultFrame& wrsf = this->wellResults()->m_staticWellCells;
const RigWellResultFrame& wrsf = this->wellResults()->staticWellCells();
// NOTE: Use first time step for visibility evaluation
size_t frameIndex = 0;

View File

@ -93,13 +93,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
if (timeStepIndex < 0)
{
// Make sure we have computed the static representation of the well
if (wellResults->m_staticWellCells.m_wellResultBranches.size() == 0)
{
wellResults->computeStaticWellCellPath();
}
wellFramePtr = &wellResults->m_staticWellCells;
wellFramePtr = &wellResults->staticWellCells();
}
else
{

View File

@ -278,6 +278,20 @@ RigWellResultFrame::WellProductionType RigSingleWellResultsData::wellProductionT
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigWellResultFrame& RigSingleWellResultsData::staticWellCells() const
{
// Make sure we have computed the static representation of the well
if (m_staticWellCells.m_wellResultBranches.size() == 0)
{
computeStaticWellCellPath();
}
return m_staticWellCells;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -149,7 +149,8 @@ public:
bool isOpen(size_t resultTimeStepIndex) const;
RigWellResultFrame::WellProductionType wellProductionType(size_t resultTimeStepIndex) const;
void computeStaticWellCellPath() const ;
const RigWellResultFrame& staticWellCells() const;
void computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector<QDateTime>& resultTimes);
public: // Todo: Clean up this regarding public members and constness etc.
@ -159,6 +160,9 @@ public: // Todo: Clean up this regarding public members and constness etc.
std::vector< RigWellResultFrame > m_wellCellsTimeSteps;
mutable RigWellResultFrame m_staticWellCells;
private:
void computeStaticWellCellPath() const;
private:
bool m_isMultiSegmentWell;
};