diff --git a/opm/upscaling/RelPermUtils.cpp b/opm/upscaling/RelPermUtils.cpp index 600f1905..48d88703 100644 --- a/opm/upscaling/RelPermUtils.cpp +++ b/opm/upscaling/RelPermUtils.cpp @@ -701,7 +701,8 @@ void RelPermUpscaleHelper::calculateCellPressureGradients() grid.getIJK(ix, ijk); mt.activateCell(ijk); - const auto& cc = c->geometry().center(); + const auto & geom = c->geometry(); //geometry() returns a copy that now lives on. + const auto & cc = geom.center(); celldepth[ix] = cc[ cc.size() - 1 ]; } }