From 39a0bbc2b3a983682260928e07f61d7310e60674 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 18 Jan 2017 14:01:23 +0100 Subject: [PATCH] Fixes pushing to resized array distributedCartesianIndex. Previously distributedCartesianIndex was resized and afterwards all entries were added with push_back. Therefore the array was twice as big as expected and contained wrong values in the front. With this commit we insert the values using random access. Thus the size is as expeceted and the index of the entries do not depend on the order of the grid traversal. --- ebos/collecttoiorank.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebos/collecttoiorank.hh b/ebos/collecttoiorank.hh index 697411135..56af4433c 100644 --- a/ebos/collecttoiorank.hh +++ b/ebos/collecttoiorank.hh @@ -247,7 +247,7 @@ namespace Ewoms #else int elemIdx = elemMapper.map( element ); #endif - distributedCartesianIndex.push_back( gridManager.cartesianIndex( elemIdx ) ); + distributedCartesianIndex[elemIdx] = gridManager.cartesianIndex( elemIdx ); // only store interior element for collection if( element.partitionType() == Dune :: InteriorEntity )