Skip to content

Conversation

@hakonhagland
Copy link
Contributor

When well_state is copied, groupStateHelper should be updated to use that copy. In the master this worked since
groupStateHelper already used the same version of well_state, but the bug was revealed by the refactoring in #6626, see failed jenkins build test for glift1 there. The plan is to rebase #6626 once this is merged and then rerun the tests.

When well_state is copied, groupStateHelper should be updated to use
that copy
@hakonhagland hakonhagland added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Dec 12, 2025
@hakonhagland
Copy link
Contributor Author

jenkins build this please

@hakonhagland hakonhagland requested a review from blattms December 12, 2025 09:43
@blattms
Copy link
Member

blattms commented Dec 12, 2025

What kind of copy (shallow or deep) is this? Is this documented somewhere?

@hakonhagland
Copy link
Contributor Author

@blattms This is a shallow copy and is intentional and by design. GroupStateHelper only stores pointers, references and scalar values and can safely be copied. An alternative was discussed when we originally refactored WellGroupHelpers, see #6535 (comment). This involved using a const_cast instead of the copy, i.e.
auto well_guard = const_cast<GroupStateHelperType&>(groupStateHelper).pushWellState(well_state_copy) but we found the copy version to be cleaner.

@blattms blattms merged commit 461184d into OPM:master Dec 12, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants