Merge pull request #1943 from wito/schedule-keyword-functions
Schedule Keyword Handler Dispatch
This commit is contained in:
commit
0530b9b1a3
@ -97,6 +97,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/State.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.cpp
|
||||
@ -107,7 +108,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/icd.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
|
||||
@ -127,7 +128,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/TimeMap.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
|
||||
|
@ -401,71 +401,7 @@ namespace Opm
|
||||
void addGroupToGroup( const std::string& parent_group, const Group& child_group, size_t timeStep);
|
||||
void addGroup(const std::string& groupName , size_t timeStep, const UnitSystem& unit_system);
|
||||
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, Connection::Order connection_order, const UnitSystem& unit_system);
|
||||
void handleEXIT(const DeckKeyword& keyword , size_t report_step);
|
||||
void handleUDQ(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWLIST(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPORD(const ParseContext& parseContext, ErrorGuard& errors, const DeckKeyword& compordKeyword, size_t currentStep);
|
||||
void handleWELSPECS( const SCHEDULESection&, size_t, size_t , const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONHIST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const FieldPropsManager& fp, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleCOMPLUMP( const DeckKeyword& keyword, size_t currentStep );
|
||||
void handleWELSEGS( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSEGSICD( const DeckKeyword& keyword, size_t currentStep);
|
||||
// TODO: we should incorporate ParseContext and ErrorGuard, including the above keyword
|
||||
void handleWSEGVALV( const DeckKeyword& keyword, size_t currentStep);
|
||||
|
||||
void handleWCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWFOAM( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSALT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSOLVENT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWTRACER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWTEMP( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWPMITAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSKPTAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWINJTEMP( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONINJH(const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWELOPEN( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors, const std::vector<std::string>& matching_wells = {});
|
||||
void handleWELTARG( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGCONSALE( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system);
|
||||
void handleGCONSUMP( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system);
|
||||
void handleGUIDERAT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleLINCOM( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
|
||||
void handleBRANPROP( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleNODEPROP( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleLIFTOPT(const DeckKeyword& keyword, std::size_t currentStep);
|
||||
void handleGLIFTOPT(const DeckKeyword& keyword, std::size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWLIFTOPT(const DeckKeyword& keyword, std::size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleTUNING( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handlePYACTION( std::shared_ptr<const Python> python, const std::string& input_path, const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleNUPCOL( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGPMAINT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGRUPNET( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system);
|
||||
void handleWRFT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWTEST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWRFTPLT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWPIMULT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleDRSDT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleDRVDT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleDRSDTR( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleDRVDTR( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleVAPPARS( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWECON( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSEGITER( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWHISTCTL(const DeckKeyword& keyword, std::size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleMESSAGES(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleRPTSCHED(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleVFPPROD(const DeckKeyword& vfpprodKeyword, const UnitSystem& unit_system, size_t currentStep);
|
||||
void handleVFPINJ(const DeckKeyword& vfpprodKeyword, const UnitSystem& unit_system, size_t currentStep);
|
||||
void checkUnhandledKeywords( const SCHEDULESection& ) const;
|
||||
void checkIfAllConnectionsIsShut(size_t currentStep);
|
||||
void handleKeyword(std::shared_ptr<const Python> python,
|
||||
@ -477,7 +413,6 @@ namespace Opm
|
||||
const ParseContext& parseContext, ErrorGuard& errors,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const UnitSystem& unit_system,
|
||||
std::vector<std::pair<const DeckKeyword*, size_t > >& rftProperties);
|
||||
void addWellGroupEvent(const std::string& wellGroup, ScheduleEvents::Events event, size_t reportStep);
|
||||
|
||||
@ -506,6 +441,92 @@ namespace Opm
|
||||
result[it.first].reconstruct(unique, it.second);
|
||||
}
|
||||
}
|
||||
|
||||
void applyEXIT(const DeckKeyword&, std::size_t currentStep);
|
||||
void applyMESSAGES(const DeckKeyword&, std::size_t currentStep);
|
||||
void applyWELOPEN(const DeckKeyword&, std::size_t currentStep, const ParseContext&, ErrorGuard&, const std::vector<std::string>& matching_wells = {});
|
||||
void applyWRFT(const DeckKeyword&, std::size_t currentStep);
|
||||
void applyWRFTPLT(const DeckKeyword&, std::size_t currentStep);
|
||||
|
||||
struct HandlerContext {
|
||||
const SCHEDULESection& section;
|
||||
const DeckKeyword& keyword;
|
||||
const std::size_t keywordIndex;
|
||||
const std::size_t currentStep;
|
||||
const EclipseGrid& grid;
|
||||
const FieldPropsManager& fieldPropsManager;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles a "normal" keyword. A normal keyword is one that can be handled by a function with the standard set of arguments (the ones that are passed to this function.
|
||||
*
|
||||
* \return `true` if the keyword was handled
|
||||
*/
|
||||
bool handleNormalKeyword(const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
|
||||
/// Keyword Handlers
|
||||
void handlePYACTION (std::shared_ptr<const Python> python, const std::string& input_path, const DeckKeyword&, std::size_t currentStep);
|
||||
|
||||
void handleBRANPROP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleCOMPDAT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleCOMPLUMP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleCOMPORD (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleCOMPSEGS (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleDRSDT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleDRSDTR (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleDRVDT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleDRVDTR (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGCONINJE (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGCONPROD (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGCONSALE (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGCONSUMP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGEFAC (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGLIFTOPT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGPMAINT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGRUPNET (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGRUPTREE (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleGUIDERAT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleLIFTOPT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleLINCOM (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleMESSAGES (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleMULTFLT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleMXUNSUPP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleNODEPROP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleNUPCOL (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleRPTSCHED (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleTUNING (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleUDQ (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleVAPPARS (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleVFPINJ (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleVFPPROD (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWCONHIST (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWCONINJE (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWCONINJH (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWCONPROD (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWECON (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWEFAC (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWELOPEN (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWELSEGS (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWELSPECS (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWELTARG (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWFOAM (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWGRUPCON (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWHISTCTL (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWINJTEMP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWLIFTOPT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWLIST (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWPIMULT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWPMITAB (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWPOLYMER (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWSALT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWSEGITER (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWSEGSICD (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWSEGVALV (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWSKPTAB (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWSOLVENT (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWTEMP (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWTEST (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
void handleWTRACER (const HandlerContext&, const ParseContext&, ErrorGuard&);
|
||||
};
|
||||
}
|
||||
|
||||
|
196
src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp
Normal file
196
src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp
Normal file
@ -0,0 +1,196 @@
|
||||
/*
|
||||
Copyright 2020 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/>.
|
||||
*/
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include <opm/common/OpmLog/LogUtil.hpp>
|
||||
#include <opm/common/utility/numeric/cmp.hpp>
|
||||
#include <opm/common/utility/String.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Python/Python.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckSection.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/C.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/L.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/N.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/P.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/V.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/W.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
#include <opm/parser/eclipse/Units/Dimension.hpp>
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
#include <opm/parser/eclipse/Units/Units.hpp>
|
||||
|
||||
#include "Well/injection.hpp"
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace {
|
||||
|
||||
}
|
||||
|
||||
void Schedule::handleMESSAGES(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) {
|
||||
return applyMESSAGES(handlerContext.keyword, handlerContext.currentStep);
|
||||
}
|
||||
|
||||
void Schedule::handleMULTFLT (const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) {
|
||||
this->m_modifierDeck[handlerContext.currentStep].addKeyword(handlerContext.keyword);
|
||||
m_events.addEvent( ScheduleEvents::GEO_MODIFIER, handlerContext.currentStep);
|
||||
}
|
||||
|
||||
void Schedule::handleMXUNSUPP(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
std::string msg = "OPM does not support grid property modifier " + handlerContext.keyword.name() + " in the Schedule section. Error at report: " + std::to_string(handlerContext.currentStep);
|
||||
parseContext.handleError( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , msg, errors );
|
||||
}
|
||||
|
||||
void Schedule::handleWELOPEN (const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
return applyWELOPEN(handlerContext.keyword, handlerContext.currentStep, parseContext, errors);
|
||||
}
|
||||
|
||||
|
||||
bool Schedule::handleNormalKeyword(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
using handler_function = std::function<void(Schedule*, const HandlerContext&, const ParseContext&, ErrorGuard&)>;
|
||||
static const std::unordered_map<std::string,handler_function> handler_functions = {
|
||||
{ "BRANPROP", &Schedule::handleBRANPROP },
|
||||
{ "COMPDAT" , &Schedule::handleCOMPDAT },
|
||||
{ "COMPLUMP", &Schedule::handleCOMPLUMP },
|
||||
{ "COMPORD" , &Schedule::handleCOMPORD },
|
||||
{ "COMPSEGS", &Schedule::handleCOMPSEGS },
|
||||
{ "DRSDT" , &Schedule::handleDRSDT },
|
||||
{ "DRSDTR" , &Schedule::handleDRSDTR },
|
||||
{ "DRVDT" , &Schedule::handleDRVDT },
|
||||
{ "DRVDTR" , &Schedule::handleDRVDTR },
|
||||
{ "GCONINJE", &Schedule::handleGCONINJE },
|
||||
{ "GCONPROD", &Schedule::handleGCONPROD },
|
||||
{ "GCONSALE", &Schedule::handleGCONSALE },
|
||||
{ "GCONSUMP", &Schedule::handleGCONSUMP },
|
||||
{ "GEFAC" , &Schedule::handleGEFAC },
|
||||
{ "GLIFTOPT", &Schedule::handleGLIFTOPT },
|
||||
{ "GPMAINT" , &Schedule::handleGPMAINT },
|
||||
{ "GRUPNET" , &Schedule::handleGRUPNET },
|
||||
{ "GRUPTREE", &Schedule::handleGRUPTREE },
|
||||
{ "GUIDERAT", &Schedule::handleGUIDERAT },
|
||||
{ "LIFTOPT" , &Schedule::handleLIFTOPT },
|
||||
{ "LINCOM" , &Schedule::handleLINCOM },
|
||||
{ "MESSAGES", &Schedule::handleMESSAGES },
|
||||
{ "MULTFLT" , &Schedule::handleMULTFLT },
|
||||
{ "MULTPV" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTR" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTR-" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTREGT", &Schedule::handleMXUNSUPP },
|
||||
{ "MULTSIG" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTSIGV", &Schedule::handleMXUNSUPP },
|
||||
{ "MULTTHT" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTTHT-", &Schedule::handleMXUNSUPP },
|
||||
{ "MULTX" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTX-" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTY" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTY-" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTZ" , &Schedule::handleMXUNSUPP },
|
||||
{ "MULTZ-" , &Schedule::handleMXUNSUPP },
|
||||
{ "NODEPROP", &Schedule::handleNODEPROP },
|
||||
{ "NUPCOL" , &Schedule::handleNUPCOL },
|
||||
{ "RPTSCHED", &Schedule::handleRPTSCHED },
|
||||
{ "TUNING" , &Schedule::handleTUNING },
|
||||
{ "UDQ" , &Schedule::handleUDQ },
|
||||
{ "VAPPARS" , &Schedule::handleVAPPARS },
|
||||
{ "VFPINJ" , &Schedule::handleVFPINJ },
|
||||
{ "VFPPROD" , &Schedule::handleVFPPROD },
|
||||
{ "WCONHIST", &Schedule::handleWCONHIST },
|
||||
{ "WCONINJE", &Schedule::handleWCONINJE },
|
||||
{ "WCONINJH", &Schedule::handleWCONINJH },
|
||||
{ "WCONPROD", &Schedule::handleWCONPROD },
|
||||
{ "WECON" , &Schedule::handleWECON },
|
||||
{ "WEFAC" , &Schedule::handleWEFAC },
|
||||
{ "WELOPEN" , &Schedule::handleWELOPEN },
|
||||
{ "WELSEGS" , &Schedule::handleWELSEGS },
|
||||
{ "WELSPECS", &Schedule::handleWELSPECS },
|
||||
{ "WELTARG" , &Schedule::handleWELTARG },
|
||||
{ "WFOAM" , &Schedule::handleWFOAM },
|
||||
{ "WGRUPCON", &Schedule::handleWGRUPCON },
|
||||
{ "WHISTCTL", &Schedule::handleWHISTCTL },
|
||||
{ "WINJTEMP", &Schedule::handleWINJTEMP },
|
||||
{ "WLIFTOPT", &Schedule::handleWLIFTOPT },
|
||||
{ "WLIST" , &Schedule::handleWLIST },
|
||||
{ "WPIMULT" , &Schedule::handleWPIMULT },
|
||||
{ "WPMITAB" , &Schedule::handleWPMITAB },
|
||||
{ "WPOLYMER", &Schedule::handleWPOLYMER },
|
||||
{ "WSALT" , &Schedule::handleWSALT },
|
||||
{ "WSEGITER", &Schedule::handleWSEGITER },
|
||||
{ "WSEGSICD", &Schedule::handleWSEGSICD },
|
||||
{ "WSEGVALV", &Schedule::handleWSEGVALV },
|
||||
{ "WSKPTAB" , &Schedule::handleWSKPTAB },
|
||||
{ "WSOLVENT", &Schedule::handleWSOLVENT },
|
||||
{ "WTEMP" , &Schedule::handleWTEMP },
|
||||
{ "WTEST" , &Schedule::handleWTEST },
|
||||
{ "WTRACER" , &Schedule::handleWTRACER },
|
||||
};
|
||||
|
||||
const auto function_iterator = handler_functions.find(handlerContext.keyword.name());
|
||||
|
||||
if (function_iterator != handler_functions.end()) {
|
||||
const auto& handler = function_iterator->second;
|
||||
|
||||
handler(this, handlerContext, parseContext, errors);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user