///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2011-2012 Statoil ASA, Ceetron AS // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RifReaderInterface.h" #include #include class RifEclipseOutputFileTools; class RifEclipseRestartDataAccess; class RigGridBase; class RigMainGrid; class RigActiveCellInfo; typedef struct ecl_grid_struct ecl_grid_type; typedef struct ecl_file_struct ecl_file_type; //================================================================================================== // // File interface for Eclipse output files // //================================================================================================== class RifReaderEclipseOutput : public RifReaderInterface { public: RifReaderEclipseOutput(); virtual ~RifReaderEclipseOutput(); bool open(const QString& fileName, RigEclipseCase* eclipseCase); virtual bool openAndReadActiveCellData(const QString& fileName, RigEclipseCase* mainEclipseCase, RigEclipseCase* eclipseCase); void close(); bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector* values); bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector* values); static bool transferGeometry(const ecl_grid_type* mainEclGrid, RigEclipseCase* eclipseCase); private: bool readActiveCellInfo(); bool buildMetaData(); void readWellCells(); bool openInitFile(); bool openDynamicAccess(); void extractResultValuesBasedOnPorosityModel(PorosityModelResultType matrixOrFracture, std::vector* values, const std::vector& fileValues); static RifEclipseRestartDataAccess* createDynamicResultsAccess(const QStringList& fileSet); QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, PorosityModelResultType matrixOrFracture, size_t timeStepCount) const; virtual QList timeSteps(); private: QString m_fileName; // Name of file used to start accessing Eclipse output files QStringList m_fileSet; // Set of files in filename's path with same base name as filename cvf::ref m_eclipseCase; QList m_timeSteps; ecl_file_type* m_ecl_init_file; // File access to static results cvf::ref m_dynamicResultsAccess; // File access to dynamic results };