diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/CommonCode/cvfStructGrid.cpp b/external/resinsight/CommonCode/cvfStructGrid.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/CommonCode/cvfStructGrid.cpp rename to external/resinsight/CommonCode/cvfStructGrid.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/CommonCode/cvfStructGrid.h b/external/resinsight/CommonCode/cvfStructGrid.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/CommonCode/cvfStructGrid.h rename to external/resinsight/CommonCode/cvfStructGrid.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/CMakeLists.txt b/external/resinsight/LibCore/CMakeLists.txt similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/CMakeLists.txt rename to external/resinsight/LibCore/CMakeLists.txt diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/LibCore.vcxproj b/external/resinsight/LibCore/LibCore.vcxproj similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/LibCore.vcxproj rename to external/resinsight/LibCore/LibCore.vcxproj diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/LibCore.vcxproj.filters b/external/resinsight/LibCore/LibCore.vcxproj.filters similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/LibCore.vcxproj.filters rename to external/resinsight/LibCore/LibCore.vcxproj.filters diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArray.h b/external/resinsight/LibCore/cvfArray.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArray.h rename to external/resinsight/LibCore/cvfArray.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArray.inl b/external/resinsight/LibCore/cvfArray.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArray.inl rename to external/resinsight/LibCore/cvfArray.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArrayWrapperConst.h b/external/resinsight/LibCore/cvfArrayWrapperConst.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArrayWrapperConst.h rename to external/resinsight/LibCore/cvfArrayWrapperConst.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArrayWrapperToEdit.h b/external/resinsight/LibCore/cvfArrayWrapperToEdit.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfArrayWrapperToEdit.h rename to external/resinsight/LibCore/cvfArrayWrapperToEdit.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAssert.cpp b/external/resinsight/LibCore/cvfAssert.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAssert.cpp rename to external/resinsight/LibCore/cvfAssert.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAssert.h b/external/resinsight/LibCore/cvfAssert.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAssert.h rename to external/resinsight/LibCore/cvfAssert.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAtomicCounter.cpp b/external/resinsight/LibCore/cvfAtomicCounter.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAtomicCounter.cpp rename to external/resinsight/LibCore/cvfAtomicCounter.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAtomicCounter.h b/external/resinsight/LibCore/cvfAtomicCounter.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfAtomicCounter.h rename to external/resinsight/LibCore/cvfAtomicCounter.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfBase.h b/external/resinsight/LibCore/cvfBase.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfBase.h rename to external/resinsight/LibCore/cvfBase.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfBase64.cpp b/external/resinsight/LibCore/cvfBase64.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfBase64.cpp rename to external/resinsight/LibCore/cvfBase64.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfBase64.h b/external/resinsight/LibCore/cvfBase64.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfBase64.h rename to external/resinsight/LibCore/cvfBase64.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCharArray.cpp b/external/resinsight/LibCore/cvfCharArray.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCharArray.cpp rename to external/resinsight/LibCore/cvfCharArray.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCharArray.h b/external/resinsight/LibCore/cvfCharArray.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCharArray.h rename to external/resinsight/LibCore/cvfCharArray.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCodeLocation.cpp b/external/resinsight/LibCore/cvfCodeLocation.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCodeLocation.cpp rename to external/resinsight/LibCore/cvfCodeLocation.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCodeLocation.h b/external/resinsight/LibCore/cvfCodeLocation.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCodeLocation.h rename to external/resinsight/LibCore/cvfCodeLocation.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCollection.h b/external/resinsight/LibCore/cvfCollection.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCollection.h rename to external/resinsight/LibCore/cvfCollection.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCollection.inl b/external/resinsight/LibCore/cvfCollection.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfCollection.inl rename to external/resinsight/LibCore/cvfCollection.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor3.cpp b/external/resinsight/LibCore/cvfColor3.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor3.cpp rename to external/resinsight/LibCore/cvfColor3.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor3.h b/external/resinsight/LibCore/cvfColor3.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor3.h rename to external/resinsight/LibCore/cvfColor3.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor4.cpp b/external/resinsight/LibCore/cvfColor4.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor4.cpp rename to external/resinsight/LibCore/cvfColor4.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor4.h b/external/resinsight/LibCore/cvfColor4.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfColor4.h rename to external/resinsight/LibCore/cvfColor4.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfConfigCore.h b/external/resinsight/LibCore/cvfConfigCore.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfConfigCore.h rename to external/resinsight/LibCore/cvfConfigCore.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfDebugTimer.cpp b/external/resinsight/LibCore/cvfDebugTimer.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfDebugTimer.cpp rename to external/resinsight/LibCore/cvfDebugTimer.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfDebugTimer.h b/external/resinsight/LibCore/cvfDebugTimer.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfDebugTimer.h rename to external/resinsight/LibCore/cvfDebugTimer.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfFlags.h b/external/resinsight/LibCore/cvfFlags.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfFlags.h rename to external/resinsight/LibCore/cvfFlags.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfFlags.inl b/external/resinsight/LibCore/cvfFlags.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfFlags.inl rename to external/resinsight/LibCore/cvfFlags.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfFunctorRange.h b/external/resinsight/LibCore/cvfFunctorRange.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfFunctorRange.h rename to external/resinsight/LibCore/cvfFunctorRange.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLibCore.h b/external/resinsight/LibCore/cvfLibCore.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLibCore.h rename to external/resinsight/LibCore/cvfLibCore.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestination.h b/external/resinsight/LibCore/cvfLogDestination.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestination.h rename to external/resinsight/LibCore/cvfLogDestination.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationConsole.cpp b/external/resinsight/LibCore/cvfLogDestinationConsole.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationConsole.cpp rename to external/resinsight/LibCore/cvfLogDestinationConsole.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationConsole.h b/external/resinsight/LibCore/cvfLogDestinationConsole.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationConsole.h rename to external/resinsight/LibCore/cvfLogDestinationConsole.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationFile.cpp b/external/resinsight/LibCore/cvfLogDestinationFile.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationFile.cpp rename to external/resinsight/LibCore/cvfLogDestinationFile.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationFile.h b/external/resinsight/LibCore/cvfLogDestinationFile.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogDestinationFile.h rename to external/resinsight/LibCore/cvfLogDestinationFile.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogEvent.cpp b/external/resinsight/LibCore/cvfLogEvent.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogEvent.cpp rename to external/resinsight/LibCore/cvfLogEvent.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogEvent.h b/external/resinsight/LibCore/cvfLogEvent.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogEvent.h rename to external/resinsight/LibCore/cvfLogEvent.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogManager.cpp b/external/resinsight/LibCore/cvfLogManager.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogManager.cpp rename to external/resinsight/LibCore/cvfLogManager.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogManager.h b/external/resinsight/LibCore/cvfLogManager.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogManager.h rename to external/resinsight/LibCore/cvfLogManager.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogger.cpp b/external/resinsight/LibCore/cvfLogger.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogger.cpp rename to external/resinsight/LibCore/cvfLogger.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogger.h b/external/resinsight/LibCore/cvfLogger.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfLogger.h rename to external/resinsight/LibCore/cvfLogger.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMath.cpp b/external/resinsight/LibCore/cvfMath.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMath.cpp rename to external/resinsight/LibCore/cvfMath.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMath.h b/external/resinsight/LibCore/cvfMath.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMath.h rename to external/resinsight/LibCore/cvfMath.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMath.inl b/external/resinsight/LibCore/cvfMath.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMath.inl rename to external/resinsight/LibCore/cvfMath.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix3.h b/external/resinsight/LibCore/cvfMatrix3.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix3.h rename to external/resinsight/LibCore/cvfMatrix3.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix3.inl b/external/resinsight/LibCore/cvfMatrix3.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix3.inl rename to external/resinsight/LibCore/cvfMatrix3.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix4.h b/external/resinsight/LibCore/cvfMatrix4.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix4.h rename to external/resinsight/LibCore/cvfMatrix4.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix4.inl b/external/resinsight/LibCore/cvfMatrix4.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMatrix4.inl rename to external/resinsight/LibCore/cvfMatrix4.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMutex.cpp b/external/resinsight/LibCore/cvfMutex.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMutex.cpp rename to external/resinsight/LibCore/cvfMutex.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMutex.h b/external/resinsight/LibCore/cvfMutex.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfMutex.h rename to external/resinsight/LibCore/cvfMutex.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfObject.cpp b/external/resinsight/LibCore/cvfObject.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfObject.cpp rename to external/resinsight/LibCore/cvfObject.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfObject.h b/external/resinsight/LibCore/cvfObject.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfObject.h rename to external/resinsight/LibCore/cvfObject.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfObject.inl b/external/resinsight/LibCore/cvfObject.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfObject.inl rename to external/resinsight/LibCore/cvfObject.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPlane.cpp b/external/resinsight/LibCore/cvfPlane.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPlane.cpp rename to external/resinsight/LibCore/cvfPlane.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPlane.h b/external/resinsight/LibCore/cvfPlane.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPlane.h rename to external/resinsight/LibCore/cvfPlane.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfProgramOptions.cpp b/external/resinsight/LibCore/cvfProgramOptions.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfProgramOptions.cpp rename to external/resinsight/LibCore/cvfProgramOptions.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfProgramOptions.h b/external/resinsight/LibCore/cvfProgramOptions.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfProgramOptions.h rename to external/resinsight/LibCore/cvfProgramOptions.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySet.cpp b/external/resinsight/LibCore/cvfPropertySet.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySet.cpp rename to external/resinsight/LibCore/cvfPropertySet.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySet.h b/external/resinsight/LibCore/cvfPropertySet.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySet.h rename to external/resinsight/LibCore/cvfPropertySet.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySetCollection.cpp b/external/resinsight/LibCore/cvfPropertySetCollection.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySetCollection.cpp rename to external/resinsight/LibCore/cvfPropertySetCollection.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySetCollection.h b/external/resinsight/LibCore/cvfPropertySetCollection.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfPropertySetCollection.h rename to external/resinsight/LibCore/cvfPropertySetCollection.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfQuat.h b/external/resinsight/LibCore/cvfQuat.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfQuat.h rename to external/resinsight/LibCore/cvfQuat.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfQuat.inl b/external/resinsight/LibCore/cvfQuat.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfQuat.inl rename to external/resinsight/LibCore/cvfQuat.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfRect.h b/external/resinsight/LibCore/cvfRect.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfRect.h rename to external/resinsight/LibCore/cvfRect.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfRect.inl b/external/resinsight/LibCore/cvfRect.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfRect.inl rename to external/resinsight/LibCore/cvfRect.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfString.cpp b/external/resinsight/LibCore/cvfString.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfString.cpp rename to external/resinsight/LibCore/cvfString.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfString.h b/external/resinsight/LibCore/cvfString.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfString.h rename to external/resinsight/LibCore/cvfString.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfSystem.cpp b/external/resinsight/LibCore/cvfSystem.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfSystem.cpp rename to external/resinsight/LibCore/cvfSystem.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfSystem.h b/external/resinsight/LibCore/cvfSystem.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfSystem.h rename to external/resinsight/LibCore/cvfSystem.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTBBControl.cpp b/external/resinsight/LibCore/cvfTBBControl.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTBBControl.cpp rename to external/resinsight/LibCore/cvfTBBControl.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTBBControl.h b/external/resinsight/LibCore/cvfTBBControl.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTBBControl.h rename to external/resinsight/LibCore/cvfTBBControl.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTimer.cpp b/external/resinsight/LibCore/cvfTimer.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTimer.cpp rename to external/resinsight/LibCore/cvfTimer.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTimer.h b/external/resinsight/LibCore/cvfTimer.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTimer.h rename to external/resinsight/LibCore/cvfTimer.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTrace.cpp b/external/resinsight/LibCore/cvfTrace.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTrace.cpp rename to external/resinsight/LibCore/cvfTrace.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTrace.h b/external/resinsight/LibCore/cvfTrace.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfTrace.h rename to external/resinsight/LibCore/cvfTrace.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfValueArray.h b/external/resinsight/LibCore/cvfValueArray.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfValueArray.h rename to external/resinsight/LibCore/cvfValueArray.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVariant.cpp b/external/resinsight/LibCore/cvfVariant.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVariant.cpp rename to external/resinsight/LibCore/cvfVariant.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVariant.h b/external/resinsight/LibCore/cvfVariant.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVariant.h rename to external/resinsight/LibCore/cvfVariant.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector2.cpp b/external/resinsight/LibCore/cvfVector2.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector2.cpp rename to external/resinsight/LibCore/cvfVector2.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector2.h b/external/resinsight/LibCore/cvfVector2.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector2.h rename to external/resinsight/LibCore/cvfVector2.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector2.inl b/external/resinsight/LibCore/cvfVector2.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector2.inl rename to external/resinsight/LibCore/cvfVector2.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector3.cpp b/external/resinsight/LibCore/cvfVector3.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector3.cpp rename to external/resinsight/LibCore/cvfVector3.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector3.h b/external/resinsight/LibCore/cvfVector3.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector3.h rename to external/resinsight/LibCore/cvfVector3.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector3.inl b/external/resinsight/LibCore/cvfVector3.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector3.inl rename to external/resinsight/LibCore/cvfVector3.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector4.cpp b/external/resinsight/LibCore/cvfVector4.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector4.cpp rename to external/resinsight/LibCore/cvfVector4.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector4.h b/external/resinsight/LibCore/cvfVector4.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector4.h rename to external/resinsight/LibCore/cvfVector4.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector4.inl b/external/resinsight/LibCore/cvfVector4.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVector4.inl rename to external/resinsight/LibCore/cvfVector4.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVersion.h b/external/resinsight/LibCore/cvfVersion.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibCore/cvfVersion.h rename to external/resinsight/LibCore/cvfVersion.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/CMakeLists.txt b/external/resinsight/LibGeometry/CMakeLists.txt similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/CMakeLists.txt rename to external/resinsight/LibGeometry/CMakeLists.txt diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/LibGeometry.vcxproj b/external/resinsight/LibGeometry/LibGeometry.vcxproj similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/LibGeometry.vcxproj rename to external/resinsight/LibGeometry/LibGeometry.vcxproj diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/LibGeometry.vcxproj.filters b/external/resinsight/LibGeometry/LibGeometry.vcxproj.filters similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/LibGeometry.vcxproj.filters rename to external/resinsight/LibGeometry/LibGeometry.vcxproj.filters diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfArrowGenerator.cpp b/external/resinsight/LibGeometry/cvfArrowGenerator.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfArrowGenerator.cpp rename to external/resinsight/LibGeometry/cvfArrowGenerator.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfArrowGenerator.h b/external/resinsight/LibGeometry/cvfArrowGenerator.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfArrowGenerator.h rename to external/resinsight/LibGeometry/cvfArrowGenerator.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBox.cpp b/external/resinsight/LibGeometry/cvfBoundingBox.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBox.cpp rename to external/resinsight/LibGeometry/cvfBoundingBox.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBox.h b/external/resinsight/LibGeometry/cvfBoundingBox.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBox.h rename to external/resinsight/LibGeometry/cvfBoundingBox.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBoxTree.cpp b/external/resinsight/LibGeometry/cvfBoundingBoxTree.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBoxTree.cpp rename to external/resinsight/LibGeometry/cvfBoundingBoxTree.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBoxTree.h b/external/resinsight/LibGeometry/cvfBoundingBoxTree.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoundingBoxTree.h rename to external/resinsight/LibGeometry/cvfBoundingBoxTree.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoxGenerator.cpp b/external/resinsight/LibGeometry/cvfBoxGenerator.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoxGenerator.cpp rename to external/resinsight/LibGeometry/cvfBoxGenerator.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoxGenerator.h b/external/resinsight/LibGeometry/cvfBoxGenerator.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfBoxGenerator.h rename to external/resinsight/LibGeometry/cvfBoxGenerator.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfEdgeKey.cpp b/external/resinsight/LibGeometry/cvfEdgeKey.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfEdgeKey.cpp rename to external/resinsight/LibGeometry/cvfEdgeKey.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfEdgeKey.h b/external/resinsight/LibGeometry/cvfEdgeKey.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfEdgeKey.h rename to external/resinsight/LibGeometry/cvfEdgeKey.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfFrustum.cpp b/external/resinsight/LibGeometry/cvfFrustum.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfFrustum.cpp rename to external/resinsight/LibGeometry/cvfFrustum.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfFrustum.h b/external/resinsight/LibGeometry/cvfFrustum.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfFrustum.h rename to external/resinsight/LibGeometry/cvfFrustum.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilder.cpp b/external/resinsight/LibGeometry/cvfGeometryBuilder.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilder.cpp rename to external/resinsight/LibGeometry/cvfGeometryBuilder.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilder.h b/external/resinsight/LibGeometry/cvfGeometryBuilder.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilder.h rename to external/resinsight/LibGeometry/cvfGeometryBuilder.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderFaceList.cpp b/external/resinsight/LibGeometry/cvfGeometryBuilderFaceList.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderFaceList.cpp rename to external/resinsight/LibGeometry/cvfGeometryBuilderFaceList.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderFaceList.h b/external/resinsight/LibGeometry/cvfGeometryBuilderFaceList.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderFaceList.h rename to external/resinsight/LibGeometry/cvfGeometryBuilderFaceList.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderTriangles.cpp b/external/resinsight/LibGeometry/cvfGeometryBuilderTriangles.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderTriangles.cpp rename to external/resinsight/LibGeometry/cvfGeometryBuilderTriangles.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderTriangles.h b/external/resinsight/LibGeometry/cvfGeometryBuilderTriangles.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryBuilderTriangles.h rename to external/resinsight/LibGeometry/cvfGeometryBuilderTriangles.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryUtils.cpp b/external/resinsight/LibGeometry/cvfGeometryUtils.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryUtils.cpp rename to external/resinsight/LibGeometry/cvfGeometryUtils.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryUtils.h b/external/resinsight/LibGeometry/cvfGeometryUtils.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfGeometryUtils.h rename to external/resinsight/LibGeometry/cvfGeometryUtils.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfLibGeometry.h b/external/resinsight/LibGeometry/cvfLibGeometry.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfLibGeometry.h rename to external/resinsight/LibGeometry/cvfLibGeometry.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfMeshEdgeExtractor.cpp b/external/resinsight/LibGeometry/cvfMeshEdgeExtractor.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfMeshEdgeExtractor.cpp rename to external/resinsight/LibGeometry/cvfMeshEdgeExtractor.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfMeshEdgeExtractor.h b/external/resinsight/LibGeometry/cvfMeshEdgeExtractor.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfMeshEdgeExtractor.h rename to external/resinsight/LibGeometry/cvfMeshEdgeExtractor.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfOutlineEdgeExtractor.cpp b/external/resinsight/LibGeometry/cvfOutlineEdgeExtractor.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfOutlineEdgeExtractor.cpp rename to external/resinsight/LibGeometry/cvfOutlineEdgeExtractor.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfOutlineEdgeExtractor.h b/external/resinsight/LibGeometry/cvfOutlineEdgeExtractor.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfOutlineEdgeExtractor.h rename to external/resinsight/LibGeometry/cvfOutlineEdgeExtractor.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPatchGenerator.cpp b/external/resinsight/LibGeometry/cvfPatchGenerator.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPatchGenerator.cpp rename to external/resinsight/LibGeometry/cvfPatchGenerator.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPatchGenerator.h b/external/resinsight/LibGeometry/cvfPatchGenerator.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPatchGenerator.h rename to external/resinsight/LibGeometry/cvfPatchGenerator.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPrimitiveTests.cpp b/external/resinsight/LibGeometry/cvfPrimitiveTests.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPrimitiveTests.cpp rename to external/resinsight/LibGeometry/cvfPrimitiveTests.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPrimitiveTests.h b/external/resinsight/LibGeometry/cvfPrimitiveTests.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfPrimitiveTests.h rename to external/resinsight/LibGeometry/cvfPrimitiveTests.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfRay.cpp b/external/resinsight/LibGeometry/cvfRay.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfRay.cpp rename to external/resinsight/LibGeometry/cvfRay.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfRay.h b/external/resinsight/LibGeometry/cvfRay.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfRay.h rename to external/resinsight/LibGeometry/cvfRay.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp b/external/resinsight/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp rename to external/resinsight/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleMeshEdgeExtractor.h b/external/resinsight/LibGeometry/cvfTriangleMeshEdgeExtractor.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleMeshEdgeExtractor.h rename to external/resinsight/LibGeometry/cvfTriangleMeshEdgeExtractor.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleVertexSplitter.cpp b/external/resinsight/LibGeometry/cvfTriangleVertexSplitter.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleVertexSplitter.cpp rename to external/resinsight/LibGeometry/cvfTriangleVertexSplitter.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleVertexSplitter.h b/external/resinsight/LibGeometry/cvfTriangleVertexSplitter.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfTriangleVertexSplitter.h rename to external/resinsight/LibGeometry/cvfTriangleVertexSplitter.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexCompactor.cpp b/external/resinsight/LibGeometry/cvfVertexCompactor.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexCompactor.cpp rename to external/resinsight/LibGeometry/cvfVertexCompactor.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexCompactor.h b/external/resinsight/LibGeometry/cvfVertexCompactor.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexCompactor.h rename to external/resinsight/LibGeometry/cvfVertexCompactor.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexWelder.cpp b/external/resinsight/LibGeometry/cvfVertexWelder.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexWelder.cpp rename to external/resinsight/LibGeometry/cvfVertexWelder.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexWelder.h b/external/resinsight/LibGeometry/cvfVertexWelder.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/LibGeometry/cvfVertexWelder.h rename to external/resinsight/LibGeometry/cvfVertexWelder.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigCellGeometryTools.cpp b/external/resinsight/ReservoirDataModel/RigCellGeometryTools.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigCellGeometryTools.cpp rename to external/resinsight/ReservoirDataModel/RigCellGeometryTools.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigCellGeometryTools.h b/external/resinsight/ReservoirDataModel/RigCellGeometryTools.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigCellGeometryTools.h rename to external/resinsight/ReservoirDataModel/RigCellGeometryTools.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseCaseData.cpp b/external/resinsight/ReservoirDataModel/RigEclipseCaseData.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseCaseData.cpp rename to external/resinsight/ReservoirDataModel/RigEclipseCaseData.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseCaseData.h b/external/resinsight/ReservoirDataModel/RigEclipseCaseData.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseCaseData.h rename to external/resinsight/ReservoirDataModel/RigEclipseCaseData.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigHexIntersectionTools.cpp b/external/resinsight/ReservoirDataModel/RigHexIntersectionTools.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigHexIntersectionTools.cpp rename to external/resinsight/ReservoirDataModel/RigHexIntersectionTools.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigHexIntersectionTools.h b/external/resinsight/ReservoirDataModel/RigHexIntersectionTools.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigHexIntersectionTools.h rename to external/resinsight/ReservoirDataModel/RigHexIntersectionTools.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigMainGrid.cpp b/external/resinsight/ReservoirDataModel/RigMainGrid.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigMainGrid.cpp rename to external/resinsight/ReservoirDataModel/RigMainGrid.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigMainGrid.h b/external/resinsight/ReservoirDataModel/RigMainGrid.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigMainGrid.h rename to external/resinsight/ReservoirDataModel/RigMainGrid.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellLogExtractionTools.h b/external/resinsight/ReservoirDataModel/RigWellLogExtractionTools.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellLogExtractionTools.h rename to external/resinsight/ReservoirDataModel/RigWellLogExtractionTools.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellLogExtractor.cpp b/external/resinsight/ReservoirDataModel/RigWellLogExtractor.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellLogExtractor.cpp rename to external/resinsight/ReservoirDataModel/RigWellLogExtractor.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellLogExtractor.h b/external/resinsight/ReservoirDataModel/RigWellLogExtractor.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellLogExtractor.h rename to external/resinsight/ReservoirDataModel/RigWellLogExtractor.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPath.cpp b/external/resinsight/ReservoirDataModel/RigWellPath.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPath.cpp rename to external/resinsight/ReservoirDataModel/RigWellPath.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPath.h b/external/resinsight/ReservoirDataModel/RigWellPath.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPath.h rename to external/resinsight/ReservoirDataModel/RigWellPath.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPathIntersectionTools.cpp b/external/resinsight/ReservoirDataModel/RigWellPathIntersectionTools.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPathIntersectionTools.cpp rename to external/resinsight/ReservoirDataModel/RigWellPathIntersectionTools.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPathIntersectionTools.h b/external/resinsight/ReservoirDataModel/RigWellPathIntersectionTools.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigWellPathIntersectionTools.h rename to external/resinsight/ReservoirDataModel/RigWellPathIntersectionTools.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/cvfGeometryTools.cpp b/external/resinsight/ReservoirDataModel/cvfGeometryTools.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/cvfGeometryTools.cpp rename to external/resinsight/ReservoirDataModel/cvfGeometryTools.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/cvfGeometryTools.h b/external/resinsight/ReservoirDataModel/cvfGeometryTools.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/cvfGeometryTools.h rename to external/resinsight/ReservoirDataModel/cvfGeometryTools.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/cvfGeometryTools.inl b/external/resinsight/ReservoirDataModel/cvfGeometryTools.inl similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/cvfGeometryTools.inl rename to external/resinsight/ReservoirDataModel/cvfGeometryTools.inl diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp b/external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp rename to external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.h b/external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.h rename to external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafAppEnum.h b/external/resinsight/cafPdmCore/cafAppEnum.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafAppEnum.h rename to external/resinsight/cafPdmCore/cafAppEnum.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafAssert.h b/external/resinsight/cafPdmCore/cafAssert.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafAssert.h rename to external/resinsight/cafPdmCore/cafAssert.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafSignal.cpp b/external/resinsight/cafPdmCore/cafSignal.cpp similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafSignal.cpp rename to external/resinsight/cafPdmCore/cafSignal.cpp diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafSignal.h b/external/resinsight/cafPdmCore/cafSignal.h similarity index 100% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/cafPdmCore/cafSignal.h rename to external/resinsight/cafPdmCore/cafSignal.h diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/MyRigEclipseWellLogExtractor.h b/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.hpp similarity index 80% rename from src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/MyRigEclipseWellLogExtractor.h rename to opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.hpp index 8f0163348..93520bad2 100644 --- a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/MyRigEclipseWellLogExtractor.h +++ b/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.hpp @@ -21,10 +21,16 @@ #include "RigWellLogExtractor.h" #include +#include +#include class RigEclipseCaseData; class RigWellPath; class RigResultAccessor; +namespace Opm { +class EclipseGrid; +class ScheduleGrid; +} namespace cvf { @@ -37,11 +43,9 @@ class BoundingBox; class MyRigEclipseWellLogExtractor : public RigWellLogExtractor { public: - MyRigEclipseWellLogExtractor( const RigWellPath* wellpath ); - - // void curveData( const RigResultAccessor* resultAccessor, std::vector* values ); - // const RigEclipseCaseData* caseData() { return m_caseData.p(); } + MyRigEclipseWellLogExtractor( const RigWellPath* wellpath, const Opm::EclipseGrid& grid, cvf::ref& cellSearchTree); + cvf::ref getCellSearchTree(); private: void calculateIntersection(); std::vector findCloseCellIndices( const cvf::BoundingBox& bb ); @@ -56,5 +60,10 @@ private: cvf::Vec3d& localXdirection, cvf::Vec3d& localYdirection, cvf::Vec3d& localZdirection ) const; + void buildCellSearchTree(); + void findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector* cellIndices ) const; + void computeCachedData(); + + const Opm::EclipseGrid& m_grid; cvf::ref m_cellSearchTree; }; diff --git a/src/opm/input/eclipse/Schedule/Well/WellTrajectory.cpp b/src/opm/input/eclipse/Schedule/Well/WellTrajectory.cpp deleted file mode 100644 index 5fb1b66c1..000000000 --- a/src/opm/input/eclipse/Schedule/Well/WellTrajectory.cpp +++ /dev/null @@ -1,91 +0,0 @@ -//header -//from RigMainGrid - -#include -#include -#include -#include - -#include -#include - -void WellTrajectory::buildCellSearchTree() -{ - if (m_cellSearchTree.isNull()) {} - std::cout< dims = {3,3,3}; - // auto nx = m_grid.getNX(); - - // const Opm::GridDims gridDims(3,3,3); - Opm::EclipseGrid grid(m_dims, m_coord, m_zcorn, nullptr); - - auto nx = grid.getNX(); - auto ny = grid.getNY(); - auto nz = grid.getNZ(); - - size_t cellCount = nx * ny * nz; - std::vector cellIndicesForBoundingBoxes; - std::vector cellBoundingBoxes; - -// #pragma omp parallel -// { - size_t threadCellCount = cellCount; - - std::vector threadIndicesForBoundingBoxes; - std::vector threadBoundingBoxes; - - threadIndicesForBoundingBoxes.reserve( threadCellCount ); - threadBoundingBoxes.reserve( threadCellCount ); - - std::array cornerPointArray; - cvf::Vec3d cornerPoint; - -// #pragma omp for - for (int cIdx = 0; cIdx < (int)cellCount; ++cIdx) { - const auto[i,j,k] = grid.getIJK(cIdx); - // for (std::size_t i = 0; i < nx; i++) { - // for (std::size_t j = 0; j < ny; j++) { - // for (std::size_t k = 0; k < nz; k++) { - cvf::BoundingBox cellBB; - for (std::size_t l = 0; l < 8; l++) { - cornerPointArray = grid.getCornerPos(i,j,k,l); - cornerPoint = cvf::Vec3d(cornerPointArray[0], cornerPointArray[1], cornerPointArray[2]); - cellBB.add(cornerPoint); - } - - if (cellBB.isValid()) { - threadIndicesForBoundingBoxes.emplace_back(cIdx); - threadBoundingBoxes.emplace_back(cellBB); - } - } - - threadIndicesForBoundingBoxes.shrink_to_fit(); - threadBoundingBoxes.shrink_to_fit(); -// #pragma omp critical -// { - cellIndicesForBoundingBoxes.insert( cellIndicesForBoundingBoxes.end(), - threadIndicesForBoundingBoxes.begin(), - threadIndicesForBoundingBoxes.end() ); - - cellBoundingBoxes.insert( cellBoundingBoxes.end(), threadBoundingBoxes.begin(), threadBoundingBoxes.end() ); - // } - // } #pragma omp parallel - m_cellSearchTree = new cvf::BoundingBoxTree; - m_cellSearchTree->buildTreeFromBoundingBoxes( cellBoundingBoxes, &cellIndicesForBoundingBoxes ); -} - - -void WellTrajectory::findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector* cellIndices ) const -{ - CVF_ASSERT( m_cellSearchTree.notNull() ); - - m_cellSearchTree->findIntersections( inputBB, cellIndices ); -} - -std::vector WellTrajectory::findCloseCellIndices( const cvf::BoundingBox& bb ) -{ - std::vector closeCells; - this->findIntersectingCells( bb, &closeCells ); - return closeCells; -} - diff --git a/src/opm/input/eclipse/Schedule/Well/WellTrajectory.hpp b/src/opm/input/eclipse/Schedule/Well/WellTrajectory.hpp deleted file mode 100644 index 55742956d..000000000 --- a/src/opm/input/eclipse/Schedule/Well/WellTrajectory.hpp +++ /dev/null @@ -1,35 +0,0 @@ -//header -#include -#include -#include -#include - -#ifndef WELLTRAJECTORY_HPP_ -#define WELLTRAJECTORY_HPP_ - -class EclipseGrid; -class WellTrajectory { - - public: - WellTrajectory(std::array dims, std::vector coord, std::vector zcorn) - //WellTrajectory(const double* coord, const double* zcorn) - : m_dims(dims) - , m_coord(coord) - , m_zcorn(zcorn) - {}; - - void buildCellSearchTree(); - void findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector* cellIndices ) const; - std::vector findCloseCellIndices( const cvf::BoundingBox& bb ); - - - private: - // std::vector m_nodes; ///< Global vertex table - std::array m_dims; - std::vector m_coord; - std::vector m_zcorn; - cvf::ref m_cellSearchTree; - -}; - -#endif /* WELLTRAJECTORY_HPP_ */ \ No newline at end of file diff --git a/src/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.cpp b/src/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.cpp new file mode 100644 index 000000000..4e5e02939 --- /dev/null +++ b/src/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.cpp @@ -0,0 +1,333 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Statoil ASA +// Copyright (C) Ceetron Solutions AS +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include +#include + +#include "MyRigEclipseWellLogExtractor.h" +#include "RigWellLogExtractionTools.h" +#include "RigWellPath.h" + +#include "../LibGeometry/cvfBoundingBox.h" +#include "cvfGeometryTools.h" +#include "RigWellLogExtractor.h" +#include "RigCellGeometryTools.h" +#include "../CommonCode/cvfStructGrid.h" + +#include + +//================================================================================================== +/// +//================================================================================================== + + MyRigEclipseWellLogExtractor::MyRigEclipseWellLogExtractor(const RigWellPath* wellpath, const Opm::EclipseGrid& grid, cvf::ref& cellSearchTree) + : RigWellLogExtractor( wellpath, "" ) + ,m_grid(grid) + ,m_cellSearchTree(cellSearchTree) +{ + calculateIntersection(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void MyRigEclipseWellLogExtractor::calculateIntersection() +{ + std::map uniqueIntersections; + + bool isCellFaceNormalsOut = 1; //m_caseData->mainGrid()->isFaceNormalsOutwards(); + + if ( m_wellPathGeometry->wellPathPoints().empty() ) return; + + for ( size_t wpp = 0; wpp < m_wellPathGeometry->wellPathPoints().size() - 1; ++wpp ) + { + std::vector intersections; + cvf::Vec3d p1 = m_wellPathGeometry->wellPathPoints()[wpp]; + cvf::Vec3d p2 = m_wellPathGeometry->wellPathPoints()[wpp + 1]; + + cvf::BoundingBox bb; + + bb.add( p1 ); + bb.add( p2 ); + + buildCellSearchTree(); + + std::vector closeCellIndices = findCloseCellIndices( bb ); + + cvf::Vec3d hexCorners_opm[8]; //opm numbering + std::array cornerPointArray; + for ( const auto& globalCellIndex : closeCellIndices ) + { + const auto[i,j,k] = m_grid.getIJK(globalCellIndex); + + for (std::size_t l = 0; l < 8; l++) { + cornerPointArray = m_grid.getCornerPos(i,j,k,l); + hexCorners_opm[l] = cvf::Vec3d(cornerPointArray[0], cornerPointArray[1], cornerPointArray[2]); + } + cvf::Vec3d hexCorners[8]; //resinsight numbering, see RigCellGeometryTools.cpp + hexCorners[0] = hexCorners_opm[0]; + hexCorners[1] = hexCorners_opm[1]; + hexCorners[2] = hexCorners_opm[3]; + hexCorners[3] = hexCorners_opm[2]; + hexCorners[4] = hexCorners_opm[4]; + hexCorners[5] = hexCorners_opm[5]; + hexCorners[6] = hexCorners_opm[7]; + hexCorners[7] = hexCorners_opm[6]; + RigHexIntersectionTools::lineHexCellIntersection( p1, p2, hexCorners, globalCellIndex, &intersections ); + } + + if ( !isCellFaceNormalsOut ) + { + for ( auto& intersection : intersections ) + { + intersection.m_isIntersectionEntering = !intersection.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_wellPathGeometry->measuredDepths()[wpp]; + double md2 = m_wellPathGeometry->measuredDepths()[wpp + 1]; + + insertIntersectionsInMap( intersections, p1, md1, p2, md2, &uniqueIntersections ); + } + + this->populateReturnArrays( uniqueIntersections ); +} + + +cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex, + const cvf::Vec3d& startPoint, + const cvf::Vec3d& endPoint ) const +{ + const auto[i,j,k] = m_grid.getIJK(cellIndex); + cvf::Vec3d hexCorners_opm[8]; //opm numbering + std::array cornerPointArray; + for (std::size_t l = 0; l < 8; l++) { + cornerPointArray = m_grid.getCornerPos(i,j,k,l); + hexCorners_opm[l] = cvf::Vec3d(cornerPointArray[0], cornerPointArray[1], cornerPointArray[2]); + } + std::array hexCorners; //resinsight numbering, see RigCellGeometryTools.cpp + hexCorners[0] = hexCorners_opm[0]; + hexCorners[1] = hexCorners_opm[1]; + hexCorners[2] = hexCorners_opm[3]; + hexCorners[3] = hexCorners_opm[2]; + hexCorners[4] = hexCorners_opm[4]; + hexCorners[5] = hexCorners_opm[5]; + hexCorners[6] = hexCorners_opm[7]; + hexCorners[7] = hexCorners_opm[6]; + + return MyRigEclipseWellLogExtractor::calculateLengthInCell( hexCorners, startPoint, endPoint ); +} + + +cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( const std::array& hexCorners, + const cvf::Vec3d& startPoint, + const cvf::Vec3d& endPoint ) const +{ + + cvf::Vec3d vec = endPoint - startPoint; + cvf::Vec3d iAxisDirection; + cvf::Vec3d jAxisDirection; + cvf::Vec3d kAxisDirection; + + MyRigEclipseWellLogExtractor::findCellLocalXYZ( hexCorners, iAxisDirection, jAxisDirection, kAxisDirection ); + + cvf::Mat3d localCellCoordinateSystem( iAxisDirection.x(), + jAxisDirection.x(), + kAxisDirection.x(), + iAxisDirection.y(), + jAxisDirection.y(), + kAxisDirection.y(), + iAxisDirection.z(), + jAxisDirection.z(), + kAxisDirection.z() ); + + auto signedVector = vec.getTransformedVector( localCellCoordinateSystem.getInverted() ); + + return { std::fabs( signedVector.x() ), std::fabs( signedVector.y() ), std::fabs( signedVector.z() ) }; +} + +//================================================================================================== +/// +//================================================================================================== +void MyRigEclipseWellLogExtractor::findCellLocalXYZ( const std::array& hexCorners, + cvf::Vec3d& localXdirection, + cvf::Vec3d& localYdirection, + cvf::Vec3d& localZdirection ) const +{ + + cvf::Vec3d faceCenterNegI = cvf::GeometryTools::computeFaceCenter( hexCorners[0], + hexCorners[4], + hexCorners[7], + hexCorners[3] ); + + cvf::Vec3d faceCenterPosI = cvf::GeometryTools::computeFaceCenter( hexCorners[1], + hexCorners[2], + hexCorners[6], + hexCorners[5] ); + + cvf::Vec3d faceCenterNegJ = cvf::GeometryTools::computeFaceCenter( hexCorners[0], + hexCorners[1], + hexCorners[5], + hexCorners[4] ); + + cvf::Vec3d faceCenterPosJ = cvf::GeometryTools::computeFaceCenter( hexCorners[3], + hexCorners[7], + hexCorners[6], + hexCorners[2] ); + + // TODO: Should we use face centroids instead of face centers? + + // cvf::ubyte faceVertexIndices[4]; + // cvf::StructGridInterface::FaceEnum face; + + // face = cvf::StructGridInterface::NEG_I; + // cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); + // cvf::Vec3d faceCenterNegI = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], + // hexCorners[faceVertexIndices[1]], + // hexCorners[faceVertexIndices[2]], + // hexCorners[faceVertexIndices[3]] ); + // TODO: Should we use face centroids instead of face centers? + + // face = cvf::StructGridInterface::POS_I; + // cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); + // cvf::Vec3d faceCenterPosI = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], + // hexCorners[faceVertexIndices[1]], + // hexCorners[faceVertexIndices[2]], + // hexCorners[faceVertexIndices[3]] ); + + // face = cvf::StructGridInterface::NEG_J; + // cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); + // cvf::Vec3d faceCenterNegJ = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], + // hexCorners[faceVertexIndices[1]], + // hexCorners[faceVertexIndices[2]], + // hexCorners[faceVertexIndices[3]] ); + + // face = cvf::StructGridInterface::POS_J; + // cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); + // cvf::Vec3d faceCenterPosJ = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], + // hexCorners[faceVertexIndices[1]], + // hexCorners[faceVertexIndices[2]], + // hexCorners[faceVertexIndices[3]] ); + + cvf::Vec3d faceCenterCenterVectorI = faceCenterPosI - faceCenterNegI; + cvf::Vec3d faceCenterCenterVectorJ = faceCenterPosJ - faceCenterNegJ; + + localZdirection.cross( faceCenterCenterVectorI, faceCenterCenterVectorJ ); + localZdirection.normalize(); + + cvf::Vec3d crossPoductJZ; + crossPoductJZ.cross( faceCenterCenterVectorJ, localZdirection ); + localXdirection = faceCenterCenterVectorI + crossPoductJZ; + localXdirection.normalize(); + + cvf::Vec3d crossPoductIZ; + crossPoductIZ.cross( faceCenterCenterVectorI, localZdirection ); + localYdirection = faceCenterCenterVectorJ - crossPoductIZ; + localYdirection.normalize(); +} + +void MyRigEclipseWellLogExtractor::buildCellSearchTree() +{ + if (m_cellSearchTree.isNull()) { + + auto nx = m_grid.getNX(); + auto ny = m_grid.getNY(); + auto nz = m_grid.getNZ(); + + size_t cellCount = nx * ny * nz; + std::vector cellIndicesForBoundingBoxes; + std::vector cellBoundingBoxes; + +// #pragma omp parallel +// { + size_t threadCellCount = cellCount; + + std::vector threadIndicesForBoundingBoxes; + std::vector threadBoundingBoxes; + + threadIndicesForBoundingBoxes.reserve( threadCellCount ); + threadBoundingBoxes.reserve( threadCellCount ); + + std::array cornerPointArray; + cvf::Vec3d cornerPoint; + +// #pragma omp for + for (int cIdx = 0; cIdx < (int)cellCount; ++cIdx) { + const auto[i,j,k] = m_grid.getIJK(cIdx); + cvf::BoundingBox cellBB; + for (std::size_t l = 0; l < 8; l++) { + cornerPointArray = m_grid.getCornerPos(i,j,k,l); + cornerPoint = cvf::Vec3d(cornerPointArray[0], cornerPointArray[1], cornerPointArray[2]); + cellBB.add(cornerPoint); + } + + if (cellBB.isValid()) { + threadIndicesForBoundingBoxes.emplace_back(cIdx); + threadBoundingBoxes.emplace_back(cellBB); + } + } + + threadIndicesForBoundingBoxes.shrink_to_fit(); + threadBoundingBoxes.shrink_to_fit(); +// #pragma omp critical +// { + cellIndicesForBoundingBoxes.insert( cellIndicesForBoundingBoxes.end(), + threadIndicesForBoundingBoxes.begin(), + threadIndicesForBoundingBoxes.end() ); + + cellBoundingBoxes.insert( cellBoundingBoxes.end(), threadBoundingBoxes.begin(), threadBoundingBoxes.end() ); + // } + // } #pragma omp parallel + m_cellSearchTree = new cvf::BoundingBoxTree; + m_cellSearchTree->buildTreeFromBoundingBoxes( cellBoundingBoxes, &cellIndicesForBoundingBoxes ); + } +} + +void MyRigEclipseWellLogExtractor::computeCachedData() +{ + // initAllSubGridsParentGridPointer(); + // initAllSubCellsMainGridCellIndex(); + + m_cellSearchTree = nullptr; + buildCellSearchTree(); +} + +void MyRigEclipseWellLogExtractor::findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector* cellIndices ) const +{ + CVF_ASSERT( m_cellSearchTree.notNull() ); + + m_cellSearchTree->findIntersections( inputBB, cellIndices ); +} + +std::vector MyRigEclipseWellLogExtractor::findCloseCellIndices( const cvf::BoundingBox& bb ) +{ + std::vector closeCells; + this->findIntersectingCells( bb, &closeCells ); + return closeCells; +} + + cvf::ref MyRigEclipseWellLogExtractor::getCellSearchTree() + { + return m_cellSearchTree; + } diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/MyRigEclipseWellLogExtractor.cpp b/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/MyRigEclipseWellLogExtractor.cpp deleted file mode 100644 index a1684cbfb..000000000 --- a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/MyRigEclipseWellLogExtractor.cpp +++ /dev/null @@ -1,338 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Statoil ASA -// Copyright (C) Ceetron Solutions AS -// -// 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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// -#include -#include - -#include "MyRigEclipseWellLogExtractor.h" - -// #include "RiaLogging.h" - -// #include "RigEclipseCaseData.h" -//#include "RigMainGrid.h" -// #include "RigResultAccessor.h" -#include "RigWellLogExtractionTools.h" -#include "RigWellPath.h" -// #include "RigWellPathIntersectionTools.h" - -#include "../LibGeometry/cvfBoundingBox.h" -#include "cvfGeometryTools.h" -#include "RigWellLogExtractor.h" -#include "RigCellGeometryTools.h" -#include "../CommonCode/cvfStructGrid.h" - -#include - -//================================================================================================== -/// -//================================================================================================== - -MyRigEclipseWellLogExtractor::MyRigEclipseWellLogExtractor( const RigWellPath* wellpath) - : RigWellLogExtractor( wellpath, "" ) -{ - calculateIntersection(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void MyRigEclipseWellLogExtractor::calculateIntersection() -{ - std::map uniqueIntersections; - - bool isCellFaceNormalsOut = 1; //m_caseData->mainGrid()->isFaceNormalsOutwards(); - - if ( m_wellPathGeometry->wellPathPoints().empty() ) return; - - for ( size_t wpp = 0; wpp < m_wellPathGeometry->wellPathPoints().size() - 1; ++wpp ) - { - std::vector intersections; - cvf::Vec3d p1 = m_wellPathGeometry->wellPathPoints()[wpp]; - cvf::Vec3d p2 = m_wellPathGeometry->wellPathPoints()[wpp + 1]; - - cvf::BoundingBox bb; - - bb.add( p1 ); - bb.add( p2 ); - - - std::array dims = {3,3,1}; - Opm::EclipseGrid grid(dims[0], dims[1], dims[2], 10, 10, 5); - std::vector coord; - coord = grid.getCOORD(); - std::vector zcorn; - zcorn= grid.getZCORN(); - - WellTrajectory m_wellTrajectory(dims,coord, zcorn); - m_wellTrajectory.buildCellSearchTree(); - std::vector closeCellIndices = m_wellTrajectory.findCloseCellIndices( bb ); - - cvf::Vec3d hexCorners_opm[8]; //opm numbering - std::array cornerPointArray; - for ( const auto& globalCellIndex : closeCellIndices ) - { - const auto[i,j,k] = grid.getIJK(globalCellIndex); - - for (std::size_t l = 0; l < 8; l++) { - cornerPointArray = grid.getCornerPos(i,j,k,l); - hexCorners_opm[l] = cvf::Vec3d(cornerPointArray[0], cornerPointArray[1], cornerPointArray[2]); - } - cvf::Vec3d hexCorners[8]; //resinsight numbering, see RigCellGeometryTools.cpp - hexCorners[0] = hexCorners_opm[0]; - hexCorners[1] = hexCorners_opm[1]; - hexCorners[2] = hexCorners_opm[3]; - hexCorners[3] = hexCorners_opm[2]; - hexCorners[4] = hexCorners_opm[4]; - hexCorners[5] = hexCorners_opm[5]; - hexCorners[6] = hexCorners_opm[7]; - hexCorners[7] = hexCorners_opm[6]; - RigHexIntersectionTools::lineHexCellIntersection( p1, p2, hexCorners, globalCellIndex, &intersections ); - } - - if ( !isCellFaceNormalsOut ) - { - for ( auto& intersection : intersections ) - { - intersection.m_isIntersectionEntering = !intersection.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_wellPathGeometry->measuredDepths()[wpp]; - double md2 = m_wellPathGeometry->measuredDepths()[wpp + 1]; - - insertIntersectionsInMap( intersections, p1, md1, p2, md2, &uniqueIntersections ); - } - - // if ( uniqueIntersections.empty() && m_wellPathGeometry->wellPathPoints().size() > 1 ) - // { - // // When entering this function, all well path points are either completely outside the grid - // // or all well path points are inside one cell - - // cvf::Vec3d firstPoint = m_wellPathGeometry->wellPathPoints().front(); - // cvf::Vec3d lastPoint = m_wellPathGeometry->wellPathPoints().back(); - - // { - // cvf::BoundingBox bb; - // bb.add( firstPoint ); - - // std::vector closeCellIndices = findCloseCellIndices( bb ); - - // cvf::Vec3d hexCorners[8]; - // for ( const auto& globalCellIndex : closeCellIndices ) - // { - // const RigCell& cell = m_caseData->mainGrid()->globalCellArray()[globalCellIndex]; - - // if ( cell.isInvalid() ) continue; - - // m_caseData->mainGrid()->cellCornerVertices( globalCellIndex, hexCorners ); - - // if ( RigHexIntersectionTools::isPointInCell( firstPoint, hexCorners ) ) - // { - // if ( RigHexIntersectionTools::isPointInCell( lastPoint, hexCorners ) ) - // { - // { - // // Mark the first well path point as entering the cell - - // bool isEntering = true; - // HexIntersectionInfo info( firstPoint, - // isEntering, - // cvf::StructGridInterface::NO_FACE, - // globalCellIndex ); - // RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().front(), - // globalCellIndex, - // isEntering ); - - // uniqueIntersections.insert( std::make_pair( enterLeaveKey, info ) ); - // } - - // { - // // Mark the last well path point as leaving cell - - // bool isEntering = false; - // HexIntersectionInfo info( lastPoint, isEntering, cvf::StructGridInterface::NO_FACE, globalCellIndex ); - // RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().back(), - // globalCellIndex, - // isEntering ); - - // uniqueIntersections.insert( std::make_pair( enterLeaveKey, info ) ); - // } - // } - // else - // { - // // QString txt = - // // "Detected two points assumed to be in the same cell, but they are in two different cells"; - // // RiaLogging::debug( txt ); - // std::cout << "error message \n"<< std::endl; - // } - // } - // } - // } - // } - - this->populateReturnArrays( uniqueIntersections ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -// void RigEclipseWellLogExtractor::curveData( const RigResultAccessor* resultAccessor, std::vector* values ) -// { -// CVF_TIGHT_ASSERT( values ); -// values->resize( m_intersections.size() ); - -// for ( size_t cpIdx = 0; cpIdx < m_intersections.size(); ++cpIdx ) -// { -// size_t cellIdx = m_intersectedCellsGlobIdx[cpIdx]; -// cvf::StructGridInterface::FaceType cellFace = m_intersectedCellFaces[cpIdx]; -// ( *values )[cpIdx] = resultAccessor->cellFaceScalarGlobIdx( cellIdx, cellFace ); -// } -// } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -// std::vector RigEclipseWellLogExtractor::findCloseCellIndices( const cvf::BoundingBox& bb ) -// { -// std::vector closeCells; -// m_caseData->mainGrid()->findIntersectingCells( bb, &closeCells ); -// return closeCells; -// } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -// cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex, -// const cvf::Vec3d& startPoint, -// const cvf::Vec3d& endPoint ) const -// { -// std::array hexCorners; -// // m_caseData->mainGrid()->cellCornerVertices( cellIndex, hexCorners.data() ); - -// return RigWellPathIntersectionTools::calculateLengthInCell( hexCorners, startPoint, endPoint ); -// } - - -cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex, - const cvf::Vec3d& startPoint, - const cvf::Vec3d& endPoint ) const -{ - std::array hexCorners; - //Todo calculate here the hexcorners - // m_caseData->mainGrid()->cellCornerVertices( cellIndex, hexCorners.data() ); - - return MyRigEclipseWellLogExtractor::calculateLengthInCell( hexCorners, startPoint, endPoint ); -} - - -cvf::Vec3d MyRigEclipseWellLogExtractor::calculateLengthInCell( const std::array& hexCorners, - const cvf::Vec3d& startPoint, - const cvf::Vec3d& endPoint ) const -{ - //TODO rewrite to avoid to many dependencyies needed for findCellLocalXYZ - - cvf::Vec3d vec = endPoint - startPoint; - cvf::Vec3d iAxisDirection; - cvf::Vec3d jAxisDirection; - cvf::Vec3d kAxisDirection; - - MyRigEclipseWellLogExtractor::findCellLocalXYZ( hexCorners, iAxisDirection, jAxisDirection, kAxisDirection ); - - cvf::Mat3d localCellCoordinateSystem( iAxisDirection.x(), - jAxisDirection.x(), - kAxisDirection.x(), - iAxisDirection.y(), - jAxisDirection.y(), - kAxisDirection.y(), - iAxisDirection.z(), - jAxisDirection.z(), - kAxisDirection.z() ); - - auto signedVector = vec.getTransformedVector( localCellCoordinateSystem.getInverted() ); - - return { std::fabs( signedVector.x() ), std::fabs( signedVector.y() ), std::fabs( signedVector.z() ) }; -} - -//================================================================================================== -/// -//================================================================================================== -void MyRigEclipseWellLogExtractor::findCellLocalXYZ( const std::array& hexCorners, - cvf::Vec3d& localXdirection, - cvf::Vec3d& localYdirection, - cvf::Vec3d& localZdirection ) const -{ -// cvf::ubyte faceVertexIndices[4]; -// cvf::StructGridInterface::FaceEnum face; - -// face = cvf::StructGridInterface::NEG_I; -// cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); -// cvf::Vec3d faceCenterNegI = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], -// hexCorners[faceVertexIndices[1]], -// hexCorners[faceVertexIndices[2]], -// hexCorners[faceVertexIndices[3]] ); -// // TODO: Should we use face centroids instead of face centers? - -// face = cvf::StructGridInterface::POS_I; -// cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); -// cvf::Vec3d faceCenterPosI = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], -// hexCorners[faceVertexIndices[1]], -// hexCorners[faceVertexIndices[2]], -// hexCorners[faceVertexIndices[3]] ); - -// face = cvf::StructGridInterface::NEG_J; -// cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); -// cvf::Vec3d faceCenterNegJ = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], -// hexCorners[faceVertexIndices[1]], -// hexCorners[faceVertexIndices[2]], -// hexCorners[faceVertexIndices[3]] ); - -// face = cvf::StructGridInterface::POS_J; -// cvf::StructGridInterface::cellFaceVertexIndices( face, faceVertexIndices ); -// cvf::Vec3d faceCenterPosJ = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]], -// hexCorners[faceVertexIndices[1]], -// hexCorners[faceVertexIndices[2]], -// hexCorners[faceVertexIndices[3]] ); - -// cvf::Vec3d faceCenterCenterVectorI = faceCenterPosI - faceCenterNegI; -// cvf::Vec3d faceCenterCenterVectorJ = faceCenterPosJ - faceCenterNegJ; - -// localZdirection.cross( faceCenterCenterVectorI, faceCenterCenterVectorJ ); -// localZdirection.normalize(); - -// cvf::Vec3d crossPoductJZ; -// crossPoductJZ.cross( faceCenterCenterVectorJ, localZdirection ); -// localXdirection = faceCenterCenterVectorI + crossPoductJZ; -// localXdirection.normalize(); - -// cvf::Vec3d crossPoductIZ; -// crossPoductIZ.cross( faceCenterCenterVectorI, localZdirection ); -// localYdirection = faceCenterCenterVectorJ - crossPoductIZ; -// localYdirection.normalize(); - -// // TODO: Check if we end up with 0-vectors, and handle this case... - localXdirection = {1,0,0}; - localYdirection = {0,1,0}; - localZdirection = {0,0,1}; - -} - diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseWellLogExtractor.cpp b/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseWellLogExtractor.cpp deleted file mode 100644 index 98f62fad4..000000000 --- a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseWellLogExtractor.cpp +++ /dev/null @@ -1,211 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Statoil ASA -// Copyright (C) Ceetron Solutions AS -// -// 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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#include "RigEclipseWellLogExtractor.h" - -// #include "RiaLogging.h" - -#include "RigEclipseCaseData.h" -#include "RigMainGrid.h" -#include "RigResultAccessor.h" -#include "RigWellLogExtractionTools.h" -#include "RigWellPath.h" -#include "RigWellPathIntersectionTools.h" - -#include "../LibGeometry/cvfBoundingBox.h" -#include "../LibGeometry/cvfGeometryTools.h" - -#include - -//================================================================================================== -/// -//================================================================================================== - -RigEclipseWellLogExtractor::RigEclipseWellLogExtractor( gsl::not_null aCase, - gsl::not_null wellpath, - const std::string& wellCaseErrorMsgName ) - : RigWellLogExtractor( wellpath, wellCaseErrorMsgName ) - , m_caseData( aCase ) -{ - calculateIntersection(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigEclipseWellLogExtractor::calculateIntersection() -{ - std::map uniqueIntersections; - - bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards(); - - if ( m_wellPathGeometry->wellPathPoints().empty() ) return; - - for ( size_t wpp = 0; wpp < m_wellPathGeometry->wellPathPoints().size() - 1; ++wpp ) - { - std::vector intersections; - cvf::Vec3d p1 = m_wellPathGeometry->wellPathPoints()[wpp]; - cvf::Vec3d p2 = m_wellPathGeometry->wellPathPoints()[wpp + 1]; - - cvf::BoundingBox bb; - - bb.add( p1 ); - bb.add( p2 ); - - std::vector closeCellIndices = findCloseCellIndices( bb ); - - cvf::Vec3d hexCorners[8]; - for ( const auto& globalCellIndex : closeCellIndices ) - { - const RigCell& cell = m_caseData->mainGrid()->globalCellArray()[globalCellIndex]; - - if ( cell.isInvalid() || cell.subGrid() != nullptr ) continue; - - m_caseData->mainGrid()->cellCornerVertices( globalCellIndex, hexCorners ); - - RigHexIntersectionTools::lineHexCellIntersection( p1, p2, hexCorners, globalCellIndex, &intersections ); - } - - if ( !isCellFaceNormalsOut ) - { - for ( auto& intersection : intersections ) - { - intersection.m_isIntersectionEntering = !intersection.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_wellPathGeometry->measuredDepths()[wpp]; - double md2 = m_wellPathGeometry->measuredDepths()[wpp + 1]; - - insertIntersectionsInMap( intersections, p1, md1, p2, md2, &uniqueIntersections ); - } - - if ( uniqueIntersections.empty() && m_wellPathGeometry->wellPathPoints().size() > 1 ) - { - // When entering this function, all well path points are either completely outside the grid - // or all well path points are inside one cell - - cvf::Vec3d firstPoint = m_wellPathGeometry->wellPathPoints().front(); - cvf::Vec3d lastPoint = m_wellPathGeometry->wellPathPoints().back(); - - { - cvf::BoundingBox bb; - bb.add( firstPoint ); - - std::vector closeCellIndices = findCloseCellIndices( bb ); - - cvf::Vec3d hexCorners[8]; - for ( const auto& globalCellIndex : closeCellIndices ) - { - const RigCell& cell = m_caseData->mainGrid()->globalCellArray()[globalCellIndex]; - - if ( cell.isInvalid() ) continue; - - m_caseData->mainGrid()->cellCornerVertices( globalCellIndex, hexCorners ); - - if ( RigHexIntersectionTools::isPointInCell( firstPoint, hexCorners ) ) - { - if ( RigHexIntersectionTools::isPointInCell( lastPoint, hexCorners ) ) - { - { - // Mark the first well path point as entering the cell - - bool isEntering = true; - HexIntersectionInfo info( firstPoint, - isEntering, - cvf::StructGridInterface::NO_FACE, - globalCellIndex ); - RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().front(), - globalCellIndex, - isEntering ); - - uniqueIntersections.insert( std::make_pair( enterLeaveKey, info ) ); - } - - { - // Mark the last well path point as leaving cell - - bool isEntering = false; - HexIntersectionInfo info( lastPoint, isEntering, cvf::StructGridInterface::NO_FACE, globalCellIndex ); - RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().back(), - globalCellIndex, - isEntering ); - - uniqueIntersections.insert( std::make_pair( enterLeaveKey, info ) ); - } - } - else - { - // QString txt = - // "Detected two points assumed to be in the same cell, but they are in two different cells"; - // RiaLogging::debug( txt ); - std::cout << "error message \n"<< std::endl; - } - } - } - } - } - - this->populateReturnArrays( uniqueIntersections ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigEclipseWellLogExtractor::curveData( const RigResultAccessor* resultAccessor, std::vector* values ) -{ - CVF_TIGHT_ASSERT( values ); - values->resize( m_intersections.size() ); - - for ( size_t cpIdx = 0; cpIdx < m_intersections.size(); ++cpIdx ) - { - size_t cellIdx = m_intersectedCellsGlobIdx[cpIdx]; - cvf::StructGridInterface::FaceType cellFace = m_intersectedCellFaces[cpIdx]; - ( *values )[cpIdx] = resultAccessor->cellFaceScalarGlobIdx( cellIdx, cellFace ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RigEclipseWellLogExtractor::findCloseCellIndices( const cvf::BoundingBox& bb ) -{ - std::vector closeCells; - m_caseData->mainGrid()->findIntersectingCells( bb, &closeCells ); - return closeCells; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::Vec3d RigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex, - const cvf::Vec3d& startPoint, - const cvf::Vec3d& endPoint ) const -{ - std::array hexCorners; - m_caseData->mainGrid()->cellCornerVertices( cellIndex, hexCorners.data() ); - - return RigWellPathIntersectionTools::calculateLengthInCell( hexCorners, startPoint, endPoint ); -} diff --git a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseWellLogExtractor.h b/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseWellLogExtractor.h deleted file mode 100644 index a05bf68f9..000000000 --- a/src/opm/input/eclipse/Schedule/WellTrajResInSight/ReservoirDataModel/RigEclipseWellLogExtractor.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Statoil ASA -// Copyright (C) Ceetron Solutions AS -// -// 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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "RigWellLogExtractor.h" - -class RigEclipseCaseData; -class RigWellPath; -class RigResultAccessor; - -namespace cvf -{ -class BoundingBox; -} - -//================================================================================================== -/// -//================================================================================================== -class RigEclipseWellLogExtractor : public RigWellLogExtractor -{ -public: - RigEclipseWellLogExtractor( gsl::not_null aCase, - gsl::not_null wellpath, - const std::string& wellCaseErrorMsgName ); - - void curveData( const RigResultAccessor* resultAccessor, std::vector* values ); - const RigEclipseCaseData* caseData() { return m_caseData.p(); } - -private: - void calculateIntersection(); - std::vector findCloseCellIndices( const cvf::BoundingBox& bb ); - cvf::Vec3d - calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const override; - - cvf::cref m_caseData; -}; diff --git a/src/opm/input/eclipse/share/keywords/900_OPM/W/WELCOMPL b/src/opm/input/eclipse/share/keywords/900_OPM/W/WELCOMPL deleted file mode 100644 index 857fa1c00..000000000 --- a/src/opm/input/eclipse/share/keywords/900_OPM/W/WELCOMPL +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "WELCOMPL", - "sections": [ - "SCHEDULE" - ], - "items": [ - { - "item": 1, - "name": "WELL", - "value_type": "STRING" - }, - { - "item": 2, - "name": "COMPLETION", - "value_type": "STRING" - }, - { - "item": 3, - "name": "AHDEPTH_UPPER", - "value_type": "DOUBLE", - "dimension": "Length" - }, - { - "item": 4, - "name": "AHDEPTH_LOWER", - "value_type": "DOUBLE", - "dimension": "Length" - }, - { - "item": 5, - "name": "DIAMETER", - "value_type": "DOUBLE", - "dimension": "Length" - }, - { - "item": 6, - "name": "SKIN", - "value_type": "DOUBLE", - "dimension": "1" - } - - ] -} diff --git a/tests/parser/WellTrajectoryTests.cpp b/tests/parser/WellTrajectoryTests.cpp deleted file mode 100644 index 94f5f23c7..000000000 --- a/tests/parser/WellTrajectoryTests.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - Copyright .... -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -// using namespace Opm; -// namespace { - -// EclipseGrid makeGrid() -// { -// EclipseGrid grid(3, 3, 2, 10, 10, 5); - -// // std::vector actnum(27, 1); -// // for (const std::size_t layer : { 0, 1, 2 }) -// // actnum[grid.getGlobalIndex(0, 0, layer)] = 0; - -// // grid.resetACTNUM(actnum); -// return grid; -// } -// } - -// class Test : public RigWellLogExtractor { -// public : -// // static void insertIntersectionsInMap(const std::vector&, cvf::Vec3d, double, cvf::Vec3d, double, std::map*) -// static void insertIntersectionsInMap1() { RigWellLogExtractor::insertIntersectionsInMap(const std::vector&, cvf::Vec3d, double, cvf::Vec3d, double, std::map);} -// }; - -int main(int argc, char** argv) -{ - cvf::Vec3d p1(1,1,2); - cvf::Vec3d p2(11,11,2); - - double md1(0); - double md2(11); - - std::cout << "test \n"<< std::endl; - // const auto& grid = makeGrid(); - - // auto dim = grid.getNXYZ(); - // size_t idx = grid.getGlobalIndex(1, 1, 1); - - cvf::BoundingBox bb; - bb.add( p1 ); - bb.add( p2 ); - - std::vector bbs; - bbs.push_back(cvf::BoundingBox(cvf::Vec3d(0,0,0), cvf::Vec3d(1,1,1))); - bbs.push_back(cvf::BoundingBox(cvf::Vec3d(1,0,0), cvf::Vec3d(2,1,1))); - bbs.push_back(cvf::BoundingBox(cvf::Vec3d(2,0,0), cvf::Vec3d(3,1,1))); - bbs.push_back(cvf::BoundingBox(cvf::Vec3d(3,0,0), cvf::Vec3d(4,1,1))); - bbs.push_back(cvf::BoundingBox(cvf::Vec3d(4,0,0), cvf::Vec3d(5,1,1))); - bbs.push_back(cvf::BoundingBox(cvf::Vec3d(0.5,0.5,0), cvf::Vec3d(5.5,1.5,1))); - - std::vector ids; - ids.push_back(10); - ids.push_back(11); - ids.push_back(12); - ids.push_back(13); - ids.push_back(14); - ids.push_back(15); - - // cvf::BoundingBoxTree bbtree; - // bbtree.buildTreeFromBoundingBoxes(bbs, &ids); - // std::vector intIds; - // bbtree.findIntersections(cvf::BoundingBox(cvf::Vec3d(0.25,0.25,0.25), cvf::Vec3d(4.5,0.4,0.4)), &intIds); - - // cvf::ref m_cellSearchTree; - // m_cellSearchTree = nullptr; - // m_cellSearchTree = new cvf::BoundingBoxTree; - // m_cellSearchTree->buildTreeFromBoundingBoxes( bbs, nullptr ); - - // std::array dims = {3,3,1}; - // Opm::EclipseGrid grid(dims[0], dims[1], dims[2], 10, 10, 5); - // std::vector coord; - // coord = grid.getCOORD(); - // std::vector zcorn; - // zcorn= grid.getZCORN(); - - // WellTrajectory m_wellTrajectory(dims,coord, zcorn); - // m_wellTrajectory.buildCellSearchTree(); - - - - //------------------------------------------------------ - // std::vector closeCellIndices = m_wellTrajectory.findCloseCellIndices( bb ); - - // std::array cornerPointArray; - // std::vector intersections; - // cvf::Vec3d hexCorners_opm[8]; //opm numbering - // for ( const auto& globalCellIndex : closeCellIndices ) { - // const auto[i,j,k] = grid.getIJK(globalCellIndex); - - // for (std::size_t l = 0; l < 8; l++) { - // cornerPointArray = grid.getCornerPos(i,j,k,l); - // hexCorners_opm[l] = cvf::Vec3d(cornerPointArray[0], cornerPointArray[1], cornerPointArray[2]); - // } - // cvf::Vec3d hexCorners[8]; //resinsight numbering, see ApplicationLibCode\ReservoirDataModel\RigCellGeometryTools.cpp - // hexCorners[0] = hexCorners_opm[0]; - // hexCorners[1] = hexCorners_opm[1]; - // hexCorners[2] = hexCorners_opm[3]; - // hexCorners[3] = hexCorners_opm[2]; - // hexCorners[4] = hexCorners_opm[4]; - // hexCorners[5] = hexCorners_opm[5]; - // hexCorners[6] = hexCorners_opm[7]; - // hexCorners[7] = hexCorners_opm[6]; - - // RigHexIntersectionTools::lineHexCellIntersection( p1, p2, hexCorners, globalCellIndex, &intersections ); - // } - - // for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx) { - // intersections[intIdx].m_isIntersectionEntering = - // !intersections[intIdx].m_isIntersectionEntering; - // } - - // std::map uniqueIntersections; - - // RigWellLogExtractor::insertIntersectionsInMap( intersections, p1, md1, p2, md2, &uniqueIntersections ); - //---------------------------------------------------------------------------------------------------------- - - - std::vector points = {p1, p2}; - std::vector md = {md1, md2}; - RigWellPath m_wellPath(points, md); - // RigWellPath* wellPathGeometry = m_wellPath->wellPathGeometry(); - // int ii = m_wellPath->m_wellPathGeometry.size(); - - - cvf::ref wellPathGeometry = new RigWellPath; - wellPathGeometry->setWellPathPoints( points ); - wellPathGeometry->setMeasuredDepths( md ); - cvf::ref e = new MyRigEclipseWellLogExtractor( wellPathGeometry.p()); - auto intersections = e->cellIntersectionInfosAlongWellPath(); - - // m_wellPathGeometry.setDatumElevation(100.0); - // RigWellPath* wellPathGeometry1 = nullptr; - // const std::string& wellCaseErrorMsgName =""; - - // RigWellLogExtractor rwle( wellPathGeometry.p() , ""); - // rwle.populateReturnArrays(uniqueIntersections); - - std::cout << "end \n"<< std::endl; -}