Merge pull request #2953 from joakim-hove/udq-eval-off-by-one

Shift the report step argument used when calling UDQ eval
This commit is contained in:
Joakim Hove 2020-12-02 08:34:43 +01:00 committed by GitHub
commit ced3c99e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,8 +331,15 @@ public:
blockData,
aquiferData);
const auto& udq_config = schedule().getUDQConfig(reportStepNum);
udq_config.eval( reportStepNum, schedule().wellMatcher(reportStepNum), summaryState(), udqState() );
/*
Off-by-one-fun: The reportStepNum argument corresponds to the
report step these results will be written to, whereas the argument
to UDQ function evaluation corresponds to the report step we are
currently on.
*/
auto udq_step = reportStepNum - 1;
const auto& udq_config = schedule().getUDQConfig(udq_step);
udq_config.eval( udq_step, schedule().wellMatcher(udq_step), summaryState(), udqState() );
buffer = summaryState().serialize();
}