From 783fecd2de4a7755d5acccb7f872a16ef22afe82 Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Thu, 20 Apr 2017 14:50:17 +0200
Subject: [PATCH] Fix vertical vectorization of geometries

---
 python/dune/perftool/sumfact/symbolic.py | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/python/dune/perftool/sumfact/symbolic.py b/python/dune/perftool/sumfact/symbolic.py
index 9cdd0174..90818e30 100644
--- a/python/dune/perftool/sumfact/symbolic.py
+++ b/python/dune/perftool/sumfact/symbolic.py
@@ -471,14 +471,18 @@ class VectorizedSumfactKernel(SumfactKernelBase, ImmutableRecord, prim.Variable)
 
     def vec_index(self, sf):
         quad_inames = quadrature_inames()
-        index = []
-        i = 0
         sliced = 0
-        for d in range(world_dimension()):
-            if self.matrix_sequence[d].face is None:
+        if len(sf.matrix_sequence) == local_dimension():
+            for d in range(local_dimension()):
                 if self.matrix_sequence[d].slice_size:
-                    sliced = prim.Variable(quad_inames[i])
-                i = i + 1
+                    sliced = prim.Variable(quad_inames[d])
+        else:
+            i = 0
+            for d in range(world_dimension()):
+                if self.matrix_sequence[d].face is None:
+                    if self.matrix_sequence[d].slice_size:
+                        sliced = prim.Variable(quad_inames[i])
+                    i = i + 1
 
         return self.horizontal_index(sf) + prim.Remainder(sliced, self.vertical_width)
 
-- 
GitLab