Add enum to string functions.

This commit is contained in:
Liu Ming
2016-05-20 16:13:37 +08:00
parent 9979c505b3
commit 8c573d4ef1
4 changed files with 178 additions and 1 deletions

View File

@@ -18,4 +18,80 @@ namespace Opm
}
const std::string
InjectionSpecification::ControlMode2String(const ControlMode& mode)
{
std::string stringValue;
switch(mode) {
case ControlMode::NONE:
stringValue = "NONE";
break;
case ControlMode::RATE:
stringValue = "RATE";
break;
case ControlMode::RESV:
stringValue = "RESV";
break;
case ControlMode::BHP:
stringValue = "BHP";
break;
case ControlMode::THP:
stringValue = "THP";
break;
case ControlMode::REIN:
stringValue = "REIN";
break;
case ControlMode::VREP:
stringValue = "VREP";
break;
case ControlMode::GRUP:
stringValue = "GRUP";
break;
case ControlMode::FLD:
stringValue = "FLD";
break;
}
return stringValue;
}
const std::string
InjectionSpecification::InjectorType2String(const InjectorType& type)
{
std::string stringValue;
switch(type) {
case InjectorType::WATER:
stringValue = "WATER";
break;
case InjectorType::OIL:
stringValue = "OIL";
break;
case InjectorType::GAS:
stringValue = "GAS";
break;
}
return stringValue;
}
const std::string
InjectionSpecification::GuideRateType2String(const GuideRateType& type)
{
std::string stringValue;
switch(type) {
case GuideRateType::RAT:
stringValue = "RAT";
break;
case GuideRateType::NONE_GRT:
stringValue = "NONE_GRT";
break;
}
return stringValue;
}
} // namespace Opm