mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
@@ -46,71 +46,68 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
|||||||
{
|
{
|
||||||
std::map<RigMDCellIdxEnterLeaveIntersectionSorterKey, HexIntersectionInfo > uniqueIntersections;
|
std::map<RigMDCellIdxEnterLeaveIntersectionSorterKey, HexIntersectionInfo > uniqueIntersections;
|
||||||
|
|
||||||
|
const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes();
|
||||||
const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes();
|
bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards();
|
||||||
bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards();
|
|
||||||
|
|
||||||
if (!m_wellPath->m_wellPathPoints.size()) return ;
|
if (!m_wellPath->m_wellPathPoints.size()) return ;
|
||||||
|
|
||||||
for (size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp)
|
for (size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp)
|
||||||
|
{
|
||||||
|
std::vector<HexIntersectionInfo> intersections;
|
||||||
|
cvf::Vec3d p1 = m_wellPath->m_wellPathPoints[wpp];
|
||||||
|
cvf::Vec3d p2 = m_wellPath->m_wellPathPoints[wpp+1];
|
||||||
|
|
||||||
|
|
||||||
|
cvf::BoundingBox bb;
|
||||||
|
|
||||||
|
bb.add(p1);
|
||||||
|
bb.add(p2);
|
||||||
|
|
||||||
|
std::vector<size_t> closeCells = findCloseCells(bb);
|
||||||
|
|
||||||
|
|
||||||
|
cvf::Vec3d hexCorners[8];
|
||||||
|
for (size_t cIdx = 0; cIdx < closeCells.size(); ++cIdx)
|
||||||
{
|
{
|
||||||
std::vector<HexIntersectionInfo> intersections;
|
const RigCell& cell = m_caseData->mainGrid()->cells()[closeCells[cIdx]];
|
||||||
cvf::Vec3d p1 = m_wellPath->m_wellPathPoints[wpp];
|
const caf::SizeTArray8& cornerIndices = cell.cornerIndices();
|
||||||
cvf::Vec3d p2 = m_wellPath->m_wellPathPoints[wpp+1];
|
|
||||||
|
|
||||||
|
hexCorners[0] = nodeCoords[cornerIndices[0]];
|
||||||
cvf::BoundingBox bb;
|
hexCorners[1] = nodeCoords[cornerIndices[1]];
|
||||||
|
hexCorners[2] = nodeCoords[cornerIndices[2]];
|
||||||
bb.add(p1);
|
hexCorners[3] = nodeCoords[cornerIndices[3]];
|
||||||
bb.add(p2);
|
hexCorners[4] = nodeCoords[cornerIndices[4]];
|
||||||
|
hexCorners[5] = nodeCoords[cornerIndices[5]];
|
||||||
std::vector<size_t> closeCells = findCloseCells(bb);
|
hexCorners[6] = nodeCoords[cornerIndices[6]];
|
||||||
|
hexCorners[7] = nodeCoords[cornerIndices[7]];
|
||||||
|
|
||||||
cvf::Vec3d hexCorners[8];
|
|
||||||
for (size_t cIdx = 0; cIdx < closeCells.size(); ++cIdx)
|
|
||||||
{
|
|
||||||
const RigCell& cell = m_caseData->mainGrid()->cells()[closeCells[cIdx]];
|
|
||||||
const caf::SizeTArray8& cornerIndices = cell.cornerIndices();
|
|
||||||
|
|
||||||
hexCorners[0] = nodeCoords[cornerIndices[0]];
|
|
||||||
hexCorners[1] = nodeCoords[cornerIndices[1]];
|
|
||||||
hexCorners[2] = nodeCoords[cornerIndices[2]];
|
|
||||||
hexCorners[3] = nodeCoords[cornerIndices[3]];
|
|
||||||
hexCorners[4] = nodeCoords[cornerIndices[4]];
|
|
||||||
hexCorners[5] = nodeCoords[cornerIndices[5]];
|
|
||||||
hexCorners[6] = nodeCoords[cornerIndices[6]];
|
|
||||||
hexCorners[7] = nodeCoords[cornerIndices[7]];
|
|
||||||
|
|
||||||
int intersectionCount = RigHexIntersector::lineHexCellIntersection(p1, p2, hexCorners, closeCells[cIdx], &intersections);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isCellFaceNormalsOut)
|
|
||||||
{
|
|
||||||
for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx)
|
|
||||||
{
|
|
||||||
intersections[intIdx].m_isIntersectionEntering = !intersections[intIdx].m_isIntersectionEntering ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now, with all the intersections of this piece of line, we need to
|
|
||||||
// sort them in order, and set the measured depth and corresponding cell index
|
|
||||||
|
|
||||||
// Inserting the intersections in this map will remove identical intersections
|
|
||||||
// and sort them according to MD, CellIdx, Leave/enter
|
|
||||||
|
|
||||||
double md1 = m_wellPath->m_measuredDepths[wpp];
|
|
||||||
double md2 = m_wellPath->m_measuredDepths[wpp+1];
|
|
||||||
|
|
||||||
insertIntersectionsInMap(intersections,
|
|
||||||
p1, md1, p2, md2,
|
|
||||||
&uniqueIntersections);
|
|
||||||
|
|
||||||
|
int intersectionCount = RigHexIntersector::lineHexCellIntersection(p1, p2, hexCorners, closeCells[cIdx], &intersections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isCellFaceNormalsOut)
|
||||||
|
{
|
||||||
|
for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx)
|
||||||
|
{
|
||||||
|
intersections[intIdx].m_isIntersectionEntering = !intersections[intIdx].m_isIntersectionEntering ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now, with all the intersections of this piece of line, we need to
|
||||||
|
// sort them in order, and set the measured depth and corresponding cell index
|
||||||
|
|
||||||
|
// Inserting the intersections in this map will remove identical intersections
|
||||||
|
// and sort them according to MD, CellIdx, Leave/enter
|
||||||
|
|
||||||
|
double md1 = m_wellPath->m_measuredDepths[wpp];
|
||||||
|
double md2 = m_wellPath->m_measuredDepths[wpp+1];
|
||||||
|
|
||||||
|
insertIntersectionsInMap(intersections,
|
||||||
|
p1, md1, p2, md2,
|
||||||
|
&uniqueIntersections);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this->populateReturnArrays(uniqueIntersections);
|
this->populateReturnArrays(uniqueIntersections);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -116,8 +116,6 @@ void RigGeoMechWellLogExtractor::calculateIntersection()
|
|||||||
|
|
||||||
std::map<RigMDCellIdxEnterLeaveIntersectionSorterKey, HexIntersectionInfo > uniqueIntersections;
|
std::map<RigMDCellIdxEnterLeaveIntersectionSorterKey, HexIntersectionInfo > uniqueIntersections;
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
const RigFemPart* femPart = m_caseData->femParts()->part(0);
|
const RigFemPart* femPart = m_caseData->femParts()->part(0);
|
||||||
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
|
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
|
||||||
|
|
||||||
@@ -164,10 +162,8 @@ void RigGeoMechWellLogExtractor::calculateIntersection()
|
|||||||
double md2 = m_wellPath->m_measuredDepths[wpp+1];
|
double md2 = m_wellPath->m_measuredDepths[wpp+1];
|
||||||
|
|
||||||
insertIntersectionsInMap(intersections,
|
insertIntersectionsInMap(intersections,
|
||||||
p1, md1, p2, md2,
|
p1, md1, p2, md2,
|
||||||
&uniqueIntersections);
|
&uniqueIntersections);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this->populateReturnArrays(uniqueIntersections);
|
this->populateReturnArrays(uniqueIntersections);
|
||||||
|
|||||||
Reference in New Issue
Block a user