Commits

Nico Schlömer  committed 86fabfc Merge

Merged fenics-project/dolfin into master

  • Participants
  • Parent commits a2bbf00, efaa954
  • Branches coverity-fixes-2, for-auto0 1
    1. for-auto1

Comments (0)

Files changed (2)

File site-packages/dolfin/functions/expression.py

 
 # Import UFL and SWIG-generated extension module (DOLFIN C++)
 import ufl
+from ufl.utils.indexflattening import flatten_multiindex, shape_to_strides
 import dolfin.cpp as cpp
 import numpy
 
             shape = self.shape()
             assert len(shape) == len(component)
             value_size = ufl.common.product(shape)
-            index = ufl.common.component_to_index(component, shape)
+            index = flatten_multiindex(component, shape_to_strides(shape))
             values = numpy.zeros(value_size)
             self(*x, values=values)
             return values[index]

File site-packages/dolfin/functions/function.py

 
 # Import UFL and SWIG-generated extension module (DOLFIN C++)
 import ufl
+from ufl.utils.indexflattening import flatten_multiindex, shape_to_strides
 import dolfin.cpp as cpp
 import numpy
 
             shape = self.shape()
             assert len(shape) == len(component)
             value_size = ufl.common.product(shape)
-            index = ufl.common.component_to_index(component, shape)
+            index = flatten_multiindex(component, shape_to_strides(shape))
             values = numpy.zeros(value_size)
             self(*x, values=values)
             return values[index]