Removes using namespace shortcuts.

This commit is contained in:
Williham Williham Totland
2020-09-25 10:26:17 +02:00
parent 0d962fc585
commit c17824cead
2 changed files with 18 additions and 24 deletions

View File

@@ -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<Group>(this->getGroup(group_name, handlerContext.currentStep));
const auto& target_string = record.getItem<GP::FLOW_TARGET>().get<std::string>(0);
const auto& target_string = record.getItem<ParserKeywords::GPMAINT::FLOW_TARGET>().get<std::string>(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<WS::WELL>().get<std::string>(0), parseContext, errors);
const std::string& groupName = trim_wgname(keyword, record.getItem<WS::GROUP>().get<std::string>(0), parseContext, errors);
auto density_calc_type = record.getItem<WS::DENSITY_CALC>().get<std::string>(0);
auto fip_region_number = record.getItem<WS::FIP_REGION>().get<int>(0);
const std::string& wellName = trim_wgname(keyword, record.getItem<ParserKeywords::WELSPECS::WELL>().get<std::string>(0), parseContext, errors);
const std::string& groupName = trim_wgname(keyword, record.getItem<ParserKeywords::WELSPECS::GROUP>().get<std::string>(0), parseContext, errors);
auto density_calc_type = record.getItem<ParserKeywords::WELSPECS::DENSITY_CALC>().get<std::string>(0);
auto fip_region_number = record.getItem<ParserKeywords::WELSPECS::FIP_REGION>().get<int>(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<WS::HEAD_I>().get< int >( 0 ) - 1;
const auto headJ = record.getItem<WS::HEAD_J>().get< int >( 0 ) - 1;
const auto& refDepthItem = record.getItem<WS::REF_DEPTH>();
int pvt_table = record.getItem<WS::P_TABLE>().get<int>(0);
double drainageRadius = record.getItem<WS::D_RADIUS>().getSIDouble(0);
const auto headI = record.getItem<ParserKeywords::WELSPECS::HEAD_I>().get< int >( 0 ) - 1;
const auto headJ = record.getItem<ParserKeywords::WELSPECS::HEAD_J>().get< int >( 0 ) - 1;
const auto& refDepthItem = record.getItem<ParserKeywords::WELSPECS::REF_DEPTH>();
int pvt_table = record.getItem<ParserKeywords::WELSPECS::P_TABLE>().get<int>(0);
double drainageRadius = record.getItem<ParserKeywords::WELSPECS::D_RADIUS>().getSIDouble(0);
double refDepth = refDepthItem.hasValue( 0 )
? refDepthItem.getSIDouble( 0 )
: -1.0;

View File

@@ -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<PY::NAME>().get<std::string>(0);
const auto& run_count = Action::PyAction::from_string( keyword.getRecord(0).getItem<PY::RUN_COUNT>().get<std::string>(0) );
const auto& module_arg = keyword.getRecord(1).getItem<PY::FILENAME>().get<std::string>(0);
const auto& name = keyword.getRecord(0).getItem<ParserKeywords::PYACTION::NAME>().get<std::string>(0);
const auto& run_count = Action::PyAction::from_string( keyword.getRecord(0).getItem<ParserKeywords::PYACTION::RUN_COUNT>().get<std::string>(0) );
const auto& module_arg = keyword.getRecord(1).getItem<ParserKeywords::PYACTION::FILENAME>().get<std::string>(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<ex::STATUS_CODE>().get<int>(0);
int status = keyword.getRecord(0).getItem<ParserKeywords::EXIT::STATUS_CODE>().get<int>(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<ParserKeywords::WELSPECS::GROUP>().getTrimmedString(0);
auto pvt_table = record.getItem<WS::P_TABLE>().get<int>(0);
auto gas_inflow = Well::GasInflowEquationFromString( record.getItem<WS::INFLOW_EQ>().get<std::string>(0) );
auto pvt_table = record.getItem<ParserKeywords::WELSPECS::P_TABLE>().get<int>(0);
auto gas_inflow = Well::GasInflowEquationFromString( record.getItem<ParserKeywords::WELSPECS::INFLOW_EQ>().get<std::string>(0) );
this->addWell(wellName,
group,