mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1044 - pre-proto - Updates in infrastructure for finding i,j,k for simulation well
This commit is contained in:
parent
a64c1dd447
commit
fe9ac8f908
@ -595,6 +595,18 @@ size_t RivPipeGeometryGenerator::segmentIndexFromTriangleIndex(size_t triangleIn
|
||||
return filteredIndex + m_firstSegmentIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RivPipeGeometryGenerator::pipeResultIndexFromTriangleIndex(size_t triangleIndex) const
|
||||
{
|
||||
size_t segIndex = segmentIndexFromTriangleIndex(triangleIndex);
|
||||
|
||||
size_t resultIndex = m_filteredPipeSegmentToResult[segIndex];
|
||||
|
||||
return resultIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Well pipes are clipped, set index to first segment in visible well path
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
|
||||
void setFirstSegmentIndex(size_t segmentIndex);
|
||||
size_t segmentIndexFromTriangleIndex(size_t triangleIndex) const;
|
||||
size_t pipeResultIndexFromTriangleIndex(size_t triangleIndex) const;
|
||||
|
||||
private:
|
||||
void clearComputedData();
|
||||
|
@ -142,9 +142,9 @@ void RivReservoirPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector< std::vector <cvf::Vec3d> >* RivReservoirPipesPartMgr::centerLineOfWellBranches(int wellIdx)
|
||||
const std::vector< std::vector <cvf::Vec3d> >* RivReservoirPipesPartMgr::centerLineOfWellBranches(size_t wellIdx)
|
||||
{
|
||||
if (wellIdx < static_cast<int>(m_wellPipesPartMgrs.size()))
|
||||
if (wellIdx < m_wellPipesPartMgrs.size())
|
||||
{
|
||||
return &(m_wellPipesPartMgrs[wellIdx]->centerLineOfWellBranches());
|
||||
}
|
||||
@ -152,3 +152,14 @@ const std::vector< std::vector <cvf::Vec3d> >* RivReservoirPipesPartMgr::centerL
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirPipesPartMgr::findGridIndexAndCellIndex(size_t wellIdx, size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex)
|
||||
{
|
||||
if (wellIdx < m_wellPipesPartMgrs.size())
|
||||
{
|
||||
m_wellPipesPartMgrs[wellIdx]->findGridIndexAndCellIndex(branchIndex, triangleIndex, gridIndex, cellIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,9 @@ public:
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
void updatePipeResultColor(size_t frameIndex);
|
||||
|
||||
const std::vector< std::vector <cvf::Vec3d> >* centerLineOfWellBranches(int wellIdx);
|
||||
const std::vector< std::vector <cvf::Vec3d> >* centerLineOfWellBranches(size_t wellIdx);
|
||||
|
||||
void findGridIndexAndCellIndex(size_t wellIdx, size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
#include "RivSimWellPipeSourceInfo.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -38,3 +40,17 @@ RimEclipseWell* RivSimWellPipeSourceInfo::well() const
|
||||
{
|
||||
return m_eclipseWell.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivSimWellPipeSourceInfo::findGridIndexAndCellIndex(size_t triangleIndex, size_t* gridIndex, size_t* gridCellIndex) const
|
||||
{
|
||||
RimEclipseView* rimEclView = nullptr;
|
||||
m_eclipseWell->firstAncestorOrThisOfType(rimEclView);
|
||||
|
||||
if (rimEclView)
|
||||
{
|
||||
rimEclView->findGridIndexAndCellIndex(m_eclipseWell.p(), m_branchIndex, triangleIndex, gridIndex, gridCellIndex);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ public:
|
||||
|
||||
RimEclipseWell* well() const;
|
||||
|
||||
void findGridIndexAndCellIndex(size_t triangleIndex, size_t* gridIndex, size_t* gridCellIndex) const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseWell> m_eclipseWell;
|
||||
size_t m_branchIndex;
|
||||
|
@ -1535,6 +1535,20 @@ RimCase* RimEclipseView::ownerCase()
|
||||
return eclipseCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::findGridIndexAndCellIndex(RimEclipseWell* eclipseWell, size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex)
|
||||
{
|
||||
CVF_ASSERT(eclipseWell);
|
||||
|
||||
size_t wellIndex = wellCollection->wells().index(eclipseWell);
|
||||
if (wellIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
m_pipesPartManager->findGridIndexAndCellIndex(wellIndex, branchIndex, triangleIndex, gridIndex, cellIndex);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -42,6 +42,7 @@ class RigGridBase;
|
||||
class RigGridCellFaceVisibilityFilter;
|
||||
class Rim3dOverlayInfoConfig;
|
||||
class RimEclipseCase;
|
||||
class RimEclipseWell;
|
||||
class RimCellEdgeColors;
|
||||
class RimEclipsePropertyFilter;
|
||||
class RimEclipsePropertyFilterCollection;
|
||||
@ -116,6 +117,8 @@ public:
|
||||
RimEclipseCase* eclipseCase();
|
||||
virtual RimCase* ownerCase();
|
||||
|
||||
void findGridIndexAndCellIndex(RimEclipseWell* eclipseWell, size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex);
|
||||
|
||||
// Display model generation
|
||||
|
||||
virtual void loadDataAndUpdate();
|
||||
|
Loading…
Reference in New Issue
Block a user