2016-04-12 04:32:28 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-04-12 04:32:28 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-04-12 04:32:28 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-04-12 04:32:28 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-01-21 05:58:46 -06:00
|
|
|
#include "RiaDefines.h"
|
2021-04-27 08:08:48 -05:00
|
|
|
|
2017-09-15 07:26:06 -05:00
|
|
|
#include "RifSummaryReaderInterface.h"
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2018-03-15 08:23:48 -05:00
|
|
|
#include <QString>
|
2018-04-17 04:01:24 -05:00
|
|
|
#include <QStringList>
|
2018-03-15 08:23:48 -05:00
|
|
|
|
2016-06-21 08:56:09 -05:00
|
|
|
#include <map>
|
2018-09-13 05:38:17 -05:00
|
|
|
#include <memory>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2018-03-15 08:23:48 -05:00
|
|
|
|
2021-03-25 06:56:09 -05:00
|
|
|
class RifOpmCommonEclipseSummary;
|
2021-04-08 08:53:38 -05:00
|
|
|
class RifOpmHdf5Summary;
|
2021-04-27 08:08:48 -05:00
|
|
|
class RifEclEclipseSummary;
|
2021-04-08 08:53:38 -05:00
|
|
|
class RiaThreadSafeLogger;
|
2021-04-27 08:08:48 -05:00
|
|
|
class RifEclipseSummaryAddress;
|
2018-03-15 08:23:48 -05:00
|
|
|
|
2016-04-12 04:32:28 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2017-09-15 07:26:06 -05:00
|
|
|
class RifReaderEclipseSummary : public RifSummaryReaderInterface
|
2016-04-12 04:32:28 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
RifReaderEclipseSummary();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RifReaderEclipseSummary() override;
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2021-04-27 08:08:48 -05:00
|
|
|
bool open( const QString& headerFileName, RiaThreadSafeLogger* threadSafeLogger );
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2023-02-13 05:40:08 -06:00
|
|
|
std::vector<time_t> timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override;
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2023-09-29 10:52:31 -05:00
|
|
|
std::pair<bool, std::vector<double>> values( const RifEclipseSummaryAddress& resultAddress ) const override;
|
|
|
|
std::string unitName( const RifEclipseSummaryAddress& resultAddress ) const override;
|
|
|
|
RiaDefines::EclipseUnitSystem unitSystem() const override;
|
2024-02-26 06:55:41 -06:00
|
|
|
void buildMetaData() override;
|
2018-04-17 04:01:24 -05:00
|
|
|
|
2016-04-12 04:32:28 -05:00
|
|
|
private:
|
2021-04-27 08:08:48 -05:00
|
|
|
RifSummaryReaderInterface* currentSummaryReader() const;
|
2019-07-25 00:38:46 -05:00
|
|
|
|
2021-04-27 08:08:48 -05:00
|
|
|
private:
|
|
|
|
std::unique_ptr<RifSummaryReaderInterface> m_summaryReader;
|
|
|
|
std::set<RifEclipseSummaryAddress> m_differenceAddresses;
|
2021-03-25 06:56:09 -05:00
|
|
|
|
2021-04-27 08:08:48 -05:00
|
|
|
private:
|
2018-09-13 05:38:17 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class ValuesCache
|
|
|
|
{
|
|
|
|
static const std::vector<double> EMPTY_VECTOR;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ValuesCache();
|
|
|
|
~ValuesCache();
|
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
void insertValues( const RifEclipseSummaryAddress& address, const std::vector<double>& values );
|
2019-09-06 03:40:57 -05:00
|
|
|
const std::vector<double>& getValues( const RifEclipseSummaryAddress& address ) const;
|
2018-09-13 05:38:17 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::map<const RifEclipseSummaryAddress, std::vector<double>> m_cachedValues;
|
|
|
|
};
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::unique_ptr<ValuesCache> m_valuesCache;
|
2016-04-12 04:32:28 -05:00
|
|
|
};
|