toInjectorType(): Distinguish types based on first characters only.

The manual states that injection types in the "WCONINJE" keyword need
only be specified using a single character.
This commit is contained in:
Bård Skaflestad 2012-05-15 17:19:35 +02:00
parent 83274c4027
commit 156bf0a560

View File

@ -964,13 +964,13 @@ namespace Opm
InjectionSpecification::InjectorType toInjectorType(std::string type)
{
if (type == "OIL") {
if (type[0] == 'O') {
return InjectionSpecification::OIL;
}
if (type == "WATER") {
if (type[0] == 'W') {
return InjectionSpecification::WATER;
}
if (type == "GAS") {
if (type[0] == 'G') {
return InjectionSpecification::GAS;
}
THROW("Unknown type " << type << ", could not convert to SurfaceComponent");