mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#399) WellLog extraction from GeoMech cases works.
Needs more testing, and performance must be fixed see (#415)
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "cvfAssert.h"
|
||||
#include "RimDefines.h"
|
||||
#include "RigFault.h"
|
||||
#include "cvfBoundingBoxTree.h"
|
||||
|
||||
|
||||
RigMainGrid::RigMainGrid(void)
|
||||
@@ -441,3 +442,38 @@ const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace(size_t reservoirC
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices)
|
||||
{
|
||||
if (m_cellSearchTree.isNull())
|
||||
{
|
||||
// build tree
|
||||
|
||||
size_t cellCount = m_cells.size();
|
||||
|
||||
std::vector<cvf::BoundingBox> cellBoundingBoxes;
|
||||
cellBoundingBoxes.resize(cellCount);
|
||||
|
||||
for (size_t cIdx = 0; cIdx < cellCount; ++cIdx)
|
||||
{
|
||||
const caf::SizeTArray8& cellIndices = m_cells[cIdx].cornerIndices();
|
||||
cvf::BoundingBox& cellBB = cellBoundingBoxes[cIdx];
|
||||
cellBB.add(m_nodes[cellIndices[0]]);
|
||||
cellBB.add(m_nodes[cellIndices[1]]);
|
||||
cellBB.add(m_nodes[cellIndices[2]]);
|
||||
cellBB.add(m_nodes[cellIndices[3]]);
|
||||
cellBB.add(m_nodes[cellIndices[4]]);
|
||||
cellBB.add(m_nodes[cellIndices[5]]);
|
||||
cellBB.add(m_nodes[cellIndices[6]]);
|
||||
cellBB.add(m_nodes[cellIndices[7]]);
|
||||
}
|
||||
|
||||
m_cellSearchTree = new cvf::BoundingBoxTree;
|
||||
m_cellSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, NULL);
|
||||
}
|
||||
|
||||
m_cellSearchTree->findIntersections(inputBB, cellIndices);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user