Commits

Nico Schlömer committed 76786e4

make sure the workaround is only employed for sd==1

Comments (0)

Files changed (1)

FIAT/polynomial_set.py

             v = numpy.transpose(expansion_set.tabulate(degree, pts))
             vinv = numpy.linalg.inv(v)
 
-            vals = expansion_set.tabulate(degree, pts)
-            deriv_vals = expansion_set.tabulate_derivatives(degree, pts)
-            # Create the ordinary data structure.
-            dv = []
-            for i in range(vals.shape[0]):
-                dv.append([])
-                for j in range(vals.shape[1]):
-                    dv[-1].append((vals[i][j], [deriv_vals[0][i][j]]))
+            # Hm, ugly case separation of spatial dimension 1.
+            # TODO make sure that tabulate_derivatives for sd==1
+            #      works like the rest
+            if sd == 1:
+                vals = expansion_set.tabulate(degree, pts)
+                deriv_vals = expansion_set.tabulate_derivatives(degree, pts)
+                # Create the ordinary data structure.
+                dv = []
+                for i in range(vals.shape[0]):
+                    dv.append([])
+                    for j in range(vals.shape[1]):
+                        dv[-1].append((vals[i][j], [deriv_vals[0][i][j]]))
+            else:
+                dv = expansion_set.tabulate_derivatives(degree, pts)
+
             dtildes = [[[a[1][i] for a in dvrow] for dvrow in dv]
                        for i in range(sd)
                        ]