///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2017 Statoil ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RifDataSourceForRftPltQMetaType.h" #include "RiaRftPltCurveDefinition.h" #include #include #include class RimEclipseCase; class RimEclipseResultCase; class RimWellLogCurve; class RimWellLogFileChannel; class RimWellLogPlot; class RimWellPath; class RiuWellRftPlot; class RigEclipseCaseData; //================================================================================================== /// //================================================================================================== enum FlowType { FLOW_TYPE_TOTAL, FLOW_TYPE_PHASE_SPLIT }; enum FlowPhase { FLOW_PHASE_NONE, FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER, FLOW_PHASE_TOTAL }; //================================================================================================== /// //================================================================================================== class RimWellPlotTools { static const std::set PRESSURE_DATA_NAMES; static const std::set OIL_CHANNEL_NAMES; static const std::set GAS_CHANNEL_NAMES; static const std::set WATER_CHANNEL_NAMES; static const std::set TOTAL_CHANNEL_NAMES; static std::set FLOW_DATA_NAMES; static bool hasPressureData(const RimWellLogFile* wellLogFile); static bool isPressureChannel(RimWellLogFileChannel* channel); static bool hasPressureData(RimEclipseResultCase* gridCase); static bool hasPressureData(RimWellPath* wellPath); static bool hasFlowData(RimEclipseResultCase* gridCase); static bool hasFlowData(RimWellPath* wellPath); static bool isFlowChannel(RimWellLogFileChannel* channel); static bool tryMatchChannelName(const std::set& channelNames, const QString& channelNameToMatch); public: // PLT Only static bool isOilFlowChannel(const QString& channelName); static bool isGasFlowChannel(const QString& channelName); static bool isWaterFlowChannel(const QString& channelName); static FlowPhase flowPhaseFromChannelName(const QString& channelName); static std::vector wellLogFilesContainingFlow(const QString& wellName); static std::vector getFlowChannelsFromWellFile(const RimWellLogFile* wellLogFile); static std::set findMatchingOrAdjacentTimeSteps(const std::set& baseTimeLine, const std::set& availableTimeSteps); static std::set availableSimWellTimesteps(RimEclipseCase * eclCase, const QString& simWellName ); static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName); // RFT Only static std::pair pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData); static void addTimeStepToMap(std::map>& destMap, const std::pair>& timeStepToAdd); static void addTimeStepsToMap(std::map>& destMap, const std::map>& timeStepsToAdd); static std::vector wellLogFilesContainingPressure(const QString& simWellName); static RimWellLogFileChannel* getPressureChannelFromWellFile(const RimWellLogFile* wellLogFile); static RimWellPath* wellPathFromWellLogFile(const RimWellLogFile* wellLogFile); static std::set timeStepsFromRftCase(RimEclipseResultCase* rftCase, const QString& simWellName); static std::set timeStepsFromGridCase(RimEclipseCase* gridCase); static QDateTime timeStepFromWellLogFile(RimWellLogFile* wellLogFile); static std::map> timeStepsMapFromRftCase(RimEclipseResultCase* rftCase, const QString& simWellName); static std::map> timeStepsMapFromGridCase(RimEclipseCase* gridCase); static std::map> timeStepsMapFromWellLogFile(RimWellLogFile* wellLogFile); static std::map> adjacentTimeSteps(const std::vector>>& allTimeSteps, const std::pair>& searchTimeStepPair); static RiaRftPltCurveDefinition curveDefFromCurve(const RimWellLogCurve* curve); template static void appendSet(std::set& destSet, const std::set& setToAppend); // others static bool hasFlowData(const RimWellLogFile* wellLogFile); // Both static std::vector gridCasesForWell(const QString& simWellName); static std::vector rftCasesForWell(const QString& simWellName); static QString simWellName(const QString& wellPathNameOrSimWellName); friend class StaticFieldsInitializer; }; //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- template void RimWellPlotTools::appendSet(std::set& destSet, const std::set& setToAppend) { destSet.insert(setToAppend.begin(), setToAppend.end()); }