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.
This commit is contained in:
Markus Blatt
2017-01-18 14:01:23 +01:00
parent 41d258f1c8
commit 39a0bbc2b3

View File

@@ -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 )