mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-11-03 12:47:42 -06:00
Add comment explaining non-const reference
Added a comment explaining why we cannot push a const group state to GroupStateHelper
This commit is contained in:
1 parent
9c5469d6ad
commit
eefd944e32
1 file changed
+3
@@ -1987,6 +1987,9 @@ namespace Opm
|
||||
// from group constraints in assembly.
|
||||
// Otherwise use real group state from groupStateHelper.
|
||||
GroupState<Scalar> empty_group_state;
|
||||
// Note: Cannot use 'const auto&' here because pushGroupState() requires a
|
||||
// non-const reference. GroupStateHelper stores a non-const pointer to GroupState
|
||||
// and is designed to allow modifications through methods like pushGroupState().
|
||||
auto& group_state = solving_with_zero_rate
|
||||
? empty_group_state
|
||||
: groupStateHelper.groupState();
|
||||
|
||||
Reference in new issue
Block a user