Index: trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/parabolaplot.py
===================================================================
--- trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/parabolaplot.py	(revision 8429)
+++ trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/parabolaplot.py	(revision 8429)
@@ -0,0 +1,104 @@
+"""View results of runup.py
+"""
+#---------------
+# Import Modules
+#---------------
+#import anuga
+#import struct
+import numpy
+#import scipy
+from matplotlib import pyplot as pyplot
+from anuga.utilities import plot_utils as util
+
+p=util.get_output('parabola_v2.sww', 0.01)
+p2=util.get_centroids(p, velocity_extrapolation=True)
+
+# Define some 'lines' along which to plot
+v=(p2.y==p2.y[0])
+
+#--------------------
+# Make plot animation
+#--------------------
+pyplot.close() #If the plot is open, there will be problems
+pyplot.ion()
+
+if False:
+    line, = pyplot.plot( (p2.x[v].min(),p2.x[v].max()) ,(p2.stage[:,v].min(),p2.stage[:,v].max() ) )
+    for i in range(700,p2.xmom.shape[0]):
+        line.set_xdata(p2.x[v])
+        line.set_ydata(p2.stage[i,v])
+        pyplot.draw()
+        #pyplot.plot( (0,1),(0,0), 'r' )
+        pyplot.plot(p2.x[v],p2.elev[v]) 
+        pyplot.title(str(i)+'/200') # : velocity does not converge to zero' )
+        pyplot.xlabel('x')
+        pyplot.ylabel('stage (m/s)')
+
+if False:
+    pyplot.clf()
+ 
+    line, = pyplot.plot( (p2.x[v].min(),p2.x[v].max()) ,(p2.xvel[:,v].min(),p2.xvel[:,v].max() ), 'ro' )
+    for i in range(700,p2.xmom.shape[0]):
+        line.set_xdata(p2.x[v])
+        line.set_ydata(p2.xvel[i,v])
+        pyplot.draw()
+        pyplot.plot( (p2.x[v].min(),p2.x[v].max()),(0,0), 'ro' )
+        #pyplot.plot(x[v],elev[v]) 
+        pyplot.title(str(i)+'/200') # : velocity does not converge to zero' )
+        pyplot.xlabel('x')
+        pyplot.ylabel('xvel (m/s)')
+
+
+# Compute the analytical solution
+D0=4.0
+L=10.0
+A=2.0
+g=9.8
+#t=time[30]
+
+omega=numpy.sqrt(2*D0*g)/L
+T= 2*numpy.pi/omega
+ppp= (abs(p2.x-4.*L/2.)).argmin()
+ppp2= (abs(p2.x-4.*L/4.)).argmin()
+
+# Free surface over time in the channel centre
+w = D0 + 2*A*D0/(L**2)*numpy.cos(omega*p2.time)*( (p2.x[ppp]-4.*L/2.) -A/2.*numpy.cos(omega*p2.time))
+# Free surface over time at a wet/dry point on the parabola.
+w2 = D0 + 2*A*D0/(L**2)*numpy.cos(omega*p2.time)*( (p2.x[ppp2]-4.*L/2.) -A/2.*numpy.cos(omega*p2.time))
+w2 = w2*(w2>p2.elev[ppp2])+p2.elev[ppp2]*(w2<=p2.elev[ppp2])
+
+
+pyplot.clf()
+pyplot.plot(p2.time,w, color='blue', label='analytical')
+pyplot.plot(p2.time,p2.stage[:,ppp], color='green', label='numerical')
+pyplot.legend()
+pyplot.savefig('Stage_centre_v2.png')
+#       pyplot.savefig('runup_x_velocities.png')
+pyplot.clf()
+pyplot.plot(p2.time,w2, color='blue', label='analytical')
+pyplot.plot(p2.time,p2.stage[:,ppp2], color='green', label='numerical')
+pyplot.legend(loc=10)
+pyplot.savefig('Stage_centre_v3.png')
+
+
+pltind=numpy.argmin(abs(p2.time-T*3))
+
+# Free surface at time p2.time[pltind]
+w = D0 + 2*A*D0/(L**2)*numpy.cos(omega*p2.time[pltind])*( (p2.x[v]-4.*L/2.) -A/2.*numpy.cos(omega*p2.time[pltind]))
+pyplot.clf()
+pyplot.plot(p2.x[v],p2.xvel[pltind,v], label='Numerical')
+pyplot.plot(p2.x[v], -omega*A*numpy.sin(omega*p2.time[pltind])*(w>p2.elev[v]), label='Analytical')
+pyplot.legend()
+pyplot.title('Velocity near to time=3T')
+pyplot.savefig('Vel_3T_v2.png')
+
+pltind=numpy.argmin(abs(p2.time-T*3.25))
+# Free surface at time p2.time[pltind]
+w = D0 + 2*A*D0/(L**2)*numpy.cos(omega*p2.time[pltind])*( (p2.x[v]-4.*L/2.) -A/2.*numpy.cos(omega*p2.time[pltind]))
+
+pyplot.clf()
+pyplot.plot(p2.x[v],p2.xvel[pltind,v], label='Numerical')
+pyplot.plot(p2.x[v], -omega*A*numpy.sin(omega*p2.time[pltind])*(w>p2.elev[v]), label='Analytical')
+pyplot.legend()
+pyplot.title('Velocity near to time=3.25T')
+pyplot.savefig('Vel_3_5T_v2.png')
Index: trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/parabolic.py
===================================================================
--- trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/parabolic.py	(revision 8429)
+++ trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/parabolic.py	(revision 8429)
@@ -0,0 +1,83 @@
+"""Parabolic channel oscilation example
+"""
+#---------
+#Import Modules
+#--------
+import anuga
+from anuga import *
+#from anuga.shallow_water.shallow_water_domain import Domain as Domain
+import numpy
+
+#from balanced_dev import *
+#from balanced_basic import *
+#from anuga.shallow_water_balanced2.swb2_domain import Domain as Domain
+#from anuga.shallow_water.shallow_water_domain import Domain as Domain
+#---------
+#Setup computational domain
+#---------
+points, vertices, boundary = anuga.rectangular_cross(200,10, len1=40.0,len2=2.0)
+
+domain=Domain(points,vertices,boundary)    # Create Domain
+domain.set_name('parabola_v2')                         # Output to file runup.sww
+domain.set_datadir('.')                          # Use current folder
+domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1})
+domain.set_minimum_allowed_height(0.01)
+# Time stepping
+#domain.set_timestepping_method('euler') # Default
+#domain.set_timestepping_method('rk2') # 
+#domain.beta_w= 1. #0.2
+#domain.beta_uh= 1. #0.2
+#domain.beta_vh= 1. #0.2
+#domain.beta_w_dry= 0.2 #0.
+#domain.beta_uh_dry= 0.2 #0.
+#domain.beta_vh_dry= 0.2 #0.
+#domain.alpha=100.
+
+#------------------
+# Define topography
+#------------------
+
+# Parameters for analytical solution
+D0=4.0
+L=10.0
+A = 2.0
+
+def topography(x,y):
+	return  (D0/(L**2.))*(x-20.0)**2.
+
+def stage_init(x,y):
+    wat= ( D0 + (2.0*A*D0/L**2.)*((x-20.0)-A/2.0) ) # Water elevation inside the parabola
+    top=topography(x,y) # Bed elevation
+    # Return the maximum of the water elevation and the bed elvation
+    return wat*(wat>top) + top*(wat<=top)
+
+
+domain.set_quantity('elevation',topography)     # Use function for elevation
+
+domain.set_quantity('friction',0.00)            # No friction
+
+domain.set_quantity('stage', stage_init)        # Constant negative initial stage
+
+
+
+#--------------------------
+# Setup boundary conditions
+#--------------------------
+Br=anuga.Reflective_boundary(domain)            # Solid reflective wall
+#Bt=anuga.Transmissive_boundary(domain)          # Continue all values of boundary -- not used in this example
+#Bd=anuga.Dirichlet_boundary([-0.2,0.,0.])       # Constant boundary values -- not used in this example
+#Bw=anuga.Time_boundary(domain=domain,
+#	f=lambda t: [(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1,0.0,0.0]) # Time varying boundary -- get rid of the 0.0 to do a runup.
+
+#----------------------------------------------
+# Associate boundary tags with boundary objects
+#----------------------------------------------
+domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br})
+
+#------------------------------
+#Evolve the system through time
+#------------------------------
+for t in domain.evolve(yieldstep=0.1,finaltime=90.0):
+    print domain.timestepping_statistics()
+
+print 'Finished'
Index: trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/produce_results.py
===================================================================
--- trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/produce_results.py	(revision 8429)
+++ trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/produce_results.py	(revision 8429)
@@ -0,0 +1,2 @@
+import parabolic
+import parabolaplot
Index: trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/results.tex
===================================================================
--- trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/results.tex	(revision 8429)
+++ trunk/anuga_core/validation_tests/Tests/Analytical/parabolic_basin_1D/results.tex	(revision 8429)
@@ -0,0 +1,42 @@
+\section{1D Parabolic Basin}
+This simulates flow oscillations in a 1D parabolic basin. The analytical solution is described in (REF), and is periodic. At any instant in time, the free surface elevation is planar, and the velocity is constant (in wet regions). The scenario includes regular wetting and drying, as the flow oscillates back and forth in the basin. As well as testing the ability of the code to do wetting and drying, it will highlight any numerical energy loss or gain, manifest as an increase or decrease in the magnitude of the flow oscillations over long time periods, compared with the analytical solution. 
+
+\subsection{Results}
+Figures~\ref{stagecent} and~\ref{stagewd} show the time-evolution of the water elevation at two points in the parabola. There should be a good agreement with the analytical solution, although as time goes on some deviations may appear.  
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.9\textwidth]{Stage_centre_v2.png}
+\caption{Stage over time in the centre of the parabola}
+\label{stagecent}
+\end{center}
+\end{figure}
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.9\textwidth]{Stage_centre_v3.png}
+\caption{Stage over time at a point on the parabola where wetting and drying occurs}
+\label{stagewd}
+\end{center}
+\end{figure}
+
+Figures~\ref{velsnearpeak} and~\ref{velsnearzero} show the velocity profile at several instants in time, near to the absolute maximum and minimum respectively. There should be good agreement with the analytical solution for Figure~\ref{velsnearpeak}. For Figure~\ref{velsnearzero}, we expect velocities to be small, but accept more obvious numerical errors so long as this is the case. In previous versions of ANUGA, these plots would sometimes show strong velocity spikes near the wet dry boundaries. 
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.9\textwidth]{Vel_3_5T_v2.png}
+\caption{Velocity at an instant in time}
+\label{velsnearpeak}
+\end{center}
+\end{figure}
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.9\textwidth]{Vel_3T_v2.png}
+\caption{Velocity at an instant in time}
+\label{velsnearzero}
+\end{center}
+\end{figure}
+
+
+\endinput
Index: trunk/anuga_core/validation_tests/report.tex
===================================================================
--- trunk/anuga_core/validation_tests/report.tex	(revision 8428)
+++ trunk/anuga_core/validation_tests/report.tex	(revision 8429)
@@ -34,4 +34,6 @@
 \inputresults{Tests/Analytical/trapezoidal_channel}
 
+\inputresults{Tests/Analytical/parabolic_basin_1D}
+
 %======================
 \chapter{Experimental Tests}
