2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 02:45:23 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-10-13 02:29:42 -05:00
|
|
|
#include "RimSimWellInView.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RigActiveCellInfo.h"
|
|
|
|
#include "RigCell.h"
|
|
|
|
#include "RigEclipseCaseData.h"
|
|
|
|
#include "RigMainGrid.h"
|
2017-10-13 06:44:53 -05:00
|
|
|
#include "RigSimWellData.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RigSimulationWellCenterLineCalculator.h"
|
2017-01-18 02:56:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "Rim2dIntersectionView.h"
|
2017-02-07 08:07:11 -06:00
|
|
|
#include "RimCellRangeFilterCollection.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RimEclipseCase.h"
|
2015-05-21 03:34:38 -05:00
|
|
|
#include "RimEclipseView.h"
|
2019-11-26 04:35:21 -06:00
|
|
|
#include "RimExtrudedCurveIntersection.h"
|
2017-01-18 06:38:34 -06:00
|
|
|
#include "RimIntersectionCollection.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RimPropertyFilterCollection.h"
|
2017-02-22 07:40:13 -06:00
|
|
|
#include "RimSimWellFracture.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RimSimWellFractureCollection.h"
|
|
|
|
#include "RimSimWellInViewCollection.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
|
2017-02-02 01:26:27 -06:00
|
|
|
#include "RiuMainWindow.h"
|
|
|
|
|
2017-02-24 04:07:15 -06:00
|
|
|
#include "RivReservoirViewPartMgr.h"
|
|
|
|
|
2017-02-22 07:40:13 -06:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cvfMath.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-03-08 06:08:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// Internal functions
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
Rim2dIntersectionView* corresponding2dIntersectionView( RimSimWellInView* simWellInView );
|
2018-03-08 06:08:06 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimSimWellInView, "Well" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
RimSimWellInView::RimSimWellInView()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "Well", ":/Well.png", "", "" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &name, "WellName", "Name", "", "", "" );
|
2017-01-25 00:45:17 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &showWell, "ShowWell", true, "Show well ", "", "", "" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &showWellLabel, "ShowWellLabel", true, "Label", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &showWellHead, "ShowWellHead", true, "Well Head", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &showWellPipe, "ShowWellPipe", true, "Pipe", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &showWellSpheres, "ShowWellSpheres", false, "Spheres", "", "", "" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &wellHeadScaleFactor, "WellHeadScaleFactor", 1.0, "Well Head Scale", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Pipe Radius Scale", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &wellPipeColor, "WellPipeColor", cvf::Color3f( 0.588f, 0.588f, 0.804f ), "Pipe Color", "", "", "" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &showWellCells, "ShowWellCells", false, "Well Cells", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &showWellCellFence, "ShowWellCellFence", false, "Well Cell Fence", "", "", "" );
|
2017-08-21 08:24:20 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &simwellFractureCollection, "FractureCollection", "Fractures", "", "", "" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
name.uiCapability()->setUiHidden( true );
|
|
|
|
name.uiCapability()->setUiReadOnly( true );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-12-11 10:34:52 -06:00
|
|
|
m_resultWellIndex = cvf::UNDEFINED_SIZE_T;
|
2013-04-26 09:46:38 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
simwellFractureCollection = new RimSimWellFractureCollection();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
RimSimWellInView::~RimSimWellInView()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( simwellFractureCollection() ) delete simwellFractureCollection();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
caf::PdmFieldHandle* RimSimWellInView::userDescriptionField()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
return &name;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSimWellInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2017-02-02 01:26:27 -06:00
|
|
|
RimEclipseView* reservoirView = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
|
|
|
if ( reservoirView )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( &showWellLabel == changedField || &showWellHead == changedField || &showWellPipe == changedField ||
|
|
|
|
&showWellSpheres == changedField || &wellPipeColor == changedField )
|
2017-02-02 01:26:27 -06:00
|
|
|
{
|
|
|
|
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
2018-03-08 06:08:06 -06:00
|
|
|
schedule2dIntersectionViewUpdate();
|
2017-02-02 01:26:27 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( &showWell == changedField || &showWellCells == changedField || &showWellCellFence == changedField )
|
|
|
|
|
2013-02-08 07:59:27 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
reservoirView->scheduleGeometryRegen( VISIBLE_WELL_CELLS );
|
2017-02-02 01:26:27 -06:00
|
|
|
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
2018-03-08 06:08:06 -06:00
|
|
|
schedule2dIntersectionViewUpdate();
|
2013-02-08 07:59:27 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( &pipeScaleFactor == changedField || &wellHeadScaleFactor == changedField )
|
2017-02-02 01:26:27 -06:00
|
|
|
{
|
2018-03-08 06:08:06 -06:00
|
|
|
reservoirView->scheduleSimWellGeometryRegen();
|
|
|
|
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
schedule2dIntersectionViewUpdate();
|
2013-02-08 07:59:27 -06:00
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
2017-02-02 01:26:27 -06:00
|
|
|
|
2017-10-13 07:20:47 -05:00
|
|
|
RimSimWellInViewCollection* wellColl = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( wellColl );
|
|
|
|
if ( wellColl )
|
2017-02-02 01:26:27 -06:00
|
|
|
{
|
|
|
|
wellColl->updateStateForVisibilityCheckboxes();
|
|
|
|
|
|
|
|
RiuMainWindow::instance()->refreshDrawStyleActions();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
2017-02-10 12:12:21 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( changedField == &wellPipeColor )
|
2017-02-10 12:12:21 -06:00
|
|
|
{
|
2017-10-13 07:20:47 -05:00
|
|
|
RimSimWellInViewCollection::updateWellAllocationPlots();
|
2017-02-10 12:12:21 -06:00
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
2013-04-17 01:25:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-17 01:25:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
caf::PdmFieldHandle* RimSimWellInView::objectToggleField()
|
2013-04-17 01:25:32 -05:00
|
|
|
{
|
2013-09-06 08:45:21 -05:00
|
|
|
return &showWell;
|
2013-04-17 01:25:32 -05:00
|
|
|
}
|
|
|
|
|
2017-01-20 10:20:09 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-20 10:20:09 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-03-02 06:54:42 -06:00
|
|
|
std::vector<const RigWellPath*> RimSimWellInView::wellPipeBranches() const
|
2017-01-20 10:20:09 -06:00
|
|
|
{
|
2018-03-02 06:54:42 -06:00
|
|
|
RimSimWellInViewCollection* simWellCollection = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( simWellCollection );
|
2018-03-02 06:54:42 -06:00
|
|
|
|
|
|
|
RimEclipseCase* eclipseCase = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( eclipseCase );
|
|
|
|
if ( eclipseCase && eclipseCase->eclipseCaseData() )
|
2018-12-03 02:24:31 -06:00
|
|
|
{
|
2019-04-26 05:50:36 -05:00
|
|
|
RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData();
|
|
|
|
|
2018-12-03 02:24:31 -06:00
|
|
|
bool includeCellCenters = this->isUsingCellCenterForPipe();
|
2019-04-26 05:50:36 -05:00
|
|
|
bool detectBrances = simWellCollection->isAutoDetectingBranches;
|
2018-03-02 06:54:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return caseData->simulationWellBranches( this->name(), includeCellCenters, detectBrances );
|
2018-12-03 02:24:31 -06:00
|
|
|
}
|
|
|
|
return std::vector<const RigWellPath*>();
|
2017-01-20 10:20:09 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-20 10:20:09 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSimWellInView::calculateWellPipeStaticCenterLine( std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
|
|
|
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds )
|
2017-01-20 10:20:09 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( this,
|
|
|
|
pipeBranchesCLCoords,
|
|
|
|
pipeBranchesCellIds );
|
2017-01-20 10:20:09 -06:00
|
|
|
}
|
|
|
|
|
2017-03-14 13:17:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-02-28 10:18:48 -06:00
|
|
|
/// frameIndex = -1 will use the static well frame
|
2017-03-14 13:17:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSimWellInView::wellHeadTopBottomPosition( int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom )
|
2017-03-14 13:17:14 -05:00
|
|
|
{
|
|
|
|
RimEclipseView* m_rimReservoirView;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfTypeAsserted( m_rimReservoirView );
|
|
|
|
|
2017-03-15 03:10:16 -05:00
|
|
|
RigEclipseCaseData* rigReservoir = m_rimReservoirView->eclipseCase()->eclipseCaseData();
|
2017-03-14 13:17:14 -05:00
|
|
|
|
2018-02-28 10:18:48 -06:00
|
|
|
const RigWellResultFrame* wellResultFramePtr = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
const RigCell* whCellPtr = nullptr;
|
2018-02-28 10:18:48 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( frameIndex >= 0 )
|
2018-02-28 10:18:48 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->simWellData()->hasAnyValidCells( frameIndex ) ) return;
|
2018-02-28 10:18:48 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
wellResultFramePtr = &( this->simWellData()->wellResultFrame( frameIndex ) );
|
|
|
|
whCellPtr = &( rigReservoir->cellFromWellResultCell( wellResultFramePtr->wellHeadOrStartCell() ) );
|
2018-02-28 10:18:48 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
wellResultFramePtr = &( this->simWellData()->staticWellCells() );
|
|
|
|
whCellPtr = &( rigReservoir->cellFromWellResultCell( wellResultFramePtr->wellHeadOrStartCell() ) );
|
2018-02-28 10:18:48 -06:00
|
|
|
}
|
2017-03-14 13:17:14 -05:00
|
|
|
|
2018-02-28 10:18:48 -06:00
|
|
|
const RigCell& whCell = *whCellPtr;
|
2017-03-14 13:17:14 -05:00
|
|
|
|
|
|
|
// Match this position with pipe start position in RivWellPipesPartMgr::calculateWellPipeCenterline()
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
( *bottom ) = whCell.faceCenter( cvf::StructGridInterface::NEG_K );
|
2017-03-14 13:17:14 -05:00
|
|
|
|
|
|
|
// Compute well head based on the z position of the top of the K column the well head is part of
|
2019-09-06 03:40:57 -05:00
|
|
|
( *top ) = ( *bottom );
|
2017-10-13 07:20:47 -05:00
|
|
|
if ( m_rimReservoirView->wellCollection()->wellHeadPosition() == RimSimWellInViewCollection::WELLHEAD_POS_TOP_COLUMN )
|
2017-03-14 13:17:14 -05:00
|
|
|
{
|
|
|
|
// Position well head at top active cell of IJ-column
|
|
|
|
|
|
|
|
size_t i, j, k;
|
2019-09-06 03:40:57 -05:00
|
|
|
rigReservoir->mainGrid()->ijkFromCellIndex( whCell.mainGridCellIndex(), &i, &j, &k );
|
2017-03-14 13:17:14 -05:00
|
|
|
|
|
|
|
size_t kIndexWellHeadCell = k;
|
2019-09-06 03:40:57 -05:00
|
|
|
k = 0;
|
2017-03-14 13:17:14 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK( i, j, k );
|
|
|
|
while ( k < kIndexWellHeadCell && !m_rimReservoirView->currentActiveCellInfo()->isActive( topActiveCellIndex ) )
|
2017-03-14 13:17:14 -05:00
|
|
|
{
|
|
|
|
k++;
|
2019-09-06 03:40:57 -05:00
|
|
|
topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK( i, j, k );
|
2017-03-14 13:17:14 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
const RigCell& topActiveCell = rigReservoir->mainGrid()->cell( topActiveCellIndex );
|
|
|
|
cvf::Vec3d topCellPos = topActiveCell.faceCenter( cvf::StructGridInterface::NEG_K );
|
2017-03-14 13:17:14 -05:00
|
|
|
|
|
|
|
// Modify position if top active cell is closer to sea than well head
|
|
|
|
if ( kIndexWellHeadCell > k )
|
|
|
|
{
|
|
|
|
top->z() = topCellPos.z();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Position well head at top of active cells bounding box
|
|
|
|
|
|
|
|
cvf::Vec3d activeCellsBoundingBoxMax = m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max();
|
|
|
|
|
|
|
|
top->z() = activeCellsBoundingBoxMax.z();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-14 13:17:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
double RimSimWellInView::pipeRadius()
|
2017-03-14 13:17:14 -05:00
|
|
|
{
|
|
|
|
RimEclipseView* reservoirView;
|
2019-09-06 03:40:57 -05:00
|
|
|
firstAncestorOrThisOfTypeAsserted( reservoirView );
|
2017-03-14 13:17:14 -05:00
|
|
|
|
2017-03-15 03:10:16 -05:00
|
|
|
RigEclipseCaseData* rigReservoir = reservoirView->eclipseCase()->eclipseCaseData();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2017-03-14 13:17:14 -05:00
|
|
|
double characteristicCellSize = rigReservoir->mainGrid()->characteristicIJCellSize();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
double pipeRadius = reservoirView->wellCollection()->pipeScaleFactor() * this->pipeScaleFactor() *
|
|
|
|
characteristicCellSize;
|
2017-03-14 13:17:14 -05:00
|
|
|
|
|
|
|
return pipeRadius;
|
|
|
|
}
|
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-03-12 06:36:39 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
int RimSimWellInView::pipeCrossSectionVertexCount()
|
|
|
|
{
|
|
|
|
RimSimWellInViewCollection* simWellCollection = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( simWellCollection );
|
2018-03-12 06:36:39 -05:00
|
|
|
return simWellCollection->pipeCrossSectionVertexCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-22 02:13:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimSimWellInView::intersectsDynamicWellCellsFilteredCells( size_t frameIndex ) const
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( this->simWellData() == nullptr ) return false;
|
2016-12-14 00:15:44 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !simWellData()->hasWellResult( frameIndex ) ) return false;
|
2016-12-14 00:15:44 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
const RigWellResultFrame& wrsf = this->simWellData()->wellResultFrame( frameIndex );
|
2017-01-18 02:56:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return intersectsWellCellsFilteredCells( wrsf, frameIndex );
|
2017-02-07 08:33:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-07 08:33:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimSimWellInView::intersectsWellCellsFilteredCells( const RigWellResultFrame& wrsf, size_t frameIndex ) const
|
2017-02-07 08:33:00 -06:00
|
|
|
{
|
|
|
|
RimEclipseView* reservoirView = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
|
|
|
if ( !reservoirView ) return false;
|
2017-02-07 08:33:00 -06:00
|
|
|
|
|
|
|
const std::vector<RivCellSetEnum>& visGridParts = reservoirView->visibleGridParts();
|
2019-09-06 03:40:57 -05:00
|
|
|
RivReservoirViewPartMgr* rvMan = reservoirView->reservoirGridPartManager();
|
2016-12-14 00:15:44 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const RivCellSetEnum& visGridPart : visGridParts )
|
2017-01-27 08:19:18 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( visGridPart == ALL_WELL_CELLS || visGridPart == VISIBLE_WELL_CELLS ||
|
|
|
|
visGridPart == VISIBLE_WELL_FENCE_CELLS || visGridPart == VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER ||
|
|
|
|
visGridPart == VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER )
|
2017-02-07 07:28:52 -06:00
|
|
|
{
|
|
|
|
// Exclude all cells related to well cells
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2016-12-14 00:15:44 -06:00
|
|
|
// First check the wellhead:
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t gridIndex = wrsf.m_wellHead.m_gridIndex;
|
2016-12-14 00:15:44 -06:00
|
|
|
size_t gridCellIndex = wrsf.m_wellHead.m_gridCellIndex;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
const cvf::UByteArray* cellVisibility = rvMan->cellVisibility( visGridPart, gridIndex, frameIndex );
|
|
|
|
if ( gridCellIndex < cellVisibility->size() && ( *cellVisibility )[gridCellIndex] )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Then check the rest of the well, with all the branches
|
|
|
|
|
|
|
|
const std::vector<RigWellResultBranch>& wellResSegments = wrsf.m_wellResultBranches;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const RigWellResultBranch& branchSegment : wellResSegments )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
2017-01-27 08:19:18 -06:00
|
|
|
const std::vector<RigWellResultPoint>& wsResCells = branchSegment.m_branchResultPoints;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const RigWellResultPoint& wellResultPoint : wsResCells )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellResultPoint.isCell() )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
gridIndex = wellResultPoint.m_gridIndex;
|
2017-01-27 08:19:18 -06:00
|
|
|
gridCellIndex = wellResultPoint.m_gridCellIndex;
|
2016-12-14 00:15:44 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
const cvf::UByteArray* cellVisibility = rvMan->cellVisibility( visGridPart, gridIndex, frameIndex );
|
|
|
|
if ( gridCellIndex < cellVisibility->size() && ( *cellVisibility )[gridCellIndex] )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-03-08 06:08:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-03-08 06:08:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSimWellInView::schedule2dIntersectionViewUpdate()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
Rim2dIntersectionView* intersectionView = corresponding2dIntersectionView( this );
|
|
|
|
if ( intersectionView )
|
2018-03-08 06:08:06 -06:00
|
|
|
{
|
|
|
|
intersectionView->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-07 08:07:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-07 08:07:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
bool RimSimWellInView::intersectsStaticWellCellsFilteredCells() const
|
2017-02-07 08:07:11 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( this->simWellData() == nullptr ) return false;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
|
|
|
// NOTE: Read out static well cells, union of well cells across all time steps
|
2017-10-13 06:44:53 -05:00
|
|
|
const RigWellResultFrame& wrsf = this->simWellData()->staticWellCells();
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2017-02-07 08:33:00 -06:00
|
|
|
// NOTE: Use first time step for visibility evaluation
|
|
|
|
size_t frameIndex = 0;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return intersectsWellCellsFilteredCells( wrsf, frameIndex );
|
2017-02-07 08:07:11 -06:00
|
|
|
}
|
|
|
|
|
2016-12-14 00:15:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 00:15:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSimWellInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2016-12-14 00:15:44 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Visibility" );
|
|
|
|
appearanceGroup->add( &showWellLabel );
|
|
|
|
appearanceGroup->add( &showWellHead );
|
|
|
|
appearanceGroup->add( &showWellPipe );
|
|
|
|
appearanceGroup->add( &showWellSpheres );
|
|
|
|
|
|
|
|
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Well Cells and Fence" );
|
|
|
|
filterGroup->add( &showWellCells );
|
|
|
|
filterGroup->add( &showWellCellFence );
|
|
|
|
|
|
|
|
showWellCellFence.uiCapability()->setUiReadOnly( !showWellCells() );
|
|
|
|
caf::PdmUiGroup* sizeScalingGroup = uiOrdering.addNewGroup( "Size Scaling" );
|
|
|
|
sizeScalingGroup->add( &wellHeadScaleFactor );
|
|
|
|
sizeScalingGroup->add( &pipeScaleFactor );
|
|
|
|
|
|
|
|
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup( "Colors" );
|
|
|
|
colorGroup->add( &wellPipeColor );
|
|
|
|
|
|
|
|
uiOrdering.skipRemainingFields( true );
|
2016-12-14 00:15:44 -06:00
|
|
|
}
|
|
|
|
|
2017-01-27 08:50:17 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-27 08:50:17 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSimWellInView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
2017-01-27 08:50:17 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSimWellFracture* fracture : simwellFractureCollection()->simwellFractures() )
|
2017-02-22 07:40:13 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
uiTreeOrdering.add( fracture );
|
2017-02-22 07:40:13 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
uiTreeOrdering.skipRemainingChildren( true );
|
2017-02-22 07:40:13 -06:00
|
|
|
|
2017-01-27 08:50:17 -06:00
|
|
|
const RimEclipseView* reservoirView = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
|
|
|
if ( !reservoirView ) return;
|
2017-01-27 08:50:17 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView->rangeFilterCollection() && !reservoirView->rangeFilterCollection()->hasActiveFilters() )
|
2017-02-07 08:07:11 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->uiCapability()->setUiReadOnly( false );
|
2017-02-07 08:07:11 -06:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2017-10-13 07:20:47 -05:00
|
|
|
const RimSimWellInViewCollection* wellColl = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( wellColl );
|
|
|
|
if ( !wellColl ) return;
|
2017-01-27 08:50:17 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellColl->showWellsIntersectingVisibleCells() &&
|
|
|
|
!this->intersectsDynamicWellCellsFilteredCells( static_cast<size_t>( reservoirView->currentTimeStep() ) ) )
|
2017-01-26 03:27:23 -06:00
|
|
|
{
|
2017-01-27 08:50:17 -06:00
|
|
|
// Mark well as read only if well is not intersecting visible cells
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
this->uiCapability()->setUiReadOnly( true );
|
2017-01-27 08:50:17 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
this->uiCapability()->setUiReadOnly( false );
|
2017-01-26 03:27:23 -06:00
|
|
|
}
|
2016-12-14 00:15:44 -06:00
|
|
|
}
|
|
|
|
|
2017-02-07 08:07:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-07 08:07:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
bool RimSimWellInView::isWellCellsVisible() const
|
2017-02-07 08:07:11 -06:00
|
|
|
{
|
|
|
|
const RimEclipseView* reservoirView = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView == nullptr ) return false;
|
|
|
|
if ( this->simWellData() == nullptr ) return false;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !reservoirView->wellCollection()->isActive() ) return false;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->showWell() ) return false;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->showWellCells() ) return false;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-11-26 05:30:44 -06:00
|
|
|
if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true;
|
2017-02-07 08:07:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() &&
|
|
|
|
reservoirView->rangeFilterCollection()->hasActiveFilters() )
|
2017-02-07 08:07:11 -06:00
|
|
|
{
|
2017-02-07 08:33:00 -06:00
|
|
|
return intersectsStaticWellCellsFilteredCells();
|
2017-02-07 08:07:11 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-14 00:15:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 00:15:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimSimWellInView::isWellPipeVisible( size_t frameIndex ) const
|
2013-04-22 02:13:37 -05:00
|
|
|
{
|
2017-01-27 08:19:18 -06:00
|
|
|
const RimEclipseView* reservoirView = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
2017-01-18 02:56:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView == nullptr ) return false;
|
|
|
|
if ( this->simWellData() == nullptr ) return false;
|
2013-04-22 02:13:37 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( frameIndex >= this->simWellData()->m_resultTimeStepIndexToWellTimeStepIndex.size() )
|
2013-08-26 14:56:40 -05:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-10-13 06:44:53 -05:00
|
|
|
size_t wellTimeStepIndex = this->simWellData()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellTimeStepIndex == cvf::UNDEFINED_SIZE_T )
|
2013-08-26 14:56:40 -05:00
|
|
|
{
|
2013-08-12 10:05:03 -05:00
|
|
|
return false;
|
2013-08-26 14:56:40 -05:00
|
|
|
}
|
2013-08-12 10:05:03 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !reservoirView->wellCollection()->isActive() ) return false;
|
2013-04-22 02:13:37 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->showWell() ) return false;
|
2013-09-06 08:45:21 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->showWellPipe() ) return false;
|
2017-02-08 01:04:08 -06:00
|
|
|
|
2019-11-26 05:30:44 -06:00
|
|
|
if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true;
|
2013-04-22 02:13:37 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() &&
|
|
|
|
( reservoirView->rangeFilterCollection()->hasActiveFilters() ||
|
|
|
|
reservoirView->propertyFilterCollection()->hasActiveFilters() ) )
|
2013-04-22 02:13:37 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return intersectsDynamicWellCellsFilteredCells( frameIndex );
|
2016-12-12 03:08:11 -06:00
|
|
|
}
|
2017-01-26 01:12:28 -06:00
|
|
|
else
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-12-12 03:08:11 -06:00
|
|
|
}
|
|
|
|
|
2016-12-13 02:35:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-13 02:35:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimSimWellInView::isWellSpheresVisible( size_t frameIndex ) const
|
2016-12-13 02:35:01 -06:00
|
|
|
{
|
2017-02-08 01:04:08 -06:00
|
|
|
const RimEclipseView* reservoirView = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
2017-01-18 02:56:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView == nullptr ) return false;
|
|
|
|
if ( this->simWellData() == nullptr ) return false;
|
2016-12-13 02:35:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( frameIndex >= this->simWellData()->m_resultTimeStepIndexToWellTimeStepIndex.size() )
|
2016-12-13 02:35:01 -06:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-10-13 06:44:53 -05:00
|
|
|
size_t wellTimeStepIndex = this->simWellData()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellTimeStepIndex == cvf::UNDEFINED_SIZE_T )
|
2016-12-13 02:35:01 -06:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !reservoirView->wellCollection()->isActive() ) return false;
|
2016-12-13 02:35:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->showWell() ) return false;
|
2016-12-13 02:35:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->showWellSpheres() ) return false;
|
2016-12-13 02:35:01 -06:00
|
|
|
|
2019-11-26 05:30:44 -06:00
|
|
|
if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true;
|
2016-12-13 02:35:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() &&
|
|
|
|
reservoirView->rangeFilterCollection()->hasActiveFilters() )
|
2016-12-13 02:35:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return intersectsDynamicWellCellsFilteredCells( frameIndex );
|
2016-12-13 02:35:01 -06:00
|
|
|
}
|
2017-01-26 01:12:28 -06:00
|
|
|
else
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-12-13 02:35:01 -06:00
|
|
|
}
|
|
|
|
|
2017-01-20 08:57:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-20 08:57:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
bool RimSimWellInView::isUsingCellCenterForPipe() const
|
2017-01-20 08:57:04 -06:00
|
|
|
{
|
2017-10-13 07:20:47 -05:00
|
|
|
const RimSimWellInViewCollection* wellColl = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( wellColl );
|
2017-01-20 08:57:04 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return ( wellColl && wellColl->wellPipeCoordType() == RimSimWellInViewCollection::WELLPIPE_CELLCENTER );
|
2017-01-20 08:57:04 -06:00
|
|
|
}
|
|
|
|
|
2015-12-11 10:34:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-12-11 10:34:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSimWellInView::setSimWellData( RigSimWellData* simWellData, size_t resultWellIndex )
|
2015-12-11 10:34:52 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_simWellData = simWellData;
|
2017-01-18 02:56:42 -06:00
|
|
|
m_resultWellIndex = resultWellIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-18 02:56:42 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 06:44:53 -05:00
|
|
|
RigSimWellData* RimSimWellInView::simWellData()
|
2017-01-18 02:56:42 -06:00
|
|
|
{
|
2017-10-13 06:44:53 -05:00
|
|
|
return m_simWellData.p();
|
2017-01-18 02:56:42 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-18 02:56:42 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 06:44:53 -05:00
|
|
|
const RigSimWellData* RimSimWellInView::simWellData() const
|
2017-01-27 08:19:18 -06:00
|
|
|
{
|
2017-10-13 06:44:53 -05:00
|
|
|
return m_simWellData.p();
|
2017-01-27 08:19:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-27 08:19:18 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 02:29:42 -05:00
|
|
|
size_t RimSimWellInView::resultWellIndex() const
|
2017-01-18 02:56:42 -06:00
|
|
|
{
|
|
|
|
return m_resultWellIndex;
|
2013-04-26 09:46:38 -05:00
|
|
|
}
|
|
|
|
|
2018-03-08 06:08:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// Internal functions
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
Rim2dIntersectionView* corresponding2dIntersectionView( RimSimWellInView* simWellInView )
|
2018-03-08 06:08:06 -06:00
|
|
|
{
|
|
|
|
Rim3dView* tdView;
|
2019-09-06 03:40:57 -05:00
|
|
|
simWellInView->firstAncestorOrThisOfType( tdView );
|
2018-03-08 06:08:06 -06:00
|
|
|
|
|
|
|
std::vector<RimIntersectionCollection*> intersectionColls;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( tdView )
|
2018-03-08 06:08:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
tdView->descendantsIncludingThisOfType( intersectionColls );
|
|
|
|
if ( intersectionColls.size() == 1 )
|
2018-03-08 06:08:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto intersection : intersectionColls[0]->intersections() )
|
2018-03-08 06:08:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( intersection->simulationWell() == simWellInView )
|
2018-03-08 06:08:06 -06:00
|
|
|
{
|
|
|
|
return intersection->correspondingIntersectionView();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|