2014-01-07 17:39:07 +01:00
|
|
|
/*
|
|
|
|
|
Copyright 2013 Statoil ASA.
|
|
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
|
|
OPM 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.
|
|
|
|
|
|
|
|
|
|
OPM 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 for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-10-01 16:07:44 +02:00
|
|
|
#ifndef OPM_ECLIPSE_STATE_HPP
|
|
|
|
|
#define OPM_ECLIPSE_STATE_HPP
|
2014-01-07 17:39:07 +01:00
|
|
|
|
2014-05-30 10:08:35 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp>
|
2016-01-15 08:42:57 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
|
2014-06-23 11:58:27 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
2014-01-08 16:03:19 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
2015-07-26 23:13:49 +02:00
|
|
|
|
2014-01-07 17:52:20 +01:00
|
|
|
#include <set>
|
2014-01-07 17:39:07 +01:00
|
|
|
|
|
|
|
|
namespace Opm {
|
2016-01-15 08:42:57 +01:00
|
|
|
|
|
|
|
|
template< typename > class GridProperty;
|
|
|
|
|
template< typename > class GridProperties;
|
|
|
|
|
|
|
|
|
|
class Deck;
|
|
|
|
|
class DeckItem;
|
|
|
|
|
class Fault;
|
|
|
|
|
class FaultCollection;
|
|
|
|
|
class InitConfig;
|
|
|
|
|
class IOConfig;
|
|
|
|
|
class ParseMode;
|
|
|
|
|
class Schedule;
|
|
|
|
|
class Section;
|
|
|
|
|
class SimulationConfig;
|
|
|
|
|
class TableManager;
|
|
|
|
|
|
2014-01-07 17:39:07 +01:00
|
|
|
class EclipseState {
|
|
|
|
|
public:
|
2014-08-27 12:18:34 +02:00
|
|
|
enum EnabledTypes {
|
|
|
|
|
IntProperties = 0x01,
|
|
|
|
|
DoubleProperties = 0x02,
|
|
|
|
|
|
|
|
|
|
AllProperties = IntProperties | DoubleProperties
|
|
|
|
|
};
|
|
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
EclipseState(std::shared_ptr< const Deck > deck , const ParseMode& parseMode);
|
2014-08-27 12:18:34 +02:00
|
|
|
|
2015-09-23 10:36:10 +02:00
|
|
|
const ParseMode& getParseMode() const;
|
2016-01-15 08:42:57 +01:00
|
|
|
std::shared_ptr< const Schedule > getSchedule() const;
|
|
|
|
|
std::shared_ptr< const IOConfig > getIOConfigConst() const;
|
|
|
|
|
std::shared_ptr< IOConfig > getIOConfig() const;
|
|
|
|
|
std::shared_ptr< const InitConfig > getInitConfig() const;
|
|
|
|
|
std::shared_ptr< const SimulationConfig > getSimulationConfig() const;
|
|
|
|
|
std::shared_ptr< const EclipseGrid > getEclipseGrid() const;
|
|
|
|
|
std::shared_ptr< EclipseGrid > getEclipseGridCopy() const;
|
2014-01-28 08:18:03 +01:00
|
|
|
bool hasPhase(enum Phase::PhaseEnum phase) const;
|
2014-01-29 19:39:33 +01:00
|
|
|
std::string getTitle() const;
|
2014-08-27 12:18:34 +02:00
|
|
|
bool supportsGridProperty(const std::string& keyword, int enabledTypes=AllProperties) const;
|
2014-06-02 09:07:16 +02:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
std::shared_ptr<GridProperty<int> > getRegion(std::shared_ptr< const DeckItem > regionItem) const;
|
2015-03-03 15:40:55 +01:00
|
|
|
std::shared_ptr<GridProperty<int> > getDefaultRegion() const;
|
2014-06-02 16:23:01 +02:00
|
|
|
std::shared_ptr<GridProperty<int> > getIntGridProperty( const std::string& keyword ) const;
|
|
|
|
|
std::shared_ptr<GridProperty<double> > getDoubleGridProperty( const std::string& keyword ) const;
|
2014-05-16 15:58:04 +02:00
|
|
|
bool hasIntGridProperty(const std::string& keyword) const;
|
2014-06-02 09:07:16 +02:00
|
|
|
bool hasDoubleGridProperty(const std::string& keyword) const;
|
|
|
|
|
|
2014-10-03 14:21:20 +02:00
|
|
|
void loadGridPropertyFromDeckKeyword(std::shared_ptr<const Box> inputBox,
|
2016-01-15 08:42:57 +01:00
|
|
|
std::shared_ptr< const DeckKeyword > deckKeyword,
|
2014-10-03 14:21:20 +02:00
|
|
|
int enabledTypes = AllProperties);
|
2014-06-23 11:58:27 +02:00
|
|
|
|
2014-07-05 13:47:22 +02:00
|
|
|
std::shared_ptr<const FaultCollection> getFaults() const;
|
2014-06-23 11:58:27 +02:00
|
|
|
std::shared_ptr<const TransMult> getTransMult() const;
|
2015-06-10 09:02:51 +02:00
|
|
|
std::shared_ptr<const NNC> getNNC() const;
|
|
|
|
|
bool hasNNC() const;
|
2014-09-09 12:16:13 +02:00
|
|
|
|
2015-09-01 10:48:46 +02:00
|
|
|
std::shared_ptr<const TableManager> getTableManager() const;
|
2015-06-05 14:00:33 +02:00
|
|
|
size_t getNumPhases() const;
|
2014-09-16 13:14:12 +02:00
|
|
|
|
2014-09-09 12:16:13 +02:00
|
|
|
// the unit system used by the deck. note that it is rarely needed to convert
|
|
|
|
|
// units because internally to opm-parser everything is represented by SI
|
|
|
|
|
// units...
|
|
|
|
|
std::shared_ptr<const UnitSystem> getDeckUnitSystem() const;
|
2015-11-02 12:18:03 +01:00
|
|
|
void applyModifierDeck( std::shared_ptr<const Deck> deck);
|
2014-09-09 12:16:13 +02:00
|
|
|
|
2014-01-07 17:39:07 +01:00
|
|
|
private:
|
2016-01-15 08:42:57 +01:00
|
|
|
void initTabdims(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initTables(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initIOConfig(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initSchedule(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initIOConfigPostSchedule(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initInitConfig(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initSimulationConfig(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initEclipseGrid(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initGridopts(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initPhases(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initTitle(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initProperties(std::shared_ptr< const Deck > deck);
|
2015-01-16 14:51:57 +01:00
|
|
|
void initTransMult();
|
2016-01-15 08:42:57 +01:00
|
|
|
void initFaults(std::shared_ptr< const Deck > deck);
|
|
|
|
|
void initNNC(std::shared_ptr< const Deck > deck);
|
2015-01-16 14:51:57 +01:00
|
|
|
|
2014-09-16 13:14:12 +02:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
void setMULTFLT(std::shared_ptr<const Opm::Section> section) const;
|
|
|
|
|
void initMULTREGT(std::shared_ptr< const Deck > deck);
|
2014-05-30 15:05:56 +02:00
|
|
|
|
2014-06-03 17:45:55 +02:00
|
|
|
double getSIScaling(const std::string &dimensionString) const;
|
|
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
void processGridProperties(std::shared_ptr< const Deck > deck, int enabledTypes);
|
2015-01-16 14:51:57 +01:00
|
|
|
void scanSection(std::shared_ptr<Opm::Section> section , int enabledTypes);
|
2016-01-15 08:42:57 +01:00
|
|
|
void handleADDKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , BoxManager& boxManager, int enabledTypes);
|
|
|
|
|
void handleBOXKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , BoxManager& boxManager);
|
|
|
|
|
void handleCOPYKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , BoxManager& boxManager, int enabledTypes);
|
2014-06-02 16:49:21 +02:00
|
|
|
void handleENDBOXKeyword(BoxManager& boxManager);
|
2016-01-15 08:42:57 +01:00
|
|
|
void handleEQUALSKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , BoxManager& boxManager, int enabledTypes);
|
|
|
|
|
void handleMULTIPLYKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , BoxManager& boxManager, int enabledTypes);
|
2014-12-15 16:59:41 +01:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
void handleEQUALREGKeyword(std::shared_ptr< const DeckKeyword > deckKeyword, int enabledTypes);
|
|
|
|
|
void handleMULTIREGKeyword(std::shared_ptr< const DeckKeyword > deckKeyword, int enabledTypes);
|
|
|
|
|
void handleADDREGKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , int enabledTypes);
|
|
|
|
|
void handleCOPYREGKeyword(std::shared_ptr< const DeckKeyword > deckKeyword , int enabledTypes);
|
2014-12-08 13:39:32 +01:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
void setKeywordBox(std::shared_ptr< const DeckKeyword > deckKeyword, size_t recordIdx, BoxManager& boxManager);
|
2014-06-02 09:07:16 +02:00
|
|
|
|
2014-05-30 13:20:30 +02:00
|
|
|
void copyIntKeyword(const std::string& srcField , const std::string& targetField , std::shared_ptr<const Box> inputBox);
|
2014-06-02 09:07:16 +02:00
|
|
|
void copyDoubleKeyword(const std::string& srcField , const std::string& targetField , std::shared_ptr<const Box> inputBox);
|
2014-01-07 17:52:20 +01:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
void complainAboutAmbiguousKeyword(std::shared_ptr< const Deck > deck, const std::string& keywordName) const;
|
2014-10-03 14:21:20 +02:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
std::shared_ptr< const EclipseGrid > m_eclipseGrid;
|
|
|
|
|
std::shared_ptr< IOConfig > m_ioConfig;
|
|
|
|
|
std::shared_ptr< const InitConfig > m_initConfig;
|
|
|
|
|
std::shared_ptr< const Schedule > schedule;
|
|
|
|
|
std::shared_ptr< const SimulationConfig > m_simulationConfig;
|
2014-09-16 13:14:12 +02:00
|
|
|
|
2015-09-01 10:38:12 +02:00
|
|
|
std::shared_ptr<const TableManager> m_tables;
|
2014-09-16 13:14:12 +02:00
|
|
|
|
2014-01-28 08:18:03 +01:00
|
|
|
std::set<enum Phase::PhaseEnum> phases;
|
2014-01-29 19:39:33 +01:00
|
|
|
std::string m_title;
|
2014-09-09 12:16:13 +02:00
|
|
|
std::shared_ptr<const UnitSystem> m_deckUnitSystem;
|
2014-05-16 15:58:04 +02:00
|
|
|
std::shared_ptr<GridProperties<int> > m_intGridProperties;
|
2014-06-02 09:07:16 +02:00
|
|
|
std::shared_ptr<GridProperties<double> > m_doubleGridProperties;
|
2014-06-23 11:58:27 +02:00
|
|
|
std::shared_ptr<TransMult> m_transMult;
|
2014-07-05 13:47:22 +02:00
|
|
|
std::shared_ptr<FaultCollection> m_faults;
|
2015-06-10 09:02:51 +02:00
|
|
|
std::shared_ptr<NNC> m_nnc;
|
2015-03-03 15:40:55 +01:00
|
|
|
std::string m_defaultRegion;
|
2015-09-23 10:36:10 +02:00
|
|
|
const ParseMode& m_parseMode;
|
2014-01-07 17:39:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef std::shared_ptr<EclipseState> EclipseStatePtr;
|
|
|
|
|
typedef std::shared_ptr<const EclipseState> EclipseStateConstPtr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|