mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added branch index to source info as basis for more work on #1044
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "RivPipeGeometryGenerator.h"
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
#include "RivWellPipeSourceInfo.h"
|
||||
#include "RivSimWellPipeSourceInfo.h"
|
||||
|
||||
#include "cafEffectGenerator.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@@ -107,10 +107,11 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
|
||||
double characteristicCellSize = m_rimReservoirView->eclipseCase()->reservoirData()->mainGrid()->characteristicIJCellSize();
|
||||
double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize;
|
||||
|
||||
cvf::ref<RivEclipseWellSourceInfo> sourceInfo = new RivEclipseWellSourceInfo(m_rimWell);
|
||||
|
||||
for (size_t brIdx = 0; brIdx < pipeBranchesCellIds.size(); ++brIdx)
|
||||
{
|
||||
cvf::ref<RivSimWellPipeSourceInfo> sourceInfo = new RivSimWellPipeSourceInfo(m_rimWell, brIdx);
|
||||
|
||||
m_wellBranches.push_back(RivPipeBranchData());
|
||||
RivPipeBranchData& pbd = m_wellBranches.back();
|
||||
|
||||
@@ -168,6 +169,27 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
|
||||
m_needsTransformUpdate = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivSimWellPipesPartMgr::RivPipeBranchData* RivSimWellPipesPartMgr::pipeBranchData(size_t branchIndex)
|
||||
{
|
||||
if (branchIndex < m_wellBranches.size())
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
auto brIt = m_wellBranches.begin();
|
||||
while (i < branchIndex)
|
||||
{
|
||||
brIt++;
|
||||
}
|
||||
|
||||
return &(*brIt);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -305,3 +327,25 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivSimWellPipesPartMgr::findGridIndexAndCellIndex(size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex)
|
||||
{
|
||||
CVF_ASSERT(branchIndex < m_wellBranches.size());
|
||||
|
||||
RivPipeBranchData* branchData = pipeBranchData(branchIndex);
|
||||
if (branchData)
|
||||
{
|
||||
size_t segmentIndex = branchData->m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex);
|
||||
|
||||
*gridIndex = branchData->m_cellIds[segmentIndex].m_gridIndex;
|
||||
*cellIndex = branchData->m_cellIds[segmentIndex].m_gridCellIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
*gridIndex = cvf::UNDEFINED_SIZE_T;
|
||||
*cellIndex = cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user