mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
try to fix subtle lifetime bug
it is possible that a dune entity vanishes if its iterator gets out of scope. Whether this is a problem or not seems to be be highly depend on the used configuration...
This commit is contained in:
parent
46b52448aa
commit
6a929ca797
@ -334,8 +334,9 @@ namespace Opm
|
||||
// use the thermodynamic state of the first active cell as a
|
||||
// reference. there might be better ways to do this...
|
||||
ElementContext elemCtx(ebos_simulator_);
|
||||
const auto& elem = *ebos_simulator_.gridView().template begin</*codim=*/0>();
|
||||
elemCtx.updateAll(elem);
|
||||
auto elemIt = ebos_simulator_.gridView().template begin</*codim=*/0>();
|
||||
elemCtx.updatePrimaryStencil(*elemIt);
|
||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||
const auto& iq0 = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||
|
||||
// Initialize a FluidState object first
|
||||
|
Loading…
Reference in New Issue
Block a user