Remove obsolete code in RimWellPlotTools, sorted header according to actual use.

This commit is contained in:
Jacob Støren 2017-11-15 17:07:49 +01:00
parent ff7ae94e43
commit 7ff93e9154
2 changed files with 22 additions and 101 deletions

View File

@ -249,41 +249,6 @@ void RimWellPlotTools::addTimeStepsToMap(std::map<QDateTime, std::set<RifDataSou
}
}
}
#if 0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure(const QString& wellPathName)
{
std::vector<RimWellLogFile*> wellLogFiles;
const RimProject* const project = RiaApplication::instance()->project();
for (const auto& oilField : project->oilFields)
{
auto wellPathsVector = std::vector<RimWellPath*>(oilField->wellPathCollection()->wellPaths.begin(), oilField->wellPathCollection()->wellPaths.end());
for (const auto& wellPath : wellPathsVector)
{
bool hasPressure = false;
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
for (RimWellLogFile* const file : files)
{
size_t timeStepCount = timeStepsMapFromWellLogFile(file).size(); // todo: only one timestep
if (timeStepCount == 0) continue;
if (RiaWellNameComparer::tryFindMatchingWellPath(wellPathName).isEmpty()) continue;
if (hasPressureData(file))
{
wellLogFiles.push_back(file);
}
}
}
}
return wellLogFiles;
}
#endif
//--------------------------------------------------------------------------------------------------
///
@ -358,36 +323,6 @@ std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingFlow(const
return wellLogFiles;
}
#if 0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingFlow(const QString& wellPathName)
{
std::vector<RimWellLogFile*> wellLogFiles;
const RimProject* const project = RiaApplication::instance()->project();
for (const auto& wellPath : project->allWellPaths())
{
bool hasPressure = false;
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
for (RimWellLogFile* const file : files)
{
size_t timeStepCount = timeStepsMapFromWellLogFile(file).size(); // todo: only one timestep
if (timeStepCount == 0) continue;
if (RiaWellNameComparer::tryFindMatchingWellPath(wellPathName).isEmpty()) continue;
if (hasFlowData(file))
{
wellLogFiles.push_back(file);
}
}
}
return wellLogFiles;
}
#endif
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -664,17 +599,6 @@ std::set<QDateTime> RimWellPlotTools::availableSimWellTimesteps(RimEclipseCase *
return availebleTimeSteps;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPlotTools::mapContainsTimeStep(const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& map, const QDateTime& timeStep)
{
return std::find_if(map.begin(), map.end(), [timeStep](const std::pair<QDateTime, std::set<RifDataSourceForRftPlt>>& pair)
{
return pair.first == timeStep;
}) != map.end();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -56,60 +56,57 @@ class RimWellPlotTools
static std::set<QString> FLOW_DATA_NAMES;
public:
static bool hasPressureData(const RimWellLogFile* wellLogFile);
static bool isPressureChannel(RimWellLogFileChannel* channel);
static bool hasPressureData(RimEclipseResultCase* gridCase);
static bool hasPressureData(RimWellPath* wellPath);
static std::pair<size_t, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
static bool hasFlowData(const RimWellLogFile* wellLogFile);
static bool hasFlowData(RimEclipseResultCase* gridCase);
static bool hasFlowData(RimWellPath* wellPath);
static bool isFlowChannel(RimWellLogFileChannel* channel);
static bool tryMatchChannelName(const std::set<QString>& 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 bool hasFlowData(RimEclipseResultCase* gridCase);
static bool hasFlowData(RimWellPath* wellPath);
static FlowPhase flowPhaseFromChannelName(const QString& channelName);
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow(const QString& wellName);
static std::vector<RimWellLogFileChannel*> getFlowChannelsFromWellFile(const RimWellLogFile* wellLogFile);
static std::set<QDateTime> findMatchingOrAdjacentTimeSteps(const std::set<QDateTime>& baseTimeLine, const std::set<QDateTime>& availableTimeSteps);
static std::set<QDateTime> availableSimWellTimesteps(RimEclipseCase * eclCase, const QString& simWellName );
static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName);
// RFT Only
static std::pair<size_t, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
static void addTimeStepToMap(std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
const std::pair<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepToAdd);
static void addTimeStepsToMap(std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd);
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure(const QString& simWellName);
static RimWellLogFileChannel* getPressureChannelFromWellFile(const RimWellLogFile* wellLogFile);
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow(const QString& wellName);
static std::vector<RimWellLogFileChannel*> getFlowChannelsFromWellFile(const RimWellLogFile* wellLogFile);
static RimWellPath* wellPathFromWellLogFile(const RimWellLogFile* wellLogFile);
static std::vector<RimEclipseResultCase*> gridCasesForWell(const QString& simWellName);
static std::vector<RimEclipseResultCase*> rftCasesForWell(const QString& simWellName);
static std::set<QDateTime> timeStepsFromRftCase(RimEclipseResultCase* rftCase, const QString& simWellName);
static std::set<QDateTime> timeStepsFromGridCase(RimEclipseCase* gridCase);
static QDateTime timeStepFromWellLogFile(RimWellLogFile* wellLogFile);
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromRftCase(RimEclipseResultCase* rftCase, const QString& simWellName);
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase(RimEclipseCase* gridCase);
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromWellLogFile(RimWellLogFile* wellLogFile);
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> adjacentTimeSteps(const std::vector<std::pair<QDateTime, std::set<RifDataSourceForRftPlt>>>& allTimeSteps,
const std::pair<QDateTime, std::set<RifDataSourceForRftPlt>>& searchTimeStepPair);
static std::set<QDateTime> findMatchingOrAdjacentTimeSteps(const std::set<QDateTime>& baseTimeLine, const std::set<QDateTime>& availableTimeSteps);
static std::set<QDateTime> availableSimWellTimesteps(RimEclipseCase * eclCase, const QString& simWellName );
static bool mapContainsTimeStep(const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& map, const QDateTime& timeStep);
static RiaRftPltCurveDefinition curveDefFromCurve(const RimWellLogCurve* curve);
static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName);
static QString simWellName(const QString& wellPathNameOrSimWellName);
static bool tryMatchChannelName(const std::set<QString>& channelNames, const QString& channelNameToMatch);
template<typename T>
static void appendSet(std::set<T>& destSet, const std::set<T>& setToAppend);
// others
static bool hasFlowData(const RimWellLogFile* wellLogFile);
// Both
static std::vector<RimEclipseResultCase*> gridCasesForWell(const QString& simWellName);
static std::vector<RimEclipseResultCase*> rftCasesForWell(const QString& simWellName);
static QString simWellName(const QString& wellPathNameOrSimWellName);
friend class StaticFieldsInitializer;
};