diff --git a/opm/simulators/utils/ParallelEclipseState.cpp b/opm/simulators/utils/ParallelEclipseState.cpp index b74d901d3..472b8e4cc 100644 --- a/opm/simulators/utils/ParallelEclipseState.cpp +++ b/opm/simulators/utils/ParallelEclipseState.cpp @@ -24,6 +24,15 @@ #include #include +#include +#include + +namespace { + bool is_FIP(const std::string& keyword) + { + return std::regex_match(keyword, std::regex { "FIP[A-Z0-9]{1,5}" }); + } +} namespace Opm { @@ -108,12 +117,16 @@ std::vector ParallelFieldPropsManager::get_global_int(const std::string& ke std::vector result; int exceptionThrown{}; - if (m_comm.rank() == 0) - { - try - { - result = m_manager.get_global_int(keyword); - }catch(std::exception& e) { + if (m_comm.rank() == 0) { + try { + // Recall: FIP* keywords are special. We care only about the + // first three characters of the name following the initial + // three-character "FIP" prefix, hence "substr(0, 6)". + result = is_FIP(keyword) + ? this->m_manager.get_global_int(keyword.substr(0, 6)) + : this->m_manager.get_global_int(keyword); + } + catch (std::exception& e) { exceptionThrown = 1; OpmLog::error("No integer property field: " + keyword + " ("+e.what()+")"); m_comm.broadcast(&exceptionThrown, 1, 0);