From 45d6e362b97ffd548bcc8ee000431dc4c3b3c59d Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 26 Jan 2021 11:02:19 +0100 Subject: [PATCH] Rename ScheduleState modifiers --- .../EclipseState/Schedule/ScheduleState.hpp | 40 ++++++++--------- .../EclipseState/Schedule/KeywordHandlers.cpp | 34 +++++++------- .../EclipseState/Schedule/Schedule.cpp | 30 ++++++------- .../EclipseState/Schedule/ScheduleState.cpp | 44 +++++++++---------- 4 files changed, 74 insertions(+), 74 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp b/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp index 11167db24..4e91977fc 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp @@ -70,74 +70,74 @@ namespace Opm { bool operator==(const ScheduleState& other) const; static ScheduleState serializeObject(); - void pavg(PAvg pavg); + void update_pavg(PAvg pavg); const PAvg& pavg() const; - void tuning(Tuning tuning); + void update_tuning(Tuning tuning); Tuning& tuning(); const Tuning& tuning() const; - void nupcol(int nupcol); + void update_nupcol(int nupcol); int nupcol() const; - void oilvap(OilVaporizationProperties oilvap); + void update_oilvap(OilVaporizationProperties oilvap); const OilVaporizationProperties& oilvap() const; OilVaporizationProperties& oilvap(); - void events(Events events); + void update_events(Events events); Events& events(); const Events& events() const; - void wellgroup_events(WellGroupEvents wgevents); + void update_wellgroup_events(WellGroupEvents wgevents); WellGroupEvents& wellgroup_events(); const WellGroupEvents& wellgroup_events() const; - void geo_keywords(std::vector geo_keywords); + void update_geo_keywords(std::vector geo_keywords); std::vector& geo_keywords(); const std::vector& geo_keywords() const; - void message_limits(MessageLimits message_limits); + void update_message_limits(MessageLimits message_limits); MessageLimits& message_limits(); const MessageLimits& message_limits() const; Well::ProducerCMode whistctl() const; - void whistctl(Well::ProducerCMode whistctl); + void update_whistctl(Well::ProducerCMode whistctl); const WellTestConfig& wtest_config() const; - void wtest_config(WellTestConfig wtest_config); + void update_wtest_config(WellTestConfig wtest_config); const WListManager& wlist_manager() const; - void wlist_manager(WListManager wlist_manager); + void update_wlist_manager(WListManager wlist_manager); const GConSale& gconsale() const; - void gconsale(GConSale gconsale); + void update_gconsale(GConSale gconsale); const GConSump& gconsump() const; - void gconsump(GConSump gconsump); + void update_gconsump(GConSump gconsump); const Network::ExtNetwork& network() const; - void network(Network::ExtNetwork network); + void update_network(Network::ExtNetwork network); const RPTConfig& rpt_config() const; - void rpt_config(RPTConfig rpt_config); + void update_rpt_config(RPTConfig rpt_config); std::vector> vfpprod() const; const VFPProdTable& vfpprod(int table_id) const; - void vfpprod(VFPProdTable vfpprod); + void update_vfpprod(VFPProdTable vfpprod); std::vector> vfpinj() const; const VFPInjTable& vfpinj(int table_id) const; - void vfpinj(VFPInjTable vfpinj); + void update_vfpinj(VFPInjTable vfpinj); const Action::Actions& actions() const; - void actions(Action::Actions actions); + void update_actions(Action::Actions actions); const UDQActive& udq_active() const; - void udq_active(UDQActive udq_active); + void update_udq_active(UDQActive udq_active); const WellOrder& well_order() const; void well_order(const std::string& well); - void well_order(WellOrder well_order); + void update_well_order(WellOrder well_order); template void serializeOp(Serializer& serializer) { diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp index 0813c1894..eac9ebfbd 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp @@ -141,7 +141,7 @@ namespace { } } - this->snapshots.back().network( std::move( ext_network )); + this->snapshots.back().update_network( std::move( ext_network )); } void Schedule::handleCOMPDAT(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) { @@ -465,7 +465,7 @@ namespace { auto udq_active = UDQActive(this->snapshots.back().udq_active()); if (production.updateUDQActive(this->getUDQConfig(current_step), udq_active)) - this->snapshots.back().udq_active( std::move(udq_active)); + this->snapshots.back().update_udq_active( std::move(udq_active)); } } } @@ -491,7 +491,7 @@ namespace { this->updateGroup(std::move(group_ptr), handlerContext.currentStep); } } - this->snapshots.back().gconsale( std::move(new_gconsale) ); + this->snapshots.back().update_gconsale( std::move(new_gconsale) ); } void Schedule::handleGCONSUMP(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) { @@ -510,7 +510,7 @@ namespace { new_gconsump.add(groupName, consumption_rate, import_rate, network_node_name, udqconfig, this->m_static.m_unit_system); } - this->snapshots.back().gconsump( std::move(new_gconsump) ); + this->snapshots.back().update_gconsump( std::move(new_gconsump) ); } void Schedule::handleGEFAC(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) { @@ -726,7 +726,7 @@ namespace { ext_network.add_node(node); } - this->snapshots.back().network( ext_network ); + this->snapshots.back().update_network( ext_network ); } void Schedule::handleNUPCOL(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) { @@ -737,12 +737,12 @@ namespace { OpmLog::note(msg); } - this->snapshots.back().nupcol(nupcol); + this->snapshots.back().update_nupcol(nupcol); } void Schedule::handleRPTSCHED(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) { printf("snapshost.size(): %ld \n", this->snapshots.size()); - this->snapshots.back().rpt_config( RPTConfig(handlerContext.keyword )); + this->snapshots.back().update_rpt_config( RPTConfig(handlerContext.keyword )); } void Schedule::handleTUNING(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) { @@ -815,7 +815,7 @@ namespace { tuning.MXWSIT = ParserKeywords::TUNING::MXWSIT::defaultValue; } - this->snapshots.back().tuning( std::move( tuning )); + this->snapshots.back().update_tuning( std::move( tuning )); this->snapshots.back().events().addEvent(ScheduleEvents::TUNING_CHANGE); } @@ -839,14 +839,14 @@ namespace { void Schedule::handleVFPINJ(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) { auto table = VFPInjTable(handlerContext.keyword, this->m_static.m_unit_system); - this->snapshots.back().vfpinj( std::move(table) ); this->snapshots.back().events().addEvent( ScheduleEvents::VFPINJ_UPDATE ); + this->snapshots.back().update_vfpinj( std::move(table) ); } void Schedule::handleVFPPROD(const HandlerContext& handlerContext, const ParseContext&, ErrorGuard&) { auto table = VFPProdTable(handlerContext.keyword, this->m_static.m_unit_system); this->snapshots.back().events().addEvent( ScheduleEvents::VFPPROD_UPDATE ); - this->snapshots.back().vfpprod( std::move(table) ); + this->snapshots.back().update_vfpprod( std::move(table) ); } void Schedule::handleWCONHIST(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) { @@ -968,7 +968,7 @@ namespace { auto udq_active = UDQActive( this->snapshots.back().udq_active() ); if (properties->updateUDQActive(this->getUDQConfig(handlerContext.currentStep), udq_active)) - this->snapshots.back().udq_active( std::move(udq_active)); + this->snapshots.back().update_udq_active( std::move(udq_active)); } } } @@ -1030,7 +1030,7 @@ namespace { auto udq_active = UDQActive(this->snapshots.back().udq_active()); if (injection->updateUDQActive(this->getUDQConfig(handlerContext.currentStep), udq_active)) - this->snapshots.back().udq_active( std::move(udq_active) ); + this->snapshots.back().update_udq_active( std::move(udq_active) ); } } } @@ -1291,7 +1291,7 @@ namespace { auto udq_active = UDQActive(this->snapshots.back().udq_active()); if (prop->updateUDQActive(this->getUDQConfig(handlerContext.currentStep), udq_active)) - this->snapshots.back().udq_active( std::move(udq_active)); + this->snapshots.back().update_udq_active( std::move(udq_active)); } else { auto inj = std::make_shared(well2->getInjectionProperties()); inj->handleWELTARG(cmode, new_arg, SiFactorP); @@ -1372,7 +1372,7 @@ namespace { + ", which makes WHISTCTL keyword not affect the simulation at all"; OpmLog::warning(msg); } else - this->snapshots.back().whistctl( controlMode ); + this->snapshots.back().update_whistctl( controlMode ); } const std::string bhp_terminate = record.getItem("BPH_TERMINATE").getTrimmedString(0); @@ -1529,7 +1529,7 @@ namespace { wlist.add(well); } - this->snapshots.back().wlist_manager(new_wlm); + this->snapshots.back().update_wlist_manager(new_wlm); } } @@ -1774,7 +1774,7 @@ namespace { new_config.add_well(well_name, reasons, test_interval, num_test, startup_time, handlerContext.currentStep); } } - this->snapshots.back().wtest_config( std::move(new_config) ); + this->snapshots.back().update_wtest_config( std::move(new_config) ); } void Schedule::handleWTRACER(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) { @@ -1805,7 +1805,7 @@ namespace { this->updateWPAVE(wname, handlerContext.currentStep, wpave ); auto& sched_state = this->snapshots.back(); - sched_state.pavg(std::move(wpave)); + sched_state.update_pavg(std::move(wpave)); } void Schedule::handleWWPAVE(const HandlerContext& handlerContext, const ParseContext& parseContext, ErrorGuard& errors) { diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index c822b5da9..02313856c 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -497,7 +497,7 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e void Schedule::addACTIONX(const Action::ActionX& action) { auto new_actions = Action::Actions( this->snapshots.back().actions() ); new_actions.add( action ); - this->snapshots.back().actions( std::move(new_actions) ); + this->snapshots.back().update_actions( std::move(new_actions) ); } void Schedule::handlePYACTION(const DeckKeyword& keyword) { @@ -520,7 +520,7 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e Action::PyAction pyaction(this->m_static.m_python_handle, name, run_count, module); auto new_actions = Action::Actions( this->snapshots.back().actions() ); new_actions.add(pyaction); - this->snapshots.back().actions( std::move(new_actions) ); + this->snapshots.back().update_actions( std::move(new_actions) ); } void Schedule::applyEXIT(const DeckKeyword& keyword, std::size_t report_step) { @@ -1567,7 +1567,7 @@ namespace { this->addWell(well, report_step); this->addWellToGroup(well.groupName(), well.name(), report_step); } - this->snapshots[report_step + 1].tuning(rst_state.tuning); + this->snapshots[report_step + 1].update_tuning(rst_state.tuning); // Originally at report_step + 1 this->snapshots.back().events().addEvent( ScheduleEvents::TUNING_CHANGE ); @@ -1871,18 +1871,18 @@ void Schedule::create_first(const std::chrono::system_clock::time_point& start_t this->snapshots.emplace_back(start_time); auto& sched_state = snapshots.back(); - sched_state.nupcol( this->m_static.m_runspec.nupcol() ); - sched_state.oilvap( OilVaporizationProperties( this->m_static.m_runspec.tabdims().getNumPVTTables() )); - sched_state.message_limits( this->m_static.m_deck_message_limits ); - sched_state.wtest_config( WellTestConfig() ); - sched_state.gconsale( GConSale() ); - sched_state.gconsump( GConSump() ); - sched_state.wlist_manager( WListManager() ); - sched_state.network( Network::ExtNetwork() ); - sched_state.rpt_config( RPTConfig() ); - sched_state.actions( Action::Actions() ); - sched_state.udq_active( UDQActive() ); - sched_state.well_order( WellOrder() ); + sched_state.update_nupcol( this->m_static.m_runspec.nupcol() ); + sched_state.update_oilvap( OilVaporizationProperties( this->m_static.m_runspec.tabdims().getNumPVTTables() )); + sched_state.update_message_limits( this->m_static.m_deck_message_limits ); + sched_state.update_wtest_config( WellTestConfig() ); + sched_state.update_gconsale( GConSale() ); + sched_state.update_gconsump( GConSump() ); + sched_state.update_wlist_manager( WListManager() ); + sched_state.update_network( Network::ExtNetwork() ); + sched_state.update_rpt_config( RPTConfig() ); + sched_state.update_actions( Action::Actions() ); + sched_state.update_udq_active( UDQActive() ); + sched_state.update_well_order( WellOrder() ); this->addGroup("FIELD", 0); } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.cpp index b044e24c7..a890304ca 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.cpp @@ -84,7 +84,7 @@ std::chrono::system_clock::time_point ScheduleState::end_time() const { } -void ScheduleState::pavg(PAvg arg) { +void ScheduleState::update_pavg(PAvg arg) { this->m_pavg = std::make_shared( std::move(arg) ); } @@ -92,7 +92,7 @@ const PAvg& ScheduleState::pavg() const { return *this->m_pavg; } -void ScheduleState::nupcol(int nupcol) { +void ScheduleState::update_nupcol(int nupcol) { this->m_nupcol = nupcol; } @@ -100,7 +100,7 @@ int ScheduleState::nupcol() const { return this->m_nupcol; } -void ScheduleState::oilvap(OilVaporizationProperties oilvap) { +void ScheduleState::update_oilvap(OilVaporizationProperties oilvap) { this->m_oilvap = std::move(oilvap); } @@ -112,7 +112,7 @@ OilVaporizationProperties& ScheduleState::oilvap() { return this->m_oilvap; } -void ScheduleState::geo_keywords(std::vector geo_keywords) { +void ScheduleState::update_geo_keywords(std::vector geo_keywords) { this->m_geo_keywords = std::move(geo_keywords); } @@ -124,7 +124,7 @@ const std::vector& ScheduleState::geo_keywords() const { return this->m_geo_keywords; } -void ScheduleState::message_limits(MessageLimits message_limits) { +void ScheduleState::update_message_limits(MessageLimits message_limits) { this->m_message_limits = std::move(message_limits); } @@ -140,7 +140,7 @@ Well::ProducerCMode ScheduleState::whistctl() const { return this->m_whistctl_mode; } -void ScheduleState::whistctl(Well::ProducerCMode whistctl) { +void ScheduleState::update_whistctl(Well::ProducerCMode whistctl) { this->m_whistctl_mode = whistctl; } @@ -191,8 +191,8 @@ ScheduleState ScheduleState::serializeObject() { auto t2 = t1 + std::chrono::hours(48); ScheduleState ts(t1, t2); ts.m_events = Events::serializeObject(); - ts.nupcol(77); - ts.oilvap( Opm::OilVaporizationProperties::serializeObject() ); + ts.update_nupcol(77); + ts.update_oilvap( Opm::OilVaporizationProperties::serializeObject() ); ts.m_message_limits = MessageLimits::serializeObject(); ts.m_whistctl_mode = Well::ProducerCMode::THP; ts.m_wtest_config = std::make_shared( WellTestConfig::serializeObject() ); @@ -210,7 +210,7 @@ ScheduleState ScheduleState::serializeObject() { return ts; } -void ScheduleState::tuning(Tuning tuning) { +void ScheduleState::update_tuning(Tuning tuning) { this->m_tuning = std::move(tuning); } @@ -222,7 +222,7 @@ Tuning& ScheduleState::tuning() { return this->m_tuning; } -void ScheduleState::events(Events events) { +void ScheduleState::update_events(Events events) { this->m_events = events; } @@ -235,7 +235,7 @@ const Events& ScheduleState::events() const { return this->m_events; } -void ScheduleState::wellgroup_events(WellGroupEvents wgevents) { +void ScheduleState::update_wellgroup_events(WellGroupEvents wgevents) { this->m_wellgroup_events = std::move(wgevents); } @@ -251,7 +251,7 @@ const WellTestConfig& ScheduleState::wtest_config() const { return *this->m_wtest_config; } -void ScheduleState::wtest_config(WellTestConfig wtest_config) { +void ScheduleState::update_wtest_config(WellTestConfig wtest_config) { this->m_wtest_config = std::make_shared( std::move(wtest_config) ); } @@ -259,7 +259,7 @@ const GConSale& ScheduleState::gconsale() const { return *this->m_gconsale; } -void ScheduleState::gconsale(GConSale gconsale) { +void ScheduleState::update_gconsale(GConSale gconsale) { this->m_gconsale = std::make_shared( std::move(gconsale) ); } @@ -267,7 +267,7 @@ const GConSump& ScheduleState::gconsump() const { return *this->m_gconsump; } -void ScheduleState::gconsump(GConSump gconsump) { +void ScheduleState::update_gconsump(GConSump gconsump) { this->m_gconsump = std::make_shared( std::move(gconsump) ); } @@ -275,7 +275,7 @@ const WListManager& ScheduleState::wlist_manager() const { return *this->m_wlist_manager; } -void ScheduleState::wlist_manager(WListManager wlist_manager) { +void ScheduleState::update_wlist_manager(WListManager wlist_manager) { this->m_wlist_manager = std::make_shared( std::move(wlist_manager) ); } @@ -283,7 +283,7 @@ const Network::ExtNetwork& ScheduleState::network() const { return *this->m_network; } -void ScheduleState::network(Network::ExtNetwork network) { +void ScheduleState::update_network(Network::ExtNetwork network) { this->m_network = std::make_shared( std::move(network) ); } @@ -292,7 +292,7 @@ const RPTConfig& ScheduleState::rpt_config() const { } -void ScheduleState::rpt_config(RPTConfig rpt_config) { +void ScheduleState::update_rpt_config(RPTConfig rpt_config) { this->m_rptconfig = std::make_shared(std::move(rpt_config)); } @@ -313,7 +313,7 @@ const VFPProdTable& ScheduleState::vfpprod(int table_id) const { return *vfp_iter->second; } -void ScheduleState::vfpprod(VFPProdTable vfpprod) { +void ScheduleState::update_vfpprod(VFPProdTable vfpprod) { int table_id = vfpprod.getTableNum(); this->m_vfpprod[table_id] = std::make_shared( std::move(vfpprod) ); } @@ -335,7 +335,7 @@ const VFPInjTable& ScheduleState::vfpinj(int table_id) const { return *vfp_iter->second; } -void ScheduleState::vfpinj(VFPInjTable vfpinj) { +void ScheduleState::update_vfpinj(VFPInjTable vfpinj) { int table_id = vfpinj.getTableNum(); this->m_vfpinj[table_id] = std::make_shared( std::move(vfpinj) ); } @@ -344,7 +344,7 @@ const Action::Actions& ScheduleState::actions() const { return *this->m_actions; } -void ScheduleState::actions(Action::Actions actions) { +void ScheduleState::update_actions(Action::Actions actions) { this->m_actions = std::make_shared( std::move(actions) ); } @@ -352,7 +352,7 @@ const UDQActive& ScheduleState::udq_active() const { return *this->m_udq_active; } -void ScheduleState::udq_active(UDQActive udq_active) { +void ScheduleState::update_udq_active(UDQActive udq_active) { this->m_udq_active = std::make_shared( std::move(udq_active) ); } @@ -360,7 +360,7 @@ const WellOrder& ScheduleState::well_order() const { return *this->m_well_order; } -void ScheduleState::well_order(WellOrder well_order) { +void ScheduleState::update_well_order(WellOrder well_order) { this->m_well_order = std::make_shared( std::move(well_order) ); }