Subject: [Fenics-viper] Patch to match update in DOLFIN interface for MeshFunction.array()

From: Johan Hake <[email-masked]>
Date: Mon, 14 Feb 2011 21:55:44 -0800

Please apply the following patch to avoid deprecation warning each time a 
MeshFunction is plotted.

Johan
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email-masked]
# target_branch: bzr+ssh://bazaar.launchpad.net/~viper-core/fenics-\
#   viper/main/
# testament_sha1: d2e7ea947f82907169dbd10842532fdbb7d1ce29
# timestamp: 2011-02-14 21:45:52 -0800
# base_revision_id: [email-masked]
# 
# Begin patch
=== modified file 'src/viper/viper_dolfin.py'
--- src/viper/viper_dolfin.py	2011-01-20 09:54:43 +0000
+++ src/viper/viper_dolfin.py	2011-02-15 05:44:32 +0000
@@ -235,7 +235,7 @@
         mesh_dim = self.mesh.topology().dim()
         dim = data.dim()
         size = data.size()
-        values = data.values()
+        values = data.array()
         self.vtkgrid = self.make_vtk_grid(self.mesh)
         self.filter = self.vtkgrid
         self.x = numpy.array(values, dtype='d')
@@ -249,7 +249,7 @@
                 # Create a vertex valued meshfunction and plot that
                 self.mesh.init(dim)
                 vertices = type(data)(self.mesh, 0)
-                vertex_values = vertices.values()
+                vertex_values = vertices.array()
                 vertex_values[:] = 0
                 con20 = self.mesh.topology()(dim,0)
                 for facet in xrange(self.mesh.num_faces()):
@@ -355,7 +355,7 @@
             self.vtkgrid = self.make_vtk_grid(self.mesh)
             self.filter = self.vtkgrid
             self.update_scalar_mapper(self.filter)
-            self.x = numpy.array(data.values(), dtype='d')
+            self.x = numpy.array(data.array(), dtype='d')
         else:
             print "Unknown plottype %s. Can't update" % (self.plottype,)

# Begin bundle