Index: /anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
===================================================================
--- /anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py	(revision 7589)
+++ /anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py	(revision 7590)
@@ -1142,6 +1142,6 @@
 
 
-        The returned values will have the leading dimension equal to length of the indices list or
-        N (all values) if indices is None.
+        The returned values will have the leading dimension equal to 
+        length of the indices list or N (all values) if indices is None.
 
         In case of location == 'centroids' the dimension of returned
@@ -1157,4 +1157,8 @@
 
         Indices is the set of element ids that the operation applies to.
+        If indices is None (or omitted) all elements are returned as
+        a copy of the relevant array. If performance is critical, 
+        use arrays domain.centroid_values, domain.vertex_values and 
+        domain.edge_values directly.
 
         The values will be stored in elements following their
@@ -1178,5 +1182,6 @@
         # Edges have already been deprecated in set_values, see changeset:5521,
         # but *might* be useful in get_values. Any thoughts anyone?
-        # YES (Ole): Edge values are necessary for volumetric balance check and inflow boundary. Keep them.
+        # YES (Ole): Edge values are necessary for volumetric balance 
+        # check and inflow boundary. Keep them!
 
         if location not in ['vertices', 'centroids',
@@ -1185,19 +1190,20 @@
             raise Exception, msg
 
-        import types
-
-        msg = "'indices' must be a list, array or None"
+
+        msg = '\'indices\' must be a list, array or None'
         assert isinstance(indices, (NoneType, list, num.ndarray)), msg
 
         if location == 'centroids':
-            if (indices ==  None):
-                indices = range(len(self))
-            return num.take(self.centroid_values, indices, axis=0)
+            if indices is None:
+                return self.centroid_values.copy()
+            else:
+                return num.take(self.centroid_values, indices, axis=0)
         elif location == 'edges':
-            if (indices ==  None):
-                indices = range(len(self))
-            return num.take(self.edge_values, indices, axis=0)
+            if indices is  None:
+                return self.edge_values.copy()
+            else:    
+                return num.take(self.edge_values, indices, axis=0)
         elif location == 'unique vertices':
-            if (indices ==  None):
+            if indices is None:
                 indices=range(self.domain.get_number_of_nodes())
             vert_values = []
@@ -1221,7 +1227,8 @@
             return num.array(vert_values, num.float)
         else:
-            if (indices is None):
-                indices = range(len(self))
-            return num.take(self.vertex_values, indices, axis=0)
+            if indices is None:
+                return self.vertex_values.copy()
+            else:    
+                return num.take(self.vertex_values, indices, axis=0)
 
     ##
Index: /anuga_core/source/anuga/abstract_2d_finite_volumes/test_quantity.py
===================================================================
--- /anuga_core/source/anuga/abstract_2d_finite_volumes/test_quantity.py	(revision 7589)
+++ /anuga_core/source/anuga/abstract_2d_finite_volumes/test_quantity.py	(revision 7590)
@@ -2165,6 +2165,6 @@
         indices = [1,5]
         quantity.set_values(value,
-                            location = 'unique vertices',
-                            indices = indices)
+                            location='unique vertices',
+                            indices=indices)
         #print "quantity.centroid_values",quantity.centroid_values
         assert num.allclose(quantity.vertex_values[0], [0,7,0])
@@ -2202,5 +2202,5 @@
         answer = [0.5,2,4,5,0,1,3,4.5]
         assert num.allclose(answer,
-                            quantity.get_values(location = 'unique vertices'))
+                            quantity.get_values(location='unique vertices'))
 
         indices = [0,5,3]
@@ -2208,5 +2208,5 @@
         assert num.allclose(answer,
                             quantity.get_values(indices=indices,
-                                                location = 'unique vertices'))
+                                                location='unique vertices'))
         #print "quantity.centroid_values",quantity.centroid_values
         #print "quantity.get_values(location = 'centroids') ",\
@@ -2237,22 +2237,29 @@
         quantity.set_values(lambda x, y: x+2*y) #2 4 4 6
         
-        assert num.allclose(quantity.get_values(location='centroids'), [2,4,4,6])
-        assert num.allclose(quantity.get_values(location='centroids', indices=[1,3]), [4,6])
-
-
-        assert num.allclose(quantity.get_values(location='vertices'), [[4,0,2],
-                                                                       [4,2,6],
-                                                                       [6,2,4],
-                                                                       [8,4,6]])
-        
-        assert num.allclose(quantity.get_values(location='vertices', indices=[1,3]), [[4,2,6],
-                                                                                      [8,4,6]])
-
-
-        assert num.allclose(quantity.get_values(location='edges'), [[1,3,2],
-                                                                    [4,5,3],
-                                                                    [3,5,4],
-                                                                    [5,7,6]])
-        assert num.allclose(quantity.get_values(location='edges', indices=[1,3]),
+        assert num.allclose(quantity.get_values(location='centroids'), 
+                            [2,4,4,6])
+                            
+        assert num.allclose(quantity.get_values(location='centroids', 
+                                                indices=[1,3]), [4,6])
+
+
+        assert num.allclose(quantity.get_values(location='vertices'), 
+                            [[4,0,2],
+                             [4,2,6],
+                             [6,2,4],
+                             [8,4,6]])
+        
+        assert num.allclose(quantity.get_values(location='vertices', 
+                                                indices=[1,3]), [[4,2,6],
+                                                                 [8,4,6]])
+
+
+        assert num.allclose(quantity.get_values(location='edges'), 
+                            [[1,3,2],
+                             [4,5,3],
+                             [3,5,4],
+                             [5,7,6]])
+        assert num.allclose(quantity.get_values(location='edges', 
+                                                indices=[1,3]),
                             [[4,5,3],
                              [5,7,6]])        
@@ -2265,8 +2272,6 @@
         #e: (6+6+6)/3        
         #f: 4
-        assert num.allclose(quantity.get_values(location='unique vertices'), [0, 4, 2, 8, 6, 4])        
-                                                                                  
-        
-
+        assert num.allclose(quantity.get_values(location='unique vertices'), 
+                            [0, 4, 2, 8, 6, 4]) 
 
 
@@ -2306,6 +2311,7 @@
         #print answer
         #print quantity.get_values(interpolation_points=interpolation_points)
-        assert num.allclose(answer, quantity.get_values(interpolation_points=interpolation_points,
-                                                        verbose=False))        
+        assert num.allclose(answer, 
+                            quantity.get_values(interpolation_points=interpolation_points,
+                                                verbose=False))        
                         
 
@@ -2507,7 +2513,17 @@
         assert num.allclose(answer_vertex_values,
                             quantity.vertex_values)
-        #print "quantity.centroid_values",quantity.centroid_values
-        #print "quantity.get_values(location = 'centroids') ",\
-        #      quantity.get_values(location = 'centroids')
+                            
+        # Just another (slightly larger) test of get_values
+
+        assert num.allclose(quantity.get_values(location='centroids'),
+                            quantity.centroid_values)
+                            
+                            
+        assert num.allclose(quantity.get_values(location='vertices'),
+                            quantity.vertex_values)                            
+                            
+        assert num.allclose(quantity.get_values(location='edges'),
+                            quantity.edge_values)
+                            
 
 
