finalizing and cleaning up

This commit is contained in:
Paul Egberts 2023-01-30 21:34:09 +01:00
parent c617224adb
commit 83934226aa
8 changed files with 108 additions and 142 deletions

View File

@ -179,31 +179,26 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/Schedule/Well/WellTestConfig.cpp src/opm/input/eclipse/Schedule/Well/WellTestConfig.cpp
src/opm/input/eclipse/Schedule/Well/WellTestState.cpp src/opm/input/eclipse/Schedule/Well/WellTestState.cpp
src/opm/input/eclipse/Schedule/Well/WellTrajectory.cpp external/resinsight/LibCore/cvfAssert.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfAssert.cpp external/resinsight/LibCore/cvfAtomicCounter.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfAtomicCounter.cpp external/resinsight/LibCore/cvfCharArray.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfCharArray.cpp external/resinsight/LibCore/cvfMath.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfMath.cpp external/resinsight/LibCore/cvfObject.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfObject.cpp external/resinsight/LibCore/cvfPlane.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfPlane.cpp external/resinsight/LibCore/cvfString.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfString.cpp external/resinsight/LibCore/cvfSystem.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfSystem.cpp external/resinsight/LibCore/cvfVector3.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfVector3.cpp external/resinsight/LibGeometry/cvfBoundingBox.cpp
external/resinsight/LibGeometry/cvfBoundingBoxTree.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfBoundingBox.cpp external/resinsight/LibGeometry/cvfRay.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfBoundingBoxTree.cpp external/resinsight/ReservoirDataModel/cvfGeometryTools.cpp
external/resinsight/ReservoirDataModel/RigHexIntersectionTools.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfRay.cpp external/resinsight/ReservoirDataModel/RigWellLogExtractor.cpp
external/resinsight/ReservoirDataModel/RigWellPath.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/cvfGeometryTools.cpp external/resinsight/CommonCode/cvfStructGrid.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigHexIntersectionTools.cpp external/resinsight/cafPdmCore/cafSignal.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigWellLogExtractor.cpp external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigWellPath.cpp src/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/MyRigEclipseWellLogExtractor.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/CommonCode/cvfStructGrid.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/cafPdmCore/cafSignal.cpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp
src/opm/input/eclipse/EclipseState/SimulationConfig/BCConfig.cpp src/opm/input/eclipse/EclipseState/SimulationConfig/BCConfig.cpp
src/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp src/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp
@ -524,7 +519,6 @@ if(ENABLE_ECL_INPUT)
tests/parser/integration/NNCTests.cpp tests/parser/integration/NNCTests.cpp
tests/parser/WellSolventTests.cpp tests/parser/WellSolventTests.cpp
tests/parser/WellTracerTests.cpp tests/parser/WellTracerTests.cpp
tests/parser/WellTrajectoryTests.cpp
tests/parser/WellTests.cpp tests/parser/WellTests.cpp
tests/parser/WLIST.cpp tests/parser/WLIST.cpp
tests/parser/WriteRestartFileEventsTests.cpp tests/parser/WriteRestartFileEventsTests.cpp
@ -1136,37 +1130,28 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/Schedule/Well/WellTestState.hpp opm/input/eclipse/Schedule/Well/WellTestState.hpp
opm/input/eclipse/Schedule/Well/WellConnections.hpp opm/input/eclipse/Schedule/Well/WellConnections.hpp
src/opm/input/eclipse/Schedule/Well/WellTrajectory.hpp external/resinsight/LibCore/cvfAssert.h
external/resinsight/LibCore/cvfAtomicCounter.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfAssert.h external/resinsight/LibCore/cvfCharArray.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfAtomicCounter.h external/resinsight/LibCore/cvfMath.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfCharArray.h external/resinsight/LibCore/cvfObject.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfMath.h external/resinsight/LibCore/cvfObject.inl
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfObject.h external/resinsight/LibCore/cvfPlane.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfObject.inl external/resinsight/LibCore/cvfString.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfPlane.h external/resinsight/LibCore/cvfSystem.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfString.h external/resinsight/LibCore/cvfVector3.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfSystem.h external/resinsight/LibGeometry/cvfBoundingBox.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibCore/cvfVector3.h external/resinsight/LibGeometry/cvfBoundingBoxTree.h
external/resinsight/LibGeometry/cvfRay.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfBoundingBox.h external/resinsight/ReservoirDataModel/cvfGeometryTools.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfBoundingBoxTree.h external/resinsight/ReservoirDataModel/RigHexIntersectionTools.h
external/resinsight/ReservoirDataModel/RigWellLogExtractionTools.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfRay.h external/resinsight/ReservoirDataModel/RigWellLogExtractor.h
external/resinsight/ReservoirDataModel/RigWellPath.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/cvfGeometryTools.h external/resinsight/CommonCode/cvfStructGrid.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigHexIntersectionTools.h external/resinsight/cafPdmCore/cafSignal.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigWellLogExtractionTools.h external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigWellLogExtractor.h opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.hpp
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/RigWellPath.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/ReservoirDataModel/MyRigEclipseWellLogExtractor.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/CommonCode/cvfStructGrid.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/cafPdmCore/cafSignal.h
src/opm/input/eclipse/Schedule/WellTrajResInsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.h
opm/input/eclipse/Schedule/SummaryState.hpp opm/input/eclipse/Schedule/SummaryState.hpp
opm/input/eclipse/Schedule/RFTConfig.hpp opm/input/eclipse/Schedule/RFTConfig.hpp

4
external/resinsight/README.opm vendored Normal file
View File

@ -0,0 +1,4 @@
This directory contains a selection of files from ResInsight(https://github.com/OPM/ResInsight).
This part of the code of ResInsight is used within OPM-Flow to calculate,
given a geometric (thus grid-independent) well trajectory the I,J,K coordinates of intersected cells
and the well line segments within these cells.

View File

@ -689,6 +689,7 @@ namespace Opm
void handleCOMPLUMP (HandlerContext&); void handleCOMPLUMP (HandlerContext&);
void handleCOMPORD (HandlerContext&); void handleCOMPORD (HandlerContext&);
void handleCOMPSEGS (HandlerContext&); void handleCOMPSEGS (HandlerContext&);
void handleCOMPTRAJ (HandlerContext&);
void handleDRSDT (HandlerContext&); void handleDRSDT (HandlerContext&);
void handleDRSDTCON (HandlerContext&); void handleDRSDTCON (HandlerContext&);
void handleDRSDTR (HandlerContext&); void handleDRSDTR (HandlerContext&);
@ -731,7 +732,6 @@ namespace Opm
void handleWCONPROD (HandlerContext&); void handleWCONPROD (HandlerContext&);
void handleWECON (HandlerContext&); void handleWECON (HandlerContext&);
void handleWEFAC (HandlerContext&); void handleWEFAC (HandlerContext&);
void handleWELCOMPL (HandlerContext&);
void handleWELOPEN (HandlerContext&); void handleWELOPEN (HandlerContext&);
void handleWELPI (HandlerContext&); void handleWELPI (HandlerContext&);
void handleWELSEGS (HandlerContext&); void handleWELSEGS (HandlerContext&);

View File

@ -20,6 +20,7 @@
#define SCHEDULE_GRID #define SCHEDULE_GRID
#include <opm/input/eclipse/Schedule/CompletedCells.hpp> #include <opm/input/eclipse/Schedule/CompletedCells.hpp>
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
namespace Opm { namespace Opm {
@ -32,6 +33,7 @@ public:
explicit ScheduleGrid(CompletedCells& completed_cells); explicit ScheduleGrid(CompletedCells& completed_cells);
const CompletedCells::Cell& get_cell(std::size_t i, std::size_t j, std::size_t k) const; const CompletedCells::Cell& get_cell(std::size_t i, std::size_t j, std::size_t k) const;
const Opm::EclipseGrid* get_grid() const;
private: private:
const EclipseGrid* grid{nullptr}; const EclipseGrid* grid{nullptr};

View File

@ -19,8 +19,8 @@
#pragma once #pragma once
#include "RigWellLogExtractor.h" #include <external/resinsight/ReservoirDataModel/RigWellLogExtractor.h>
#include <src/opm/input/eclipse/Schedule/WellTrajResInsight/LibGeometry/cvfBoundingBoxTree.h> #include <external/resinsight/LibGeometry/cvfBoundingBoxTree.h>
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp> #include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/input/eclipse/Schedule/ScheduleGrid.hpp> #include <opm/input/eclipse/Schedule/ScheduleGrid.hpp>
@ -40,10 +40,10 @@ class BoundingBox;
//================================================================================================== //==================================================================================================
/// ///
//================================================================================================== //==================================================================================================
class MyRigEclipseWellLogExtractor : public RigWellLogExtractor class RigEclipseWellLogExtractor : public RigWellLogExtractor
{ {
public: public:
MyRigEclipseWellLogExtractor( const RigWellPath* wellpath, const Opm::EclipseGrid& grid, cvf::ref<cvf::BoundingBoxTree>& cellSearchTree); RigEclipseWellLogExtractor( const RigWellPath* wellpath, const Opm::EclipseGrid& grid, cvf::ref<cvf::BoundingBoxTree>& cellSearchTree);
cvf::ref<cvf::BoundingBoxTree> getCellSearchTree(); cvf::ref<cvf::BoundingBoxTree> getCellSearchTree();
private: private:

View File

@ -85,6 +85,8 @@
#include "Well/injection.hpp" #include "Well/injection.hpp"
#include <external/resinsight/LibGeometry/cvfBoundingBoxTree.h>
namespace Opm { namespace Opm {
namespace { namespace {
@ -189,8 +191,29 @@ namespace {
auto well2 = this->snapshots.back().wells.get(name); auto well2 = this->snapshots.back().wells.get(name);
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2.getConnections())); auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2.getConnections()));
connections->loadWELTRAJ(record, handlerContext.grid, name, handlerContext.keyword.location()); connections->loadWELTRAJ(record, handlerContext.grid, name, handlerContext.keyword.location());
//what to do here? need here something like updateTrajectory if (well2.updateConnections(connections, handlerContext.grid)) {
//maybe new method WellConnection::addTrajectory? this->snapshots.back().wells.update( well2 );
wells.insert( name );
}
this->snapshots.back().wellgroup_events().addEvent( name, ScheduleEvents::COMPLETION_CHANGE);
}
}
this->snapshots.back().events().addEvent(ScheduleEvents::COMPLETION_CHANGE);
}
void Schedule::handleCOMPTRAJ(HandlerContext& handlerContext) {
// Keyword WELTRAJ must be read first
std::unordered_set<std::string> wells;
cvf::ref<cvf::BoundingBoxTree> cellSearchTree = nullptr;
for (const auto& record : handlerContext.keyword) {
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);
auto wellnames = this->wellNames(wellNamePattern, handlerContext );
for (const auto& name : wellnames) {
auto well2 = this->snapshots.back().wells.get(name);
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2.getConnections()));
// cellsearchTree is calculated only once and is used to calculated cell intersections of the perforations specified in COMPTRAJ
connections->loadCOMPTRAJ(record, handlerContext.grid, name, handlerContext.keyword.location(), cellSearchTree);
if (well2.updateConnections(connections, handlerContext.grid)) { if (well2.updateConnections(connections, handlerContext.grid)) {
this->snapshots.back().wells.update( well2 ); this->snapshots.back().wells.update( well2 );
wells.insert( name ); wells.insert( name );
@ -198,7 +221,7 @@ namespace {
if (connections->empty() && well2.getConnections().empty()) { if (connections->empty() && well2.getConnections().empty()) {
const auto& location = handlerContext.keyword.location(); const auto& location = handlerContext.keyword.location();
auto msg = fmt::format("Problem with COMPDAT/{}\n" auto msg = fmt::format("Problem with COMPTRAJ/{}\n"
"In {} line {}\n" "In {} line {}\n"
"Well {} is not connected to grid - will remain SHUT", name, location.filename, location.lineno, name); "Well {} is not connected to grid - will remain SHUT", name, location.filename, location.lineno, name);
OpmLog::warning(msg); OpmLog::warning(msg);
@ -210,53 +233,13 @@ namespace {
// In the case the wells reference depth has been defaulted in the // In the case the wells reference depth has been defaulted in the
// WELSPECS keyword we need to force a calculation of the wells // WELSPECS keyword we need to force a calculation of the wells
// reference depth exactly when the COMPDAT keyword has been completely // reference depth exactly when the WELCOML keyword has been completely
// processed. // processed.
// for (const auto& wname : wells) { for (const auto& wname : wells) {
// auto& well = this->snapshots.back().wells.get( wname ); auto& well = this->snapshots.back().wells.get( wname );
// well.updateRefDepth(); well.updateRefDepth();
// this->snapshots.back().wells.update( std::move(well)); this->snapshots.back().wells.update( std::move(well));
// }
}
void Schedule::handleWELCOMPL(HandlerContext& handlerContext) {
//WELTRAJ should have been read first: ijk of trajectory is known
//update of connection
std::unordered_set<std::string> wells;
for (const auto& record : handlerContext.keyword) {
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);
auto wellnames = this->wellNames(wellNamePattern, handlerContext );
for (const auto& name : wellnames) {
auto well2 = this->snapshots.back().wells.get(name);
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2.getConnections()));
connections->loadWELCOMPL(record, handlerContext.grid, name, handlerContext.keyword.location());
// if (well2.updateConnections(connections, handlerContext.grid)) {
// this->snapshots.back().wells.update( well2 );
// wells.insert( name );
// }
// if (connections->empty() && well2.getConnections().empty()) {
// const auto& location = handlerContext.keyword.location();
// auto msg = fmt::format("Problem with COMPDAT/{}\n"
// "In {} line {}\n"
// "Well {} is not connected to grid - will remain SHUT", name, location.filename, location.lineno, name);
// OpmLog::warning(msg);
// }
// this->snapshots.back().wellgroup_events().addEvent( name, ScheduleEvents::COMPLETION_CHANGE);
}
} }
this->snapshots.back().events().addEvent(ScheduleEvents::COMPLETION_CHANGE);
// In the case the wells reference depth has been defaulted in the
// WELSPECS keyword we need to force a calculation of the wells
// reference depth exactly when the COMPDAT keyword has been completely
// processed.
// for (const auto& wname : wells) {
// auto& well = this->snapshots.back().wells.get( wname );
// well.updateRefDepth();
// this->snapshots.back().wells.update( std::move(well));
// }
} }
void Schedule::handleCOMPLUMP(HandlerContext& handlerContext) { void Schedule::handleCOMPLUMP(HandlerContext& handlerContext) {
@ -2321,6 +2304,7 @@ Well{0} entered with disallowed 'FIELD' parent group:
{ "COMPLUMP", &Schedule::handleCOMPLUMP }, { "COMPLUMP", &Schedule::handleCOMPLUMP },
{ "COMPORD" , &Schedule::handleCOMPORD }, { "COMPORD" , &Schedule::handleCOMPORD },
{ "COMPSEGS", &Schedule::handleCOMPSEGS }, { "COMPSEGS", &Schedule::handleCOMPSEGS },
{ "COMPTRAJ", &Schedule::handleCOMPTRAJ },
{ "DRSDT" , &Schedule::handleDRSDT }, { "DRSDT" , &Schedule::handleDRSDT },
{ "DRSDTCON", &Schedule::handleDRSDTCON }, { "DRSDTCON", &Schedule::handleDRSDTCON },
{ "DRSDTR" , &Schedule::handleDRSDTR }, { "DRSDTR" , &Schedule::handleDRSDTR },
@ -2378,7 +2362,6 @@ Well{0} entered with disallowed 'FIELD' parent group:
{ "WCONPROD", &Schedule::handleWCONPROD }, { "WCONPROD", &Schedule::handleWCONPROD },
{ "WECON" , &Schedule::handleWECON }, { "WECON" , &Schedule::handleWECON },
{ "WEFAC" , &Schedule::handleWEFAC }, { "WEFAC" , &Schedule::handleWEFAC },
{ "WELCOMPL", &Schedule::handleWELCOMPL },
{ "WELOPEN" , &Schedule::handleWELOPEN }, { "WELOPEN" , &Schedule::handleWELOPEN },
{ "WELPI" , &Schedule::handleWELPI }, { "WELPI" , &Schedule::handleWELPI },
{ "WELSEGS" , &Schedule::handleWELSEGS }, { "WELSEGS" , &Schedule::handleWELSEGS },

View File

@ -33,7 +33,6 @@ Opm::ScheduleGrid::ScheduleGrid(Opm::CompletedCells& completed_cells)
: cells(completed_cells) : cells(completed_cells)
{} {}
namespace { namespace {
double try_get_value(const Opm::FieldPropsManager& fp, const std::string& kw, std::size_t active_index) { double try_get_value(const Opm::FieldPropsManager& fp, const std::string& kw, std::size_t active_index) {
if (fp.has_double(kw)) if (fp.has_double(kw))
@ -74,3 +73,6 @@ const Opm::CompletedCells::Cell& Opm::ScheduleGrid::get_cell(std::size_t i, std:
return this->cells.get(i,j,k); return this->cells.get(i,j,k);
} }
const Opm::EclipseGrid* Opm::ScheduleGrid::get_grid() const {
return this->grid;
}

View File

@ -19,15 +19,14 @@
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp> #include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/input/eclipse/Schedule/ScheduleGrid.hpp> #include <opm/input/eclipse/Schedule/ScheduleGrid.hpp>
#include "MyRigEclipseWellLogExtractor.h" #include <opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.hpp>
#include "RigWellLogExtractionTools.h" #include <external/resinsight/ReservoirDataModel/RigWellLogExtractionTools.h>
#include "RigWellPath.h" #include <external/resinsight/ReservoirDataModel/RigWellPath.h>
#include <external/resinsight/ReservoirDataModel/cvfGeometryTools.h>
#include "../LibGeometry/cvfBoundingBox.h" #include <external/resinsight/ReservoirDataModel/RigWellLogExtractor.h>
#include "cvfGeometryTools.h" #include <external/resinsight/ReservoirDataModel/RigCellGeometryTools.h>
#include "RigWellLogExtractor.h" #include <external/resinsight/CommonCode/cvfStructGrid.h>
#include "RigCellGeometryTools.h" #include <external/resinsight/LibGeometry/cvfBoundingBox.h>
#include "../CommonCode/cvfStructGrid.h"
#include <map> #include <map>
@ -35,7 +34,7 @@
/// ///
//================================================================================================== //==================================================================================================
MyRigEclipseWellLogExtractor::MyRigEclipseWellLogExtractor(const RigWellPath* wellpath, const Opm::EclipseGrid& grid, cvf::ref<cvf::BoundingBoxTree>& cellSearchTree) RigEclipseWellLogExtractor::RigEclipseWellLogExtractor(const RigWellPath* wellpath, const Opm::EclipseGrid& grid, cvf::ref<cvf::BoundingBoxTree>& cellSearchTree)
: RigWellLogExtractor( wellpath, "" ) : RigWellLogExtractor( wellpath, "" )
,m_grid(grid) ,m_grid(grid)
,m_cellSearchTree(cellSearchTree) ,m_cellSearchTree(cellSearchTree)
@ -46,7 +45,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void MyRigEclipseWellLogExtractor::calculateIntersection() void RigEclipseWellLogExtractor::calculateIntersection()
{ {
std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo> uniqueIntersections; std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo> uniqueIntersections;
@ -115,7 +114,7 @@ void MyRigEclipseWellLogExtractor::calculateIntersection()
} }
cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex, cvf::Vec3d RigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex,
const cvf::Vec3d& startPoint, const cvf::Vec3d& startPoint,
const cvf::Vec3d& endPoint ) const const cvf::Vec3d& endPoint ) const
{ {
@ -136,11 +135,11 @@ cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( size_t
hexCorners[6] = hexCorners_opm[7]; hexCorners[6] = hexCorners_opm[7];
hexCorners[7] = hexCorners_opm[6]; hexCorners[7] = hexCorners_opm[6];
return MyRigEclipseWellLogExtractor::calculateLengthInCell( hexCorners, startPoint, endPoint ); return RigEclipseWellLogExtractor::calculateLengthInCell( hexCorners, startPoint, endPoint );
} }
cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( const std::array<cvf::Vec3d, 8>& hexCorners, cvf::Vec3d RigEclipseWellLogExtractor::calculateLengthInCell( const std::array<cvf::Vec3d, 8>& hexCorners,
const cvf::Vec3d& startPoint, const cvf::Vec3d& startPoint,
const cvf::Vec3d& endPoint ) const const cvf::Vec3d& endPoint ) const
{ {
@ -150,7 +149,7 @@ cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( const std::array
cvf::Vec3d jAxisDirection; cvf::Vec3d jAxisDirection;
cvf::Vec3d kAxisDirection; cvf::Vec3d kAxisDirection;
MyRigEclipseWellLogExtractor::findCellLocalXYZ( hexCorners, iAxisDirection, jAxisDirection, kAxisDirection ); RigEclipseWellLogExtractor::findCellLocalXYZ( hexCorners, iAxisDirection, jAxisDirection, kAxisDirection );
cvf::Mat3d localCellCoordinateSystem( iAxisDirection.x(), cvf::Mat3d localCellCoordinateSystem( iAxisDirection.x(),
jAxisDirection.x(), jAxisDirection.x(),
@ -170,7 +169,7 @@ cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( const std::array
//================================================================================================== //==================================================================================================
/// ///
//================================================================================================== //==================================================================================================
void MyRigEclipseWellLogExtractor::findCellLocalXYZ( const std::array<cvf::Vec3d, 8>& hexCorners, void RigEclipseWellLogExtractor::findCellLocalXYZ( const std::array<cvf::Vec3d, 8>& hexCorners,
cvf::Vec3d& localXdirection, cvf::Vec3d& localXdirection,
cvf::Vec3d& localYdirection, cvf::Vec3d& localYdirection,
cvf::Vec3d& localZdirection ) const cvf::Vec3d& localZdirection ) const
@ -247,7 +246,7 @@ void MyRigEclipseWellLogExtractor::findCellLocalXYZ( const std::array<cvf::Vec3d
localYdirection.normalize(); localYdirection.normalize();
} }
void MyRigEclipseWellLogExtractor::buildCellSearchTree() void RigEclipseWellLogExtractor::buildCellSearchTree()
{ {
if (m_cellSearchTree.isNull()) { if (m_cellSearchTree.isNull()) {
@ -304,30 +303,21 @@ void MyRigEclipseWellLogExtractor::buildCellSearchTree()
} }
} }
void MyRigEclipseWellLogExtractor::computeCachedData() void RigEclipseWellLogExtractor::findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices ) const
{
// initAllSubGridsParentGridPointer();
// initAllSubCellsMainGridCellIndex();
m_cellSearchTree = nullptr;
buildCellSearchTree();
}
void MyRigEclipseWellLogExtractor::findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices ) const
{ {
CVF_ASSERT( m_cellSearchTree.notNull() ); CVF_ASSERT( m_cellSearchTree.notNull() );
m_cellSearchTree->findIntersections( inputBB, cellIndices ); m_cellSearchTree->findIntersections( inputBB, cellIndices );
} }
std::vector<size_t> MyRigEclipseWellLogExtractor::findCloseCellIndices( const cvf::BoundingBox& bb ) std::vector<size_t> RigEclipseWellLogExtractor::findCloseCellIndices( const cvf::BoundingBox& bb )
{ {
std::vector<size_t> closeCells; std::vector<size_t> closeCells;
this->findIntersectingCells( bb, &closeCells ); this->findIntersectingCells( bb, &closeCells );
return closeCells; return closeCells;
} }
cvf::ref<cvf::BoundingBoxTree> MyRigEclipseWellLogExtractor::getCellSearchTree() cvf::ref<cvf::BoundingBoxTree> RigEclipseWellLogExtractor::getCellSearchTree()
{ {
return m_cellSearchTree; return m_cellSearchTree;
} }