2017-08-11 00:47:40 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-08-11 08:10:08 -05:00
|
|
|
#include "RigEclipseResultInfo.h"
|
2017-08-11 00:47:40 -05:00
|
|
|
|
2017-08-11 02:21:32 -05:00
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 08:10:08 -05:00
|
|
|
RigEclipseTimeStepInfo::RigEclipseTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart)
|
2017-08-11 02:21:32 -05:00
|
|
|
: m_date(date),
|
|
|
|
m_reportNumber(reportNumber),
|
|
|
|
m_daysSinceSimulationStart(daysSinceSimulationStart)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 08:10:08 -05:00
|
|
|
std::vector<RigEclipseTimeStepInfo> RigEclipseTimeStepInfo::createTimeStepInfos(std::vector<QDateTime> dates,
|
2017-08-11 02:21:32 -05:00
|
|
|
std::vector<int> reportNumbers,
|
|
|
|
std::vector<double> daysSinceSimulationStarts)
|
|
|
|
{
|
|
|
|
CVF_ASSERT(dates.size() == reportNumbers.size());
|
|
|
|
CVF_ASSERT(dates.size() == daysSinceSimulationStarts.size());
|
|
|
|
|
2017-08-11 08:10:08 -05:00
|
|
|
std::vector<RigEclipseTimeStepInfo> timeStepInfos;
|
2017-08-11 02:21:32 -05:00
|
|
|
|
|
|
|
for (size_t i = 0; i < dates.size(); i++)
|
|
|
|
{
|
2017-08-11 08:10:08 -05:00
|
|
|
timeStepInfos.push_back(RigEclipseTimeStepInfo(dates[i], reportNumbers[i], daysSinceSimulationStarts[i]));
|
2017-08-11 02:21:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return timeStepInfos;
|
|
|
|
}
|
|
|
|
|
2017-08-11 00:47:40 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 08:10:08 -05:00
|
|
|
RigEclipseResultInfo::RigEclipseResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated,
|
2017-08-11 00:47:40 -05:00
|
|
|
QString resultName, size_t gridScalarResultIndex)
|
|
|
|
: m_resultType(resultType),
|
|
|
|
m_needsToBeStored(needsToBeStored),
|
|
|
|
m_mustBeCalculated(mustBeCalculated),
|
|
|
|
m_resultName(resultName),
|
|
|
|
m_gridScalarResultIndex(gridScalarResultIndex)
|
|
|
|
{
|
|
|
|
}
|
2017-08-11 02:21:32 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 08:10:08 -05:00
|
|
|
std::vector<QDateTime> RigEclipseResultInfo::dates() const
|
2017-08-11 02:21:32 -05:00
|
|
|
{
|
|
|
|
std::vector<QDateTime> values;
|
|
|
|
|
|
|
|
for (auto v : m_timeStepInfos)
|
|
|
|
{
|
|
|
|
values.push_back(v.m_date);
|
|
|
|
}
|
|
|
|
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 08:10:08 -05:00
|
|
|
std::vector<double> RigEclipseResultInfo::daysSinceSimulationStarts() const
|
2017-08-11 02:21:32 -05:00
|
|
|
{
|
|
|
|
std::vector<double> values;
|
|
|
|
|
|
|
|
for (auto v : m_timeStepInfos)
|
|
|
|
{
|
|
|
|
values.push_back(v.m_daysSinceSimulationStart);
|
|
|
|
}
|
|
|
|
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 08:10:08 -05:00
|
|
|
std::vector<int> RigEclipseResultInfo::reportNumbers() const
|
2017-08-11 02:21:32 -05:00
|
|
|
{
|
|
|
|
std::vector<int> values;
|
|
|
|
|
|
|
|
for (auto v : m_timeStepInfos)
|
|
|
|
{
|
|
|
|
values.push_back(v.m_reportNumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|