Index: /trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain.py
===================================================================
--- /trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain.py	(revision 8240)
+++ /trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain.py	(revision 8241)
@@ -151,5 +151,5 @@
     def initialize_plotting(self,
                             stage_lim = [-1.0, 40.0],
-                            height_lim = [-1.0, 10.0],
+                            width_lim = [-1.0, 10.0],
                             velocity_lim = [-5.0, 5.0]):
 
@@ -159,12 +159,17 @@
 
         x = self.get_vertices().flatten()
+
         z = self.quantities['elevation'].vertex_values.flatten()
         w = self.quantities['stage'].vertex_values.flatten()
         h = self.quantities['height'].vertex_values.flatten()
         v = self.quantities['velocity'].vertex_values.flatten()
+        b = self.quantities['width'].vertex_values.flatten()
 
         print x.shape
         print z.shape
 
+        #-------------------------------
+        # Top plot
+        #-------------------------------
         self.plot1 = pylab.subplot(311)
 
@@ -173,15 +178,21 @@
 
         self.plot1.set_ylim(stage_lim)
-        pylab.xlabel('Position')
+        #pylab.xlabel('Position')
         pylab.ylabel('Stage')
 
+        #-------------------------------
+        # Middle Plot
+        #-------------------------------
         self.plot2 = pylab.subplot(312)
 
-        self.hplot, = pylab.plot(x, h)
-
-        self.plot2.set_ylim(height_lim)
-        pylab.xlabel('Position')
-        pylab.ylabel('Height')
-
+        self.bplot, = pylab.plot(x, b)
+
+        self.plot2.set_ylim(width_lim)
+        #pylab.xlabel('Position')
+        pylab.ylabel('Width')
+
+        #-------------------------------
+        # Bottom Plot
+        #-------------------------------
         self.plot3 = pylab.subplot(313)
 
@@ -203,9 +214,10 @@
         h = self.quantities['height'].vertex_values.flatten()
         v = self.quantities['velocity'].vertex_values.flatten()
+        b = self.quantities['width'].vertex_values.flatten()
 
 
         self.zplot.set_ydata(z)
         self.wplot.set_ydata(w)
-        self.hplot.set_ydata(h)
+        self.bplot.set_ydata(b)
         self.vplot.set_ydata(v)
 
@@ -213,5 +225,5 @@
 
 
-    def hold_plotting(self):
+    def hold_plotting(self,save=None):
 
         self.update_plotting()
@@ -219,4 +231,8 @@
         
         pylab.ioff()
+
+        if save != None:
+            file = save+".pdf"
+            pylab.savefig(file)
 
         pylab.show()
@@ -287,5 +303,5 @@
     w_C[:] = h_C + z_C
 
-    print w_C
+    #print w_C
 
     # Extrapolate velocity and stage as well as channel geometry.
Index: /trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain_ext.c
===================================================================
--- /trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain_ext.c	(revision 8240)
+++ /trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_domain_ext.c	(revision 8241)
@@ -624,5 +624,5 @@
             qrm[5] = width_edge_values[ki];
 
-             _flux_function_channel(qlm,qlp,qrm,qrp,g,epsilon,h0,edgeflux,&max_speed);
+             _flux_function_channel21(qlm,qlp,qrm,qrp,g,epsilon,h0,edgeflux,&max_speed);
 	    flux[0] -= edgeflux[0];
 	    flux[1] -= edgeflux[1];
Index: /trunk/anuga_work/development/2010-projects/anuga_1d/channel/var_depth_only.py
===================================================================
--- /trunk/anuga_work/development/2010-projects/anuga_1d/channel/var_depth_only.py	(revision 8240)
+++ /trunk/anuga_work/development/2010-projects/anuga_1d/channel/var_depth_only.py	(revision 8241)
@@ -105,5 +105,5 @@
 WidthC = domain.quantities['width'].centroid_values
 #
-AreaC[:] = (6.0 - BedC)* WidthC
+AreaC[:] = (8.0 - BedC)* WidthC
 
 #domain.set_quantity('area', initial_area)
@@ -124,41 +124,4 @@
 print domain.quantities['width'].vertex_values
 
-#HeightC = domain.quantities['height'].centroid_values
-#DischargeC = domain.quantities['discharge'].centroid_values
-#C = domain.centroids
-#print 'That took %.2f seconds' %(time.time()-t0)
-#X = (domain.vertices).flatten()
-#HeightQ = (domain.quantities['height'].vertex_values).flatten()
-#VelocityQ = (domain.quantities['velocity'].vertex_values).flatten()
-#Z = (domain.quantities['elevation'].vertex_values).flatten()
-#stage=HeightQ + Z
-#
-#
-#from pylab import plot,title,xlabel,ylabel,legend,savefig,show,hold,subplot,savefig
-#import pylab as p
-##hold(False)
-#
-#plot1=subplot(211)
-#
-#plot(X,stage,X,Z)
-#
-#plot1.set_ylim([-1,11])
-#xlabel('Position')
-#ylabel('Stage')
-#legend(('Solution', 'Bed Height'),
-#                'upper right', shadow=True)
-#
-#plot2=subplot(212)
-#
-#
-#plot(X,VelocityQ)
-#plot2.set_ylim([-5,5])
-#xlabel('Position')
-#ylabel('Velocity')
-#
-#savefig(str(i)+'.png')
-#i+=1
-#plot1.clear()
-#plot2.clear()
 
 domain.distribute_to_vertices_and_edges()
@@ -170,8 +133,6 @@
 yieldstep = 1.0
 
-
-
-domain.initialize_plotting(stage_lim = [-2.0, 14.0],
-                           height_lim = [-2.0, 14.0],
+domain.initialize_plotting(stage_lim = [-2.0, 12.0],
+                           width_lim = [0.0, 2.0],
                            velocity_lim = [-10.0, 10.0])
 
@@ -181,80 +142,8 @@
     domain.update_plotting()
 
-#    HeightC = domain.quantities['height'].centroid_values
-#    DischargeC = domain.quantities['discharge'].centroid_values
-#    C = domain.centroids
-#    print 'That took %.2f seconds' %(time.time()-t0)
-#    X = (domain.vertices).flatten()
-#    HeightQ = (domain.quantities['height'].vertex_values).flatten()
-#    VelocityQ = (domain.quantities['velocity'].vertex_values).flatten()
-#    Z = (domain.quantities['elevation'].vertex_values).flatten()
-#    stage=HeightQ + Z
-#
-#
-#    from pylab import plot,title,xlabel,ylabel,legend,savefig,show,hold,subplot,savefig
-#    import pylab as p
-##hold(False)
-#
-#    plot1=subplot(211)
-#
-#    plot(X,stage,X,Z)
-#
-#    plot1.set_ylim([-1,11])
-#    xlabel('Position')
-#    ylabel('Stage')
-#    legend(('Solution', 'Bed Height'),
-#                'upper right', shadow=True)
-#
-#    plot2=subplot(212)
-#
-#
-#    plot(X,VelocityQ)
-#    plot2.set_ylim([-5,5])
-#    xlabel('Position')
-#    ylabel('Velocity')
-#
-#    savefig(str(i)+'.png')
-#    i+=1
-#    plot1.clear()
-#    plot2.clear()
 
 print domain.quantities['elevation'].vertex_values
 
-
-domain.hold_plotting()
+domain.hold_plotting(save="not_well_balanced_random_depth")
 
 
-#N = float(N)
-#HeightC = domain.quantities['height'].centroid_values
-#DischargeC = domain.quantities['discharge'].centroid_values
-#C = domain.centroids
-#print 'That took %.2f seconds' %(time.time()-t0)
-#X = (domain.vertices).flatten()
-#HeightQ = (domain.quantities['height'].vertex_values).flatten()
-#VelocityQ = (domain.quantities['velocity'].vertex_values).flatten()
-#Z = (domain.quantities['elevation'].vertex_values).flatten()
-#stage=HeightQ + Z
-#
-#
-#from pylab import plot,title,xlabel,ylabel,legend,savefig,show,hold,subplot
-#
-##hold(False)
-#
-#plot1=subplot(211)
-#
-#plot(X,stage,X,Z)
-#
-#plot1.set_ylim([-1,11])
-#xlabel('Position')
-#ylabel('Stage')
-#legend(('Solution', 'Bed Height'),
-#           'upper right', shadow=True)
-#
-#plot2=subplot(212)
-#plot(X,VelocityQ)
-#plot2.set_ylim([-5,5])
-#xlabel('Position')
-#ylabel('Velocity')
-   
-#show()
-
Index: /trunk/anuga_work/development/2010-projects/anuga_1d/channel/var_width_depth.py
===================================================================
--- /trunk/anuga_work/development/2010-projects/anuga_1d/channel/var_width_depth.py	(revision 8240)
+++ /trunk/anuga_work/development/2010-projects/anuga_1d/channel/var_width_depth.py	(revision 8241)
@@ -1,9 +1,11 @@
 import os
 import random
-from math import sqrt, pow, pi 
-from channel_domain_Ab import *
-from Numeric import allclose, array, zeros, ones, Float, take, sqrt
-from config import g, epsilon
+from math import sqrt, pow, pi
+from channel_domain import *
+from numpy import allclose, array, zeros, ones, take, sqrt
+from anuga_1d.config import g, epsilon
 
+
+random.seed(111)
 
 print "Variable Width Only Test"
@@ -11,5 +13,5 @@
 # Define functions for initial quantities
 def initial_area(x):
-    y = zeros(len(x),Float)
+    y = zeros(len(x),'f')
     for i in range(len(x)):
         y[i]=(10-randomarray[i])
@@ -20,5 +22,5 @@
 def width(x):
 
-    y = zeros(len(x),Float)
+    y = zeros(len(x),'f')
     for i in range(len(x)):
         y[i]=randomarray[i]
@@ -28,5 +30,5 @@
 def bed(x):
 
-    y = zeros(len(x),Float)
+    y = zeros(len(x),'f')
     for i in range(len(x)):
         y[i]=randomarray2[i]
@@ -38,5 +40,5 @@
 def stage(x):
 
-    y = zeros(len(x),Float)
+    y = zeros(len(x),'f')
     for i in range(len(x)):
         if x[i]<200 and x[i]>150:
@@ -64,5 +66,5 @@
 print "Evaluating domain with %d cells" %N
 cell_len = L/N # Origin = 0.0
-points = zeros(N+1,Float)
+points = zeros(N+1,'f')
 
 # Define the centroid points
@@ -74,8 +76,8 @@
 
 # Define random array for width
-randomarray=zeros(len(points),Float)
+randomarray=zeros(len(points),'f')
 for j in range(N+1):
     randomarray[j]=random.normalvariate(3,1)
-randomarray2=zeros(len(points),Float)
+randomarray2=zeros(len(points),'f')
 for j in range(N+1):
     randomarray2[j]=random.normalvariate(3,1)
@@ -98,46 +100,29 @@
 t0 = time.time()
 
-print domain.quantities['elevation'].vertex_values
+
+AreaC = domain.quantities['area'].centroid_values
+BedC = domain.quantities['elevation'].centroid_values
+WidthC = domain.quantities['width'].centroid_values
+#
+AreaC[:] = (10.0 - BedC)* WidthC
+
+
+#print domain.quantities['elevation'].vertex_values
+
+finaltime = 100.0
+yieldstep = 1.0
+
+domain.initialize_plotting(stage_lim = [-1.0, 20.0],
+                           width_lim = [0.0, 6.0],
+                           velocity_lim = [-1.0, 1.0])
+
 
 for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
     domain.write_time()
 
-print domain.quantities['elevation'].vertex_values
+    domain.update_plotting()
 
-N = float(N)
-HeightC = domain.quantities['height'].centroid_values
-DischargeC = domain.quantities['discharge'].centroid_values
-C = domain.centroids
-print 'That took %.2f seconds' %(time.time()-t0)
-X = domain.vertices
-HeightQ = domain.quantities['height'].vertex_values
-VelocityQ = domain.quantities['velocity'].vertex_values
-x = X.flat
-z = domain.quantities['elevation'].vertex_values.flat
-b = domain.quantities['width'].vertex_values.flat
-stage=HeightQ.flat+z
+#print domain.quantities['elevation'].vertex_values
 
+domain.hold_plotting()
 
-
-from pylab import plot,title,xlabel,ylabel,legend,savefig,show,hold,subplot
-
-#hold(False)
-   
-plot1=subplot(211)
-
-plot(x,stage,x,z,x,b)
- 
-plot1.set_ylim([-5,15])
-xlabel('Position')
-ylabel('Stage')
-legend(('Solution', 'Bed','Width'),
-            'upper right', shadow=True)
-
-plot2=subplot(212)
-plot(x,VelocityQ.flat)
-plot2.set_ylim([-10,10])
-xlabel('Position')
-ylabel('Velocity')
-   
-show()
-
