-
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
Write MULTPV to INIT-file #4021
Conversation
jenkins build this ignore_extra please |
8dcae7f
to
db24d05
Compare
jenkins build this ignore_extra please |
Cool, finally this works with all existing tests, see jenkins #6985. The two difference to the previous attempt are:
|
I would like to include this into the release candidate 2, so I'll wait until this is merged to master until I create the new release candidate, ok? |
jenkins build this ignore_extra 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.
Looks good for the most part. We have to be a little bit careful about what we do to the reference solutions in the time leading up to the release, but if the release manager is convinced that this should also go into the release then we're okay to update the reference solutions too.
@@ -814,6 +777,52 @@ bool FieldProps::has<int>(const std::string& keyword) const { | |||
} | |||
|
|||
|
|||
void FieldProps::apply_multipliers() | |||
{ | |||
bool hasPorvBefore = (this->double_data.find(ParserKeywords::PORV::keywordName) == this->double_data.end()); |
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.
Would you mind adding a comment here for why hasPorvBefore
is the same as PORV
not being in double_data
, please? Also, is there a reason for not marking hasPorvBefore
as const
?
using Scalar = typename std::remove_cv_t<std::remove_reference_t<decltype(iter->second.data[0])>>; | ||
std::transform(iter->second.data.begin(), iter->second.data.end(), | ||
mult_iter->second.data.begin(), iter->second.data.begin(), | ||
std::multiplies<Scalar>()); |
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'll mention once more that this code would be simpler if you did not explicitly specify the Scalar
type and instead passed std::multiplies<>()
(literally) as the final argument to std::transform()
. Using the defaulted template parameter (formally void
) means we get template argument deduction on the parameters passed to the function call operator of std::multiplies<>
and that is usually what we want.
I still would like to rerun my local tests for this. Sorry that this takes so long. Somehow things keep popping up... |
This is needed as the simulator will use PORV and assume that the multipliers are applied. We needed to move the function apply_multipiers to after the specializations of the init_get functions are done, to not specialize after the instantiation (compiler error on g++-12)
PORV is special. If it is not already stored it will be computed based on the other properies including MULTPV in init_get. Hence we previously might have applied multipliers multiple times.
Fixes compilation issue: ``` opm/input/eclipse/EclipseState/Grid/FieldProps.cpp:813:63: error: specialization of ‘bool Opm::FieldProps::has(const std::string&) const [with T = double; std::string = std::__cxx11::basic_string<char>]’ after instantiation 813 | bool FieldProps::has<double>(const std::string& keyword_name) const { | ^~~~~ ```
db24d05
to
30730f9
Compare
I cleared the milestone. This is just too delayed. |
jenkins build this ignore_extra please |
30730f9
to
c579404
Compare
I checked my testcase now, too. |
jenkins build this ignore_extra 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.
Thank you for the updates. This looks good to me now. Unless you have other changes incoming here I suggest we update the reference solutions and merge this work into the master branch.
Yep, let's get this in. |
jenkins build this with update_data please |
Reason: PR OPM/opm-common#4021 opm-common = 465a8eba0b601149d237bcb96a17d96610899668 opm-grid = 321ec3bc932e5f7dc000c64b75129f771122dcdf opm-models = d9bf4ad4d3e39829513b8b24c66a2774b47f17a1 opm-simulators = 465a8eba0b601149d237bcb96a17d96610899668 ### Changed Tests ### * gas_precsalt * fpr_nonhc * 01_multregt
jenkins build this with opm-tests=1161 please |
Automatic Reference Data Update for PR OPM/opm-common#4021
The new reference solutions have been installed on the CI system. Merging this now to activate the INIT file support. |
This output was missing from the init file previously. Now MULTPV will be output if it is specified in the GRID or EDIT section.
Support for MULTPV in the SCHEDULE section will be added in an upcoming PR. I need to sort out the parallel handling of that.
This is is #4015 again