2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -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
|
|
|
//
|
2012-05-18 02:45:23 -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>
|
2012-05-18 02:45:23 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-08-24 23:51:56 -05:00
|
|
|
#include "RifEclipseRestartDataAccess.h"
|
|
|
|
|
|
|
|
#include "ert/ecl/ecl_util.h"
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cvfObject.h"
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <QDateTime>
|
2012-05-18 02:45:23 -05:00
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
2017-08-24 23:51:56 -05:00
|
|
|
#include <vector>
|
2013-02-05 03:51:32 -06:00
|
|
|
|
|
|
|
typedef struct ecl_file_struct ecl_file_type;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-08-24 23:51:56 -05:00
|
|
|
class RifEclipseRestartDataAccess;
|
2019-03-18 06:52:01 -05:00
|
|
|
class QByteArray;
|
2013-01-30 07:13:50 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05:00
|
|
|
//
|
|
|
|
//==================================================================================================
|
2013-02-05 03:51:32 -06:00
|
|
|
class RifEclipseOutputFileTools
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
public:
|
2012-06-26 09:10:41 -05:00
|
|
|
RifEclipseOutputFileTools();
|
|
|
|
virtual ~RifEclipseOutputFileTools();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
static void
|
|
|
|
findKeywordsAndItemCount( std::vector<ecl_file_type*> ecl_files, QStringList* resultNames, std::vector<size_t>* resultDataItemCounts );
|
|
|
|
|
|
|
|
static bool keywordData( const ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<double>* values );
|
|
|
|
static bool keywordData( const ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<int>* values );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void timeSteps( const ecl_file_type* ecl_file,
|
|
|
|
std::vector<QDateTime>* timeSteps,
|
2020-04-06 05:15:28 -05:00
|
|
|
std::vector<double>* daysSinceSimulationStart,
|
|
|
|
size_t* perTimeStepHeaderKeywordCount );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static bool isValidEclipseFileName( const QString& fileName );
|
|
|
|
static QByteArray md5sum( const QString& fileName );
|
|
|
|
static bool findSiblingFilesWithSameBaseName( const QString& fileName, QStringList* fileSet );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static QString firstFileNameOfType( const QStringList& fileSet, ecl_file_enum fileType );
|
|
|
|
static QStringList filterFileNamesOfType( const QStringList& fileSet, ecl_file_enum fileType );
|
2013-04-07 09:33:45 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void readGridDimensions( const QString& gridFileName, std::vector<std::vector<int>>& gridDimensions );
|
2014-08-27 07:05:29 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static int readUnitsType( const ecl_file_type* ecl_file );
|
2016-07-14 06:35:32 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static cvf::ref<RifEclipseRestartDataAccess> createDynamicResultAccess( const QString& fileName );
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static QString createIndexFileName( const QString& resultFileName );
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static std::set<RiaDefines::PhaseType> findAvailablePhases( const ecl_file_type* ecl_file );
|
2017-11-10 02:43:51 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void transferNncFluxData( const ecl_grid_type* grid,
|
|
|
|
const ecl_file_view_type* summaryView,
|
|
|
|
std::vector<double>* waterFlux,
|
|
|
|
std::vector<double>* oilFlux,
|
|
|
|
std::vector<double>* gasFlux );
|
2017-11-14 03:43:14 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static bool isExportedFromIntersect( const ecl_file_type* ecl_file );
|
2018-11-13 02:28:13 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static FILE* fopen( const QString& filePath, const QString& mode );
|
2019-03-18 06:52:01 -05:00
|
|
|
|
2016-07-14 06:35:32 -05:00
|
|
|
private:
|
2023-02-26 03:48:40 -06:00
|
|
|
static void createReportStepsMetaData( std::vector<ecl_file_type*> ecl_files, std::vector<RifRestartReportStep>* reportSteps );
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|