Files

94 lines
3.2 KiB
C++
Raw Permalink Normal View History

2021-03-25 12:56:09 +01:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor 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.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RifEnsembleImportConfig.h"
2021-03-25 12:56:09 +01:00
#include "RifSummaryReaderInterface.h"
#include <QString>
#include <QStringList>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <tuple>
2021-03-25 12:56:09 +01:00
#include <vector>
namespace Opm
{
namespace EclIO
{
class ESmry;
class ExtESmry;
2021-03-25 12:56:09 +01:00
} // namespace EclIO
} // namespace Opm
class RiaThreadSafeLogger;
class RifEclipseSummaryAddress;
2021-03-25 12:56:09 +01:00
//==================================================================================================
//
//
//==================================================================================================
class RifOpmCommonEclipseSummary : public RifSummaryReaderInterface
{
public:
RifOpmCommonEclipseSummary();
2021-04-15 02:14:51 +00:00
~RifOpmCommonEclipseSummary() override;
2021-03-25 12:56:09 +01:00
void useEnhancedSummaryFiles( bool enable );
void createEnhancedSummaryFiles( bool enable );
void setEnsembleImportState( RifEnsembleImportConfig ensembleImportState );
static void resetEnhancedSummaryFileCount();
static size_t numberOfEnhancedSummaryFileCreated();
2021-03-25 12:56:09 +01:00
bool open( const QString& fileName, bool includeRestartFiles, RiaThreadSafeLogger* threadSafeLogger );
2021-03-25 12:56:09 +01:00
std::vector<time_t> timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override;
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;
2021-03-25 12:56:09 +01:00
private:
size_t keywordCount() const override;
void createAndSetAddresses() override;
bool openFileReader( const QString& fileName, bool includeRestartFiles, bool importEsmryFile, RiaThreadSafeLogger* threadSafeLogger );
void populateTimeSteps();
2025-07-18 08:05:10 +02:00
std::string keywordForAddress( const RifEclipseSummaryAddress& address ) const;
2021-03-25 12:56:09 +01:00
static bool writeEsmryFile( QString& smspecFileName, bool includeRestartFiles, RiaThreadSafeLogger* threadSafeLogger );
static void increaseEsmryFileCount();
2021-03-25 12:56:09 +01:00
private:
std::unique_ptr<Opm::EclIO::ESmry> m_standardReader;
std::unique_ptr<Opm::EclIO::ExtESmry> m_enhancedReader;
std::map<RifEclipseSummaryAddress, std::string> m_summaryAddressToKeywordMap;
std::vector<time_t> m_timeSteps;
2021-03-25 12:56:09 +01:00
static size_t sm_createdEsmryFileCount;
2021-03-25 12:56:09 +01:00
bool m_useEsmryFiles;
bool m_createEsmryFiles;
RifEnsembleImportConfig m_ensembleImportState;
2021-03-25 12:56:09 +01:00
};