Merge pull request #2200 from joakim-hove/action-eval-list-wells

List the matching wells for Action eval
This commit is contained in:
Joakim Hove 2019-11-29 19:20:38 +01:00 committed by GitHub
commit 6d02923d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1056,11 +1056,18 @@ public:
for (const auto& action : actions.pending(simTime)) { for (const auto& action : actions.pending(simTime)) {
auto actionResult = action->eval(simTime, context); auto actionResult = action->eval(simTime, context);
if (actionResult) { if (actionResult) {
std::string msg = "The action: " + action->name() + " evaluated to true at report step: " + std::to_string(reportStep); std::string wells_string;
const auto& matching_wells = actionResult.wells();
if (matching_wells.size() > 0) {
for (std::size_t iw = 0; iw < matching_wells.size() - 1; iw++)
wells_string += matching_wells[iw] + ", ";
wells_string += matching_wells.back();
}
std::string msg = "The action: " + action->name() + " evaluated to true at report step: " + std::to_string(reportStep) + " wells: " + wells_string;
Opm::OpmLog::info(msg); Opm::OpmLog::info(msg);
schedule.applyAction(reportStep, *action, actionResult); schedule.applyAction(reportStep, *action, actionResult);
} else { } else {
std::string msg = "The action: " + action->name() + " evaluated to false sat report step: " + std::to_string(reportStep); std::string msg = "The action: " + action->name() + " evaluated to false at report step: " + std::to_string(reportStep);
Opm::OpmLog::info(msg); Opm::OpmLog::info(msg);
} }
} }