From f09ffbca99c4bbd5f04945eeb7a2c7acf48a0c1e Mon Sep 17 00:00:00 2001 From: Andreas Lauser <and@poware.org> Date: Thu, 23 Feb 2012 18:20:09 +0000 Subject: [PATCH] decoupled: store the grid view by value not by reference in the variable class this is a common mistake which also used to be present in the box models and in dune-multidomaingrid: Grid views should never be stored by reference as the object may vanish as soon as it gets out of scope in the calling function. given the fact that grid views in dune are created on the fly, this leads to subtle bugs. git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7902 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/decoupled/common/variableclass.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumux/decoupled/common/variableclass.hh b/dumux/decoupled/common/variableclass.hh index aee741f225..07e7887d53 100644 --- a/dumux/decoupled/common/variableclass.hh +++ b/dumux/decoupled/common/variableclass.hh @@ -75,7 +75,7 @@ public: typedef typename std::vector <CellData> CellDataVector; private: - const GridView& gridView_; + const GridView gridView_; ElementMapper elementMapper_; VertexMapper vertexMapper_; CellDataVector cellDataVector_; -- GitLab