From c17824cead362aa72a85fed8187916ece7f85c19 Mon Sep 17 00:00:00 2001 From: Williham Williham Totland Date: Fri, 25 Sep 2020 10:26:17 +0200 Subject: [PATCH] Removes `using` namespace shortcuts. --- .../EclipseState/Schedule/KeywordHandlers.cpp | 27 +++++++++---------- .../EclipseState/Schedule/Schedule.cpp | 15 +++++------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp index 69d9a42fb..6f551aaa5 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp @@ -506,10 +506,9 @@ void Schedule::handleGLIFTOPT(const HandlerContext& handlerContext, const ParseC if (group_names.empty()) invalidNamePattern(groupNamePattern, handlerContext.currentStep, parseContext, errors, handlerContext.keyword); - using GP = ParserKeywords::GPMAINT; for (const auto& group_name : group_names) { auto group_ptr = std::make_shared(this->getGroup(group_name, handlerContext.currentStep)); - const auto& target_string = record.getItem().get(0); + const auto& target_string = record.getItem().get(0); if (target_string == "NONE") group_ptr->set_gpmaint(); else { @@ -1082,24 +1081,22 @@ void Schedule::handleNODEPROP(const HandlerContext& handlerContext, const ParseC }; const auto& keyword = section.getKeyword(handlerContext.keywordIndex); - using WS = ParserKeywords::WELSPECS; - for (std::size_t recordNr = 0; recordNr < keyword.size(); recordNr++) { const auto& record = keyword.getRecord(recordNr); - const std::string& wellName = trim_wgname(keyword, record.getItem().get(0), parseContext, errors); - const std::string& groupName = trim_wgname(keyword, record.getItem().get(0), parseContext, errors); - auto density_calc_type = record.getItem().get(0); - auto fip_region_number = record.getItem().get(0); + const std::string& wellName = trim_wgname(keyword, record.getItem().get(0), parseContext, errors); + const std::string& groupName = trim_wgname(keyword, record.getItem().get(0), parseContext, errors); + auto density_calc_type = record.getItem().get(0); + auto fip_region_number = record.getItem().get(0); if (fip_region_number != 0) { const auto& location = keyword.location(); - std::string msg = "The FIP_REGION item in the WELSPECS keyword in file: " + location.filename + " line: " + std::to_string(location.lineno) + " using default value: " + std::to_string(WS::FIP_REGION::defaultValue); + std::string msg = "The FIP_REGION item in the WELSPECS keyword in file: " + location.filename + " line: " + std::to_string(location.lineno) + " using default value: " + std::to_string(ParserKeywords::WELSPECS::FIP_REGION::defaultValue); OpmLog::warning(msg); } if (density_calc_type != "SEG") { const auto& location = keyword.location(); - std::string msg = "The DENSITY_CALC item in the WELSPECS keyword in file: " + location.filename + " line: " + std::to_string(location.lineno) + " using default value: " + WS::DENSITY_CALC::defaultValue; + std::string msg = "The DENSITY_CALC item in the WELSPECS keyword in file: " + location.filename + " line: " + std::to_string(location.lineno) + " using default value: " + ParserKeywords::WELSPECS::DENSITY_CALC::defaultValue; OpmLog::warning(msg); } @@ -1125,11 +1122,11 @@ void Schedule::handleNODEPROP(const HandlerContext& handlerContext, const ParseC this->addWell(wellName, record, handlerContext.currentStep, wellConnectionOrder, unit_system); this->addWellToGroup(groupName, wellName, handlerContext.currentStep); } else { - const auto headI = record.getItem().get< int >( 0 ) - 1; - const auto headJ = record.getItem().get< int >( 0 ) - 1; - const auto& refDepthItem = record.getItem(); - int pvt_table = record.getItem().get(0); - double drainageRadius = record.getItem().getSIDouble(0); + const auto headI = record.getItem().get< int >( 0 ) - 1; + const auto headJ = record.getItem().get< int >( 0 ) - 1; + const auto& refDepthItem = record.getItem(); + int pvt_table = record.getItem().get(0); + double drainageRadius = record.getItem().getSIDouble(0); double refDepth = refDepthItem.hasValue( 0 ) ? refDepthItem.getSIDouble( 0 ) : -1.0; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index e4d6489d8..b991a5abf 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -382,10 +382,9 @@ Schedule::Schedule(const Deck& deck, const EclipseState& es, const ParseContext& return; } - using PY = ParserKeywords::PYACTION; - const auto& name = keyword.getRecord(0).getItem().get(0); - const auto& run_count = Action::PyAction::from_string( keyword.getRecord(0).getItem().get(0) ); - const auto& module_arg = keyword.getRecord(1).getItem().get(0); + const auto& name = keyword.getRecord(0).getItem().get(0); + const auto& run_count = Action::PyAction::from_string( keyword.getRecord(0).getItem().get(0) ); + const auto& module_arg = keyword.getRecord(1).getItem().get(0); std::string module; if (input_path.empty()) module = module_arg; @@ -399,8 +398,7 @@ Schedule::Schedule(const Deck& deck, const EclipseState& es, const ParseContext& } void Schedule::applyEXIT(const DeckKeyword& keyword, std::size_t report_step) { - using ex = ParserKeywords::EXIT; - int status = keyword.getRecord(0).getItem().get(0); + int status = keyword.getRecord(0).getItem().get(0); OpmLog::info("Simulation exit with status: " + std::to_string(status) + " requested as part of ACTIONX at report_step: " + std::to_string(report_step)); this->exit_status = status; } @@ -631,7 +629,6 @@ Schedule::Schedule(const Deck& deck, const EclipseState& es, const ParseContext& Connection::Order wellConnectionOrder, const UnitSystem& unit_system) { - using WS = ParserKeywords::WELSPECS; // We change from eclipse's 1 - n, to a 0 - n-1 solution int headI = record.getItem("HEAD_I").get< int >(0) - 1; int headJ = record.getItem("HEAD_J").get< int >(0) - 1; @@ -667,8 +664,8 @@ Schedule::Schedule(const Deck& deck, const EclipseState& es, const ParseContext& } const std::string& group = record.getItem().getTrimmedString(0); - auto pvt_table = record.getItem().get(0); - auto gas_inflow = Well::GasInflowEquationFromString( record.getItem().get(0) ); + auto pvt_table = record.getItem().get(0); + auto gas_inflow = Well::GasInflowEquationFromString( record.getItem().get(0) ); this->addWell(wellName, group,