Index: /trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py	(revision 9220)
+++ /trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py	(revision 9221)
@@ -558,8 +558,8 @@
 
     def set_DE2_defaults(self):
-        """Set up the defaults for running the flow_algorithm "DE1"
+        """Set up the defaults for running the flow_algorithm "DE2"
            A 'discontinuous elevation' method
         """
-        self.set_CFL(0.95)
+        self.set_CFL(1.0)
         self.set_use_kinematic_viscosity(False)
         #self.timestepping_method='rk2'#'rk3'#'euler'#'rk2' 
@@ -625,4 +625,72 @@
 
 
+    def set_DE3_defaults(self):
+        """Set up the defaults for running the flow_algorithm "DE3"
+           A 'discontinuous elevation' method
+        """
+        self.set_CFL(0.9)
+        self.set_use_kinematic_viscosity(False)
+        #self.timestepping_method='rk2'#'rk3'#'euler'#'rk2' 
+        self.set_timestepping_method(1)
+        
+        self.set_using_discontinuous_elevation(True)
+        self.set_compute_fluxes_method('DE')
+        self.set_distribute_to_vertices_and_edges_method('DE')
+        
+        # Don't place any restriction on the minimum storable height
+        self.minimum_storable_height=-99999999999.0 
+        self.minimum_allowed_height=1.0e-12
+
+        self.use_edge_limiter=True
+        self.set_default_order(2)
+        self.set_extrapolate_velocity()
+
+        self.beta_w=0.7
+        self.beta_w_dry=0.1
+        self.beta_uh=0.7
+        self.beta_uh_dry=0.1
+        self.beta_vh=0.7
+        self.beta_vh_dry=0.1
+        
+
+        #self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 
+        #         'ymomentum': 2, 'elevation': 2, 'height':2})
+        #self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 
+        #         'ymomentum': 2, 'elevation': 1})
+        self.set_store_centroids(True)
+
+        self.optimise_dry_cells=False 
+
+        # We need the edge_coordinates for the extrapolation
+        self.edge_coordinates=self.get_edge_midpoint_coordinates()
+
+        # By default vertex values are NOT stored uniquely
+        # for storage efficiency. We may override this (but not so important since
+        # centroids are stored anyway
+        # self.set_store_vertices_smoothly(False)
+
+        self.maximum_allowed_speed=0.0
+
+        ## FIXME: Should implement tracking of boundary fluxes
+        ## Keep track of the fluxes through the boundaries
+        self.boundary_flux_integral=num.ndarray(1)
+        self.boundary_flux_integral[0]=0. 
+        self.boundary_flux_sum=num.ndarray(1)
+        self.boundary_flux_sum[0]=0.
+
+        self.call=1 # Integer counting how many times we call compute_fluxes_central
+
+        if self.processor == 0 and self.verbose:
+            print '##########################################################################'
+            print '#'
+            print '# Using discontinuous elevation solver DE3'
+            print '#'
+            print '# A slightly less diffusive version than DE0, uses euler timestepping'
+            print '#'
+            print '# Make sure you use centroid values when reporting on important output quantities'
+            print '#'
+            print '##########################################################################'
+
+
 
     def update_special_conditions(self):
@@ -780,4 +848,5 @@
            DE1
            DE2
+           DE3
         """
 
@@ -787,5 +856,6 @@
             flag = str(float(str(flag))).replace(".","_")
 
-        flow_algorithms = ['1_0', '1_5', '1_75', '2_0', '2_0_limited', '2_5', 'tsunami', 'yusuke', 'DE0', 'DE1', 'DE2']
+        flow_algorithms = ['1_0', '1_5', '1_75', '2_0', '2_0_limited', '2_5', \
+                           'tsunami', 'yusuke', 'DE0', 'DE1', 'DE2', 'DE3']
 
         if flag in flow_algorithms:
@@ -903,4 +973,7 @@
         if self.flow_algorithm == 'DE2':
             self.set_DE2_defaults()
+            
+        if self.flow_algorithm == 'DE3':
+            self.set_DE3_defaults()
 
     def get_flow_algorithm(self):
@@ -908,5 +981,5 @@
 
         Currently
-           1_0, 1_5, 1_75 2_0, 2_5, tsunami, DE0, DE1, DE2
+           1_0, 1_5, 1_75 2_0, 2_5, tsunami, DE0, DE1, DE2, DE3
         """
 
@@ -1220,4 +1293,36 @@
         return self.get_quantity('elevation').\
                    get_maximum_location(indices=wet_elements)
+
+
+    def get_total_volume(self):
+    
+        from anuga import myid, numprocs, send, receive, barrier
+
+        if self.get_using_discontinuous_elevation():    
+            Height = self.quantities['height']
+            volume = Height.get_integral()
+        else:
+            Stage = self.quantities['stage']
+            Elev =  self.quantities['elevation']
+            Height = Stage-Elev
+            volume = Height.get_integral()
+            
+        if myid == 0:
+            total_volume = volume
+            for i in range(1,numprocs):
+                remote_volume = receive(i)
+                total_volume = total_volume + remote_volume
+        else:
+            send(volume,0)
+        
+        barrier()
+    
+        if myid == 0:
+            for i in range(1,numprocs):
+                send(total_volume,i)
+        else:
+            total_volume = receive(0)
+        
+        return total_volume
 
 
@@ -1729,5 +1834,5 @@
                 print 'Cumulative mass protection: '+str(mass_error)+' m^3 '
 
-        elif self.flow_algorithm == 'DE1'  or self.flow_algorithm == 'DE0':
+        elif self.flow_algorithm.startswith('DE'):
 
             from swDE1_domain_ext import protect
@@ -1831,5 +1936,6 @@
             
             if len(negative_ids)>0:
-                #print 'NEGATIVE INDICES'
+                import warnings
+                warnings.warn('Negative cells being set to zero depth, possible loss of conservation')
                 Stage.centroid_values[negative_ids] = Elev.centroid_values[negative_ids]
                 Xmom.centroid_values[negative_ids] = 0.0
Index: /trunk/anuga_core/validation_tests/analytical_exact/rundown_mild_slope_coarse/plot_results.py
===================================================================
--- /trunk/anuga_core/validation_tests/analytical_exact/rundown_mild_slope_coarse/plot_results.py	(revision 9220)
+++ /trunk/anuga_core/validation_tests/analytical_exact/rundown_mild_slope_coarse/plot_results.py	(revision 9221)
@@ -43,5 +43,5 @@
 
 #--------------------
-# Make plot animation
+# Make plots
 #--------------------
 # Find an y value close to y==50
@@ -67,6 +67,6 @@
 #pyplot.ylim([0.0,0.05])
 pyplot.xlabel('Xposition m')
-pyplot.ylabel('Depth m')
-pyplot.title('Velocity down the slope (along y=50.)')
+pyplot.ylabel('Velocity m/s')
+pyplot.title('X Velocity down the slope (along y=50.)')
 pyplot.legend(loc='best')
 pyplot.savefig('xvelocity_x.png')
@@ -98,6 +98,6 @@
 pyplot.ylim([0.0,0.35])
 pyplot.xlabel('Yposition along the line x=50')
-pyplot.ylabel('Xvelocity m/s')
-pyplot.title('Final Xvelocity around the line x=50.')
+pyplot.ylabel('Velocity m/s')
+pyplot.title('X Velocity around the line x=50.')
 pyplot.legend(loc='best')
 pyplot.savefig('x_velocity.png')
@@ -108,6 +108,6 @@
 #pyplot.ylim([0.0,0.3])
 pyplot.xlabel('Yposition along the line x=50')
-pyplot.ylabel('Yvelocity')
-pyplot.title('Final Yvelocity around the line x=50.')
+pyplot.ylabel('Velocity m/s')
+pyplot.title('Y Velocity around the line x=50.')
 pyplot.legend(loc='best')
 pyplot.savefig('y_velocity.png')
Index: /trunk/anuga_core/validation_tests/analytical_exact/rundown_mild_slope_coarse/results.tex
===================================================================
--- /trunk/anuga_core/validation_tests/analytical_exact/rundown_mild_slope_coarse/results.tex	(revision 9220)
+++ /trunk/anuga_core/validation_tests/analytical_exact/rundown_mild_slope_coarse/results.tex	(revision 9221)
@@ -41,7 +41,23 @@
 \begin{figure}
 \begin{center}
-\includegraphics[width=0.8\textwidth]{final_depth.png}
+\includegraphics[width=0.8\textwidth]{depth_x.png}
 \caption{Depth in the downstream direction}
 \label{fig:depthdownchan}
+\end{center}
+\end{figure}
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=0.8\textwidth]{xvelocity_x.png}
+\caption{X velocity in the downstream direction}
+\label{fig:xveldownchan}
+\end{center}
+\end{figure}
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=0.8\textwidth]{depth_y.png}
+\caption{Depth in the downstream direction}
+\label{fig:depthacrosschan}
 \end{center}
 \end{figure}
Index: /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/numerical_channel_floodplain.py
===================================================================
--- /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/numerical_channel_floodplain.py	(revision 9220)
+++ /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/numerical_channel_floodplain.py	(revision 9221)
@@ -10,5 +10,5 @@
 import anuga
 import numpy
-from anuga import myid, finalize, distribute
+from anuga import myid, finalize, distribute, numprocs, receive, send
 
 #------------------------------------------------------------------------------
@@ -28,5 +28,5 @@
           man_n, l0
 
-#l0 = 2.0
+l0 = 2.0
 
 assert chan_width < floodplain_width, \
@@ -54,6 +54,6 @@
 # do not overlap. 
 channel_polygon = [ [floodplain_width/2. - chan_width/2., +l0],
-                    [floodplain_width/2. - chan_width/2., floodplain_length-l0],
-                    [floodplain_width/2. + chan_width/2., floodplain_length-l0],
+                    [floodplain_width/2. - chan_width/2., floodplain_length - l0],
+                    [floodplain_width/2. + chan_width/2., floodplain_length - l0],
                     [floodplain_width/2. + chan_width/2., +l0]
                     ]
@@ -127,5 +127,5 @@
 # Define inlet operator 
 #--------------------------------------------------------------------- 
-flow_in_yval=0.0
+flow_in_yval=5.0
 line1 = [ [floodplain_width/2. - chan_width/2., flow_in_yval],\
           [floodplain_width/2. + chan_width/2., flow_in_yval] ]
@@ -173,4 +173,7 @@
     parameter_file.close()
 
+
+
+
 #------------------------------------------------------------------------------
 # Evolve system through time
@@ -178,4 +181,14 @@
 for t in domain.evolve(yieldstep=10.0, finaltime=1000.0):
     if myid == 0 and verbose: print domain.timestepping_statistics()
+    
+#     if numpy.allclose(t,0.0):
+#         exact_volume = domain.get_total_volume()
+#     else:
+#         exact_volume = exact_volume + Qin*10.0
+#         
+#     total_volume= domain.get_total_volume()
+    
+    
+    #if myid == 0 and verbose: print anuga.indent,'total volume - exact_volume ', total_volume - exact_volume   
 
 domain.sww_merge(delete_old=True)
Index: /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/plot_results.py
===================================================================
--- /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/plot_results.py	(revision 9220)
+++ /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/plot_results.py	(revision 9221)
@@ -14,5 +14,5 @@
 print numpy.any(v)
 # Numerical results along a central channel 'slice'
-index=p.stage.shape[0]-1
+index= -1
 V1 = p.stage[index,v] - p.elev[v]
 V2 = p.yvel[index,v]
@@ -49,5 +49,5 @@
 dc_analytical = scipy.optimize.fmin(minme, x0=1.0)[0]
 
-
+print 'dc_analytic ',dc_analytical
 
 ##################################
Index: /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/results.tex
===================================================================
--- /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/results.tex	(revision 9220)
+++ /trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/results.tex	(revision 9221)
@@ -28,5 +28,7 @@
 
 Figure~\ref{fig:hydrographs} show the hydrographs through various cross sections showing the flows limiting to the 
-expected inflow $Q$. 
+expected inflow $Q$ (For coarser grids there is a discrepency between the expected and calculated limiting 
+hydrograph due to the error in calculating the hydrograph). It is also noted that the transient flow is quite different 
+for different grid sizes. We theorize that the coarser grids produce a rougher bed which slows down the flow. 
 
 \begin{figure}
