#2748 Completion Type Calculations : Use findIntersectedGlobalCellIndices

This commit is contained in:
Magne Sjaastad
2018-04-17 14:42:15 +02:00
parent 7a2979ca56
commit ba3074ff08
5 changed files with 163 additions and 91 deletions
@@ -2259,7 +2259,7 @@ void RigCaseCellResultsData::computeCompletionTypeForTimeStep(size_t timeStep)
QDateTime timeStepDate = this->timeStepDates()[timeStep];
RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(project, eclipseCase, m_ownerMainGrid, completionTypeResult, timeStepDate);
RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(project, eclipseCase, completionTypeResult, timeStepDate);
}
@@ -20,17 +20,19 @@
#include "RiaLogging.h"
#include "RigWellPath.h"
#include "RigMainGrid.h"
#include "RigEclipseCaseData.h"
#include "RigWellLogExtractionTools.h"
#include "RigCellGeometryTools.h"
#include "cvfGeometryTools.h"
#include "cvfMatrix3.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseWellLogExtractor.h"
#include "RigMainGrid.h"
#include "RigSimulationWellCoordsAndMD.h"
#include "RigWellLogExtractionTools.h"
#include "RigWellPath.h"
#include "RimEclipseCase.h"
//#include "cvfGeometryTools.h"
//#include "cvfMatrix3.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -54,6 +56,46 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
return extractor->cellIntersectionInfosAlongWellPath();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<size_t> RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(const RigEclipseCaseData* caseData,
const std::vector<cvf::Vec3d>& coords,
const std::vector<double>& measuredDepths)
{
std::set<size_t> globalCellIndices;
if (caseData)
{
cvf::ref<RigWellPath> dummyWellPath = new RigWellPath;
if (measuredDepths.size() == coords.size())
{
dummyWellPath->m_wellPathPoints = coords;
dummyWellPath->m_measuredDepths = measuredDepths;
}
else
{
RigSimulationWellCoordsAndMD helper(coords);
dummyWellPath->m_wellPathPoints = helper.wellPathPoints();
dummyWellPath->m_measuredDepths = helper.measuredDepths();
}
cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor(caseData,
dummyWellPath.p(),
caseData->ownerCase()->caseUserDescription().toStdString());
std::vector<WellPathCellIntersectionInfo> intersections = extractor->cellIntersectionInfosAlongWellPath();
for (const auto& intersection : intersections)
{
globalCellIndices.insert(intersection.globCellIndex);
}
}
return globalCellIndices;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -40,6 +40,10 @@ public:
const std::vector<cvf::Vec3d>& pathCoords,
const std::vector<double>& pathMds);
static std::set<size_t> findIntersectedGlobalCellIndices(const RigEclipseCaseData* caseData,
const std::vector<cvf::Vec3d>& coords,
const std::vector<double>& measuredDepths = {});
static std::vector<HexIntersectionInfo> findRawHexCellIntersections(const RigMainGrid* grid, const std::vector<cvf::Vec3d>& coords);
static cvf::Vec3d calculateLengthInCell(const std::array<cvf::Vec3d, 8>& hexCorners,