From 8611f664cbe2a89dc0f6a8dd91961f6b3a53aa35 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Fri, 17 Jun 2022 13:24:26 +0200 Subject: [PATCH] Improve error message for region operations on MULTZ. MULTZ is the only keyword that is stored in global representation (i.e. with values for inactive cells, too) to allow the "PINCH ALL" processing. This produced errors like: ``` Error: An error occurred while creating the reservoir properties Internal error: Region operations on 3D fields with global storage is not implemented ``` With this change the error message has more information for the user and might help to work around it: ``` Error: An error occurred while creating the reservoir properties Internal error: In file /path/to/file.inc line 3: MULTIREG region operation on 3D field MULTZ with global storage is not implemented! ``` --- src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp b/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp index 449634824..ebee0cd25 100644 --- a/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp +++ b/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -933,7 +934,11 @@ void FieldProps::handle_region_operation(const DeckKeyword& keyword) { with global storage. */ if (field_data.global_data) - throw std::logic_error("Region operations on 3D fields with global storage is not implemented"); + { + const auto& location = keyword.location(); + throw std::logic_error(fmt::format("In file {} line {}: {} region operation on 3D field {} with global storage is not implemented!", + location.filename, std::to_string(location.lineno), keyword.name(), target_kw)); + } FieldProps::apply(fromString(keyword.name()), field_data.data, field_data.value_status, scalar_value, index_list); }