#2748 Completion Type Calculations : Remove unused code

This commit is contained in:
Magne Sjaastad 2018-04-17 14:41:50 +02:00
parent ba3074ff08
commit f3a235b9df
4 changed files with 49 additions and 114 deletions

View File

@ -210,11 +210,11 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLate
if (!wellPath) return;
if (!wellPath->wellPathGeometry()) return;
std::set<size_t> wellPathCells = RicFishbonesTransmissibilityCalculationFeatureImp::findIntersectedCells(settings.caseToApply()->eclipseCaseData(),
wellPath->wellPathGeometry()->m_wellPathPoints);
bool isMainBore = false;
std::set<size_t> wellPathCells = RigWellPathIntersectionTools::findIntersectedGlobalCellIndicesForWellPath(
settings.caseToApply()->eclipseCaseData(), wellPath->wellPathGeometry());
bool isMainBore = false;
double diameter = wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter(unitSystem);
for (const RimFishboneWellPath* fishbonesPath : wellPath->fishbonesCollection()->wellPathCollection()->wellPaths())
{
@ -282,23 +282,3 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findMainWellBoreParts(st
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<size_t> RicFishbonesTransmissibilityCalculationFeatureImp::findIntersectedCells(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords)
{
std::set<size_t> cells;
if (!caseData)
{
return cells;
}
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(caseData->mainGrid(), coords);
for (auto intersection : intersections)
{
cells.insert(intersection.m_hexIndex);
}
return cells;
}

View File

@ -56,6 +56,4 @@ private:
static void findMainWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings);
static std::set<size_t> findIntersectedCells(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords);
};

View File

@ -30,8 +30,6 @@
#include "RimEclipseCase.h"
//#include "cvfGeometryTools.h"
//#include "cvfMatrix3.h"
//--------------------------------------------------------------------------------------------------
///
@ -56,6 +54,30 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
return extractor->cellIntersectionInfosAlongWellPath();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<size_t> RigWellPathIntersectionTools::findIntersectedGlobalCellIndicesForWellPath(const RigEclipseCaseData* caseData, const RigWellPath* wellPath)
{
std::set<size_t> globalCellIndices;
if (caseData)
{
cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor(caseData,
wellPath,
caseData->ownerCase()->caseUserDescription().toStdString());
std::vector<WellPathCellIntersectionInfo> intersections = extractor->cellIntersectionInfosAlongWellPath();
for (const auto& intersection : intersections)
{
globalCellIndices.insert(intersection.globCellIndex);
}
}
return globalCellIndices;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -82,51 +104,12 @@ std::set<size_t> RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(
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);
}
globalCellIndices = findIntersectedGlobalCellIndicesForWellPath(caseData, dummyWellPath.p());
}
return globalCellIndices;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<HexIntersectionInfo> RigWellPathIntersectionTools::findRawHexCellIntersections(const RigMainGrid* grid,
const std::vector<cvf::Vec3d>& coords)
{
std::vector<HexIntersectionInfo> intersections;
for (size_t i = 0; i < coords.size() - 1; ++i)
{
cvf::BoundingBox bb;
bb.add(coords[i]);
bb.add(coords[i + 1]);
std::vector<size_t> closeCells = findCloseCells(grid, bb);
std::array<cvf::Vec3d, 8> hexCorners;
for (size_t closeCell : closeCells)
{
const RigCell& cell = grid->globalCellArray()[closeCell];
if (cell.isInvalid()) continue;
grid->cellCornerVertices(closeCell, hexCorners.data());
RigHexIntersectionTools::lineHexCellIntersection(coords[i], coords[i + 1], hexCorners.data(), closeCell, &intersections);
}
}
return intersections;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -172,30 +155,3 @@ std::vector<size_t> RigWellPathIntersectionTools::findCloseCells(const RigMainGr
return closeCells;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigWellPathIntersectionTools::findCellFromCoords(const RigMainGrid* grid, const cvf::Vec3d& coords, bool* foundCell)
{
cvf::BoundingBox bb;
bb.add(coords);
std::vector<size_t> closeCells = findCloseCells(grid, bb);
std::array<cvf::Vec3d, 8> hexCorners;
for (size_t closeCell : closeCells)
{
const RigCell& cell = grid->globalCellArray()[closeCell];
if (cell.isInvalid()) continue;
grid->cellCornerVertices(closeCell, hexCorners.data());
if (RigHexIntersectionTools::isPointInCell(coords, hexCorners.data()))
{
*foundCell = true;
return closeCell;
}
}
*foundCell = false;
return 0;
}

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -19,8 +19,8 @@
#pragma once
#include "cvfBase.h"
#include "cvfVector3.h"
#include "cvfBoundingBox.h"
#include "cvfVector3.h"
#include <array>
@ -31,30 +31,31 @@ struct HexIntersectionInfo;
struct WellPathCellIntersectionInfo;
//==================================================================================================
///
///
//==================================================================================================
class RigWellPathIntersectionTools
{
public:
static std::vector<WellPathCellIntersectionInfo> findCellIntersectionInfosAlongPath(const RigEclipseCaseData* caseData,
static std::vector<WellPathCellIntersectionInfo> findCellIntersectionInfosAlongPath(const RigEclipseCaseData* caseData,
const std::vector<cvf::Vec3d>& pathCoords,
const std::vector<double>& pathMds);
const std::vector<double>& pathMds);
static std::set<size_t> findIntersectedGlobalCellIndicesForWellPath(const RigEclipseCaseData* caseData,
const RigWellPath* wellPath);
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,
const cvf::Vec3d& startPoint,
const cvf::Vec3d& endPoint);
static cvf::Vec3d calculateLengthInCell(const std::array<cvf::Vec3d, 8>& hexCorners,
const cvf::Vec3d& startPoint,
const cvf::Vec3d& endPoint);
static cvf::Vec3d calculateLengthInCell(const RigMainGrid* grid,
size_t cellIndex,
const cvf::Vec3d& startPoint,
const cvf::Vec3d& endPoint);
static std::vector<size_t> findCloseCells(const RigMainGrid* grid, const cvf::BoundingBox& bb);
static size_t findCellFromCoords(const RigMainGrid* caseData, const cvf::Vec3d& coords, bool* foundCell);
static cvf::Vec3d calculateLengthInCell(const RigMainGrid* grid,
size_t cellIndex,
const cvf::Vec3d& startPoint,
const cvf::Vec3d& endPoint);
private:
static std::vector<size_t> findCloseCells(const RigMainGrid* grid, const cvf::BoundingBox& bb);
};