-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct suffix for solution tracers #4001
Conversation
4f52cb6
to
f6bec89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one more instance of the magic number 4 in related to tracers in Summary.cpp
. This constant may or may not be important for this work–I don't know off hand–but we should at least add a comment for why we don't need to adjust it if it is not.
Other than that, this looks good to me.
opm/output/eclipse/Summary.cpp
Outdated
int istart; | ||
if (normKw[4] == 'F' || normKw[4] == 'S') { | ||
istart = 5; | ||
} | ||
else { | ||
istart = 4; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make istart
be const
by writing this as
const auto istart = 4 + ((normKw[4] == 'F') || (normKw[4] == 'S'));
but I suppose it's in the eye of the beholder whether or not that's a simplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the simplification so I changed the code. Thanks!
The magic number 4 in |
in that case something like constexpr auto prefix_len = std::strlen("WTPR"); is a lot more expressive than the magic number. |
I agree, magic numbers are not the ideal. The |
right, if it applies to more keywords something ala constexpr auto prefix_len = 4; // 'WTPRxxx, FTPTxxx, ... conveys the point just as well. |
Agreed, I have updated the code. Thanks! |
jenkins build this opm-simulators=5268 please |
jenkins build this opm-simulators=5268 please |
With current implementation only water tracers can be written to restart-related output.
jenkins build this opm-simulators=5268 please |
benchmark please opm-simulators=5268 |
Benchmark result overview:
View result details @ https://www.ytelses.com/opm/?page=result&id=2505 |
Is this PR itself independent of the downstream PR OPM/opm-simulators#5268, or must the two be reviewed and merged in concert? |
I have not tried to compile changes in this PR with the master version of opm-simulators, so I don't know if any of the tests will fail or other unexpected errors will occur. Should mostly be extensions of summary file output in this PR so it will perhaps be fine to treat this PR independently. |
Understood. In that case I'll try a separate build check just for this PR and review/merge if that check goes through. |
jenkins build this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. This looks good to me now and I'll merge into master.
Needed in (draft) PR: OPM/opm-simulators#5268.