Index: trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py	(revision 8751)
@@ -14,6 +14,6 @@
 #from anuga import *
 #from balanced_basic import *
-#from balanced_dev import *
-from anuga_tsunami import *
+from balanced_dev import *
+#from anuga_tsunami import *
 #from balanced_basic.swb2_domain import *
 #from balanced_basic.swb2_domain import Domain
Index: trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py	(revision 8751)
@@ -51,15 +51,15 @@
 # Setup Algorithm
 #------------------------------------------------------------------------------
-domain.set_timestepping_method('rk2')
-domain.set_default_order(2)
+#domain.set_timestepping_method('rk2')
+#domain.set_default_order(2)
 
 print domain.get_timestepping_method()
 
-domain.use_edge_limiter = True
+#domain.use_edge_limiter = True
 #domain.use_edge_limiter = False
-domain.tight_slope_limiters = True
-domain.use_centroid_velocities = False
+#domain.tight_slope_limiters = True
+#domain.use_centroid_velocities = False
 
-domain.CFL = 1.0
+#domain.CFL = 1.0
 
 #domain.beta_w      = 0.6
Index: trunk/anuga_work/development/gareth/tests/dam_break/plotme.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/dam_break/plotme.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/dam_break/plotme.py	(revision 8751)
@@ -9,5 +9,5 @@
 p2_st=util.get_centroids(p_st)
 
-p_dev = util.get_output('dam_break_20120831_172309/dam_break.sww', 0.001)
+p_dev = util.get_output('dam_break_20130219_202649/dam_break.sww', 0.001)
 p2_dev=util.get_centroids(p_dev, velocity_extrapolation=True)
 
Index: trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py	(revision 8751)
@@ -24,6 +24,6 @@
 import anuga
 import project
-#from balanced_dev import *
-from anuga_tsunami import *
+from balanced_dev import *
+#from anuga_tsunami import *
 
 def main(elevation_in_mesh=False):
Index: trunk/anuga_work/development/gareth/tests/parabolic/parabolaplot.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/parabolic/parabolaplot.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/parabolic/parabolaplot.py	(revision 8751)
@@ -11,5 +11,5 @@
 import util
 
-p=util.get_output('parabola_v2.sww', 0.01)
+p=util.get_output('parabola_v2.sww', 0.001)
 p2=util.get_centroids(p, velocity_extrapolation=True)
 
Index: trunk/anuga_work/development/gareth/tests/runup/runup.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/runup/runup.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/runup/runup.py	(revision 8751)
@@ -56,6 +56,6 @@
 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.
+#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.
 
 #----------------------------------------------
Index: trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py	(revision 8751)
@@ -14,6 +14,7 @@
 #from swb2_domain import *
 #from balanced_basic import *
-#from balanced_dev import *
-from anuga_tsunami import *
+from balanced_dev import *
+#from anuga_tsunami import *
+
 #---------
 #Setup computational domain
@@ -23,12 +24,9 @@
 domain=Domain(points,vertices,boundary)    # Create Domain
 domain.set_name('runup_sinusoid_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_store_vertices_uniquely(True)
+
 #------------------
 # Define topography
 #------------------
 scale_me=1.0
-
 #domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave
 
@@ -37,5 +35,5 @@
 
 def stagefun(x,y):
-    stge=-0.2*scale_me #+0.01*(x>0.9) 
+    stge=-0.2*scale_me #+0.1*(x>0.9) 
     #topo=topography(x,y) 
     return stge#*(stge>topo) + (topo)*(stge<=topo)
@@ -53,4 +51,6 @@
 domain.get_quantity('stage').smooth_vertex_values()
 
+#print domain.forcing_terms
+#assert 0==1
 # Experiment with rain.
 # rainin = anuga.shallow_water.forcing.Rainfall(domain, rate=0.001) #, center=(0.,0.), radius=1000. )
@@ -64,5 +64,5 @@
 Bd=anuga.Dirichlet_boundary([-0.1*scale_me,0.,0.])       # Constant boundary values -- not used in this example
 def waveform(t):
-    return (0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1
+    return -0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1
 Bt2=anuga.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain,waveform)
 #Bw=anuga.Time_boundary(domain=domain,
@@ -72,5 +72,5 @@
 # Associate boundary tags with boundary objects
 #----------------------------------------------
-domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom':Br})
+domain.set_boundary({'left': Br, 'right': Bt2, 'top': Br, 'bottom':Br})
 
 #------------------------------
@@ -78,5 +78,5 @@
 #------------------------------
 
-for t in domain.evolve(yieldstep=0.2,finaltime=40.0):
+for t in domain.evolve(yieldstep=0.200,finaltime=40.00):
     print domain.timestepping_statistics()
     xx = domain.quantities['xmomentum'].centroid_values
@@ -84,5 +84,5 @@
     dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values 
     dd_raw=1.0*dd
-    dd = (dd)*(dd>1.0e-03)+1.0e-03
+    dd = dd*(dd>1.0e-03)+1.0e-03*(dd<=1.0e-03)
     vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5
     vv = vv*(dd>1.0e-03)
Index: trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py	(revision 8751)
@@ -15,5 +15,6 @@
 #------------------
 #v=(p.y==0.5)
-v=(p2.y==p2.y[80])
+myind=(abs(p2.y-0.5)).argmin()
+v=(p2.y==p2.y[myind])
 
 #--------------------
Index: trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py	(revision 8607)
+++ trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py	(revision 8751)
@@ -29,18 +29,16 @@
 # Setup computational domain
 #------------------------------------------------------------------------------
-points, vertices, boundary = rectangular_cross(10, 10,
-                                len1=100.0, len2=100.0) # Mesh
+points, vertices, boundary = rectangular_cross(14, 10,
+                                len1=140.0, len2=100.0) # Mesh
 domain = Domain(points, vertices, boundary) # Create domain
 domain.set_name('channel_SU_2_v2') # Output name
-#domain.set_store_vertices_uniquely(True)
-#domain.CFL=1.0
 #------------------------------------------------------------------------------
 # Setup initial conditions
 #------------------------------------------------------------------------------
 def topography(x, y):
-	return -x/10. #+ numpy.sin(x/10.) +abs(y-50.)/100. # linear bed slope
+	return -x/10. + 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope
 
 def stagetopo(x,y):
-    stg= -x/10. +0.06309625 # Constant depth
+    stg= topography(x,y) + 0.163 #-x/10. +0.06309625 -50.*(x>80.)# Constant depth
     #topo=topography(x,y)
     return stg#*(stg>topo) + topo*(stg<=topo)
@@ -68,5 +66,5 @@
 #Bo = anuga.Transmissive_boundary(domain)
 #Bd = anuga.Dirichlet_boundary([-20., 0., 0.])
-domain.set_boundary({'left': Br, 'right': Bo, 'top': Br, 'bottom': Br})
+domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
 
 
Index: trunk/anuga_work/development/gareth/tests/wave_runup/Shoreline.csv
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/Shoreline.csv	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/Shoreline.csv	(revision 8751)
@@ -0,0 +1,499 @@
+t (sec),x (m),u (m/sec)
+0.702689767,-0.0138,-0.011018718
+1.427282657,-0.0139,-0.000550481
+2.140936123,-0.0139,-0.000813815
+2.854513912,-0.0139,-0.001151387
+3.568287317,-0.0139,-0.001297061
+4.281855825,-0.01395,-0.001643738
+4.995551412,-0.01395,-0.001865751
+5.709170609,-0.01395,-0.002162703
+6.422829072,-0.014,-0.002421134
+7.136474684,-0.01405,-0.002692173
+7.850116013,-0.01405,-0.002967413
+8.563759483,-0.0141,-0.003240552
+9.277400098,-0.01415,-0.003516493
+9.991039285,-0.01415,-0.003793834
+10.70467562,-0.0142,-0.004073977
+11.41830981,-0.01425,-0.004356221
+12.13194185,-0.0143,-0.004640566
+12.84557247,-0.01435,-0.004926312
+13.55920167,-0.0144,-0.005213458
+14.27283014,-0.0145,-0.005501305
+14.98645719,-0.01455,-0.005790553
+15.70008353,-0.0146,-0.0060805
+16.41370987,-0.01465,-0.006370448
+17.12733477,-0.01475,-0.006661797
+17.84095968,-0.0148,-0.006953145
+18.55458388,-0.0149,-0.007245194
+19.26821021,-0.01495,-0.007535142
+19.98183441,-0.01505,-0.007827191
+20.69545218,-0.0151,-0.008125543
+21.40907423,-0.0152,-0.008419693
+22.12269557,-0.01525,-0.008714543
+22.83631619,-0.01535,-0.009010094
+23.54992254,-0.01545,-0.009319652
+24.26355673,-0.0155,-0.009601896
+24.9771488,-0.0156,-0.009925461
+25.69076585,-0.0157,-0.010224513
+26.40437863,-0.01575,-0.010527768
+27.11802424,-0.01585,-0.010798806
+27.83170983,-0.0159,-0.011030624
+28.54536401,-0.016,-0.011293258
+29.25890824,-0.0161,-0.011663747
+29.97265095,-0.01615,-0.011839537
+30.6862423,-0.01625,-0.012163802
+31.39983509,-0.0163,-0.012486667
+32.11345643,-0.0164,-0.012781517
+32.82718628,-0.01645,-0.012969913
+33.54091685,-0.0165,-0.013157609
+34.25499153,-0.01655,-0.013007732
+34.96840226,-0.0166,-0.013509188
+35.68217424,-0.01665,-0.013656263
+36.39600475,-0.0167,-0.013745909
+37.10997163,-0.01675,-0.013701786
+37.82358512,-0.01675,-0.014004341
+38.53655179,-0.01675,-0.014941418
+39.25010959,-0.01675,-0.0152986
+39.96366096,-0.0167,-0.015662086
+40.67647272,-0.0167,-0.016751141
+41.39059309,-0.01665,-0.016556442
+42.10453855,-0.0166,-0.01653333
+42.81815346,-0.0165,-0.016834484
+43.53002783,-0.01635,-0.018843108
+44.24529833,-0.01625,-0.017520133
+44.95895037,-0.0161,-0.017784868
+45.67199843,-0.01595,-0.018642105
+46.38576969,-0.01575,-0.018789881
+47.09940602,-0.0155,-0.019070023
+47.8134857,-0.01525,-0.018915245
+48.52722412,-0.01495,-0.019095236
+49.24051634,-0.01455,-0.019712951
+49.9541898,-0.0142,-0.019956676
+50.66812312,-0.01375,-0.01994547
+51.3818751,-0.01325,-0.020112155
+52.09558283,-0.0127,-0.020322262
+52.80934552,-0.0121,-0.020478442
+53.52365294,-0.01145,-0.020100249
+54.23707724,-0.0107,-0.020588398
+54.95069644,-0.0099,-0.020885349
+55.66448983,-0.009,-0.021011413
+56.37916135,-0.008,-0.020276038
+57.09306326,-0.0069,-0.020295648
+57.80699587,-0.00575,-0.020285143
+58.52024954,-0.0044,-0.020940677
+59.23351534,-0.003,-0.021584305
+59.94697676,-0.0014,-0.022036036
+60.6611214,0.00025,-0.021817524
+61.37740282,0.00205,-0.019502844
+62.09020886,0.0041,-0.020597502
+62.83641431,0.00615,0.011072646
+63.55153274,0.00855,0.012246444
+64.26658692,0.01115,0.013357211
+64.98081795,0.01395,0.013660465
+65.6861478,0.0169,0.005231668
+66.4013162,0.02025,0.006454491
+67.08970826,0.024,-0.018590279
+67.80376723,0.02785,-0.01845581
+68.52115879,0.032,-0.015052075
+69.21927018,0.03695,-0.030562183
+70.01092461,0.04245,0.045693398
+70.66306156,0.04685,-0.014917606
+71.38235073,0.05255,-0.009652322
+72.10048548,0.05875,-0.005519514
+72.77587487,0.06645,-0.043319888
+73.5303868,0.0728,-0.003501085
+74.24744639,0.08065,-0.000423016
+74.96664846,0.08915,0.004756825
+75.68079738,0.09835,0.004979539
+76.39768206,0.10825,0.007886021
+77.11624374,0.119,0.012437642
+79.26774948,0.1565,0.021992614
+79.98561008,0.17105,0.025856484
+80.70451373,0.18675,0.030743576
+81.42294762,0.2037,0.035169832
+82.14186911,0.222,0.040074433
+82.86123681,0.2417,0.045416757
+83.5811378,0.26295,0.051282248
+84.30125369,0.2859,0.057358546
+85.02247616,0.31065,0.064520398
+85.70964383,0.3355,0.038274516
+86.42709822,0.3638,0.041739882
+87.14249651,0.3942,0.043188221
+87.8594847,0.427,0.046196255
+88.57839549,0.46235,0.05109035
+89.29630964,0.50035,0.055006747
+90.01152374,0.54105,0.056274393
+90.729218,0.585,0.05997508
+91.4539958,0.63265,0.07062471
+92.17356982,0.6836,0.076169437
+92.89360575,0.73835,0.082167296
+93.60972438,0.79685,0.084322294
+94.32996164,0.86005,0.090517653
+95.05200583,0.92815,0.098485616
+95.77298199,1.0012,0.105405845
+96.49483056,1.0797,0.11318191
+97.21738449,1.16405,0.121649927
+97.94036749,1.2547,0.13053886
+98.664028,1.352,0.140092431
+99.38838601,1.45655,0.150330251
+100.1134487,1.56885,0.161259323
+100.8392873,1.6894,0.172949684
+101.5659485,1.8188,0.185446856
+102.2934799,1.95765,0.198797764
+103.0219394,2.1067,0.213059135
+103.7513833,2.26665,0.228286299
+104.4818739,2.43825,0.244540187
+105.2134725,2.62225,0.261881029
+105.9462477,2.81965,0.280376059
+106.6802665,3.03125,0.300091111
+107.4156061,3.2581,0.321101824
+108.152347,3.5013,0.343487338
+108.8905587,3.7619,0.367315588
+109.6303296,4.0411,0.392673417
+110.3717332,4.34015,0.419632964
+111.1148845,4.66045,0.448306984
+111.8598663,5.0034,0.47877672
+112.6068142,5.37055,0.511175239
+113.3556412,5.76345,0.545417099
+114.1067213,6.1839,0.581869285
+114.8600181,6.63365,0.62049608
+115.6106677,7.11135,0.656525951
+116.3683852,7.62515,0.699489358
+117.128742,8.1744,0.745041984
+117.891686,8.7612,0.793132705
+118.6571681,9.3878,0.843713195
+119.4264189,10.05775,0.89799087
+120.1963351,10.7707,0.952921278
+120.9711831,11.53325,1.012689753
+121.7548623,12.3528,1.081121645
+122.5366097,13.221,1.147658371
+123.3219809,14.14665,1.21775011
+124.1047684,15.125,1.285307256
+124.8992214,16.1775,1.364308237
+125.6947981,17.29425,1.444411581
+126.4942686,18.4825,1.528334671
+127.2990499,19.7483,1.617467719
+128.1074101,21.093,1.710111656
+128.9200081,22.5217,1.806912914
+129.7369176,24.0388,1.907943628
+130.558209,25.64875,2.013273133
+131.3839268,27.3562,2.122944853
+132.214118,29.1657,2.23700501
+133.048802,31.0821,2.355472515
+133.8879965,33.1101,2.478364875
+134.7316701,35.25445,2.605651277
+135.5798064,37.51995,2.73731561
+136.4323356,39.9113,2.873289241
+137.2891925,42.43315,3.013508436
+138.1502487,45.08985,3.157847132
+139.0153793,47.8857,3.306182766
+139.8844007,50.82475,3.458335346
+140.7571302,53.9107,3.61412558
+141.6333009,57.1468,3.773291536
+142.5126542,60.53605,3.935579684
+143.3948546,64.08065,4.100660856
+144.2795723,67.78255,4.268211487
+145.1663169,71.6424,4.437750432
+146.0547291,75.66095,4.608925412
+146.9442801,79.8374,4.78121746
+147.8344022,84.1702,4.954069795
+148.7246828,88.6577,5.127077608
+149.6141024,93.2944,5.299240791
+150.5021884,98.07645,5.470095707
+151.3880891,102.99715,5.63880683
+152.2710577,108.04935,5.804641587
+153.1501055,113.22325,5.966629982
+154.0244528,118.50915,6.124007226
+154.8928867,123.89355,6.275583412
+155.7545483,129.36395,6.42051601
+156.608491,134.90595,6.557876348
+157.453521,140.50255,6.686493428
+158.2887111,146.13735,6.805457485
+159.1120173,151.78515,6.912763399
+159.9229383,157.4302,7.007919517
+160.7200436,163.0496,7.089522325
+161.5018837,168.6194,7.156150097
+162.2673201,174.11725,7.206685765
+163.0148556,179.51785,7.239660678
+163.7432729,184.7976,7.253880729
+164.4511786,189.9318,7.247978819
+165.1373468,194.89705,7.220752437
+165.800546,199.6707,7.170993466
+166.439334,204.2293,7.097287184
+167.0526836,208.55365,6.998625779
+167.6393168,212.6242,6.873755609
+168.1983248,216.42575,6.721785122
+168.7284675,219.94315,6.541497797
+169.2291024,223.1674,6.332263312
+169.6994048,226.09105,6.093272755
+170.1386524,228.71005,5.823817364
+170.5463318,231.02485,5.523393583
+170.9219475,233.039,5.191515364
+171.265561,234.7623,4.828242938
+171.5768624,236.2057,4.433272349
+171.8562186,237.3864,4.006963582
+172.1035925,238.32275,3.549280217
+172.3200486,239.0399,3.061266487
+172.5058254,239.56215,2.543156312
+172.6620408,239.9183,1.99604645
+172.7900563,240.13865,1.421272482
+172.8911733,240.25345,0.820111161
+172.9670239,240.2933,0.194163501
+173.019413,240.28775,-0.454799995
+173.0504143,240.26445,-1.124744788
+173.0627673,240.24735,-1.812983609
+173.058533,240.25725,-2.517494527
+173.0402773,240.31045,-3.235760458
+173.011694,240.41385,-3.964157756
+172.9752105,240.5722,-4.700305205
+172.934462,240.7789,-5.440636587
+172.8927539,241.02125,-6.181909249
+172.8538602,241.27575,-6.920421103
+172.8212596,241.5127,-7.65275931
+172.7985684,241.6938,-8.37537656
+172.7897828,241.7696,-9.084352254
+172.7990388,241.68115,-9.775629225
+172.8297132,241.3696,-10.44589478
+172.8854277,240.76805,-11.09159601
+172.9707949,239.7931,-11.70820791
+173.0886634,238.37655,-12.29293606
+173.2426156,236.43945,-12.84226605
+173.436262,233.9008,-13.35265619
+173.6727464,230.6851,-13.8210221
+173.9547192,226.72545,-14.24476406
+174.2849266,221.9567,-14.62118779
+174.6660353,216.3192,-14.94767746
+175.0998949,209.77125,-15.22241845
+175.5881825,202.2811,-15.44376561
+176.1323695,193.8282,-15.61027551
+176.7337344,184.4042,-15.72069381
+177.3925908,174.0253,-15.77471305
+178.1091121,162.71995,-15.77216305
+178.8837038,150.52265,-15.71264601
+179.7152322,137.50175,-15.59727408
+180.6030683,123.7264,-15.42666429
+181.5457572,109.28645,-15.20224396
+182.5418261,94.2788,-14.92545793
+183.588734,78.82125,-14.59879878
+184.6845263,63.0265,-14.22418407
+185.8261045,47.0254,-13.80465335
+187.0106894,30.9437,-13.34293313
+188.2346307,14.9167,-12.84260432
+189.4945772,-0.9288,-12.3069544
+190.786698,-16.4662,-11.73974149
+192.1069802,-31.57485,-11.14490229
+193.4511916,-46.1417,-10.52658853
+194.8153815,-60.06785,-9.888675965
+196.1952169,-73.2627,-9.235415079
+197.5863929,-85.64925,-8.57102902
+198.9846061,-97.16445,-7.899739541
+200.3856914,-107.7605,-7.225632525
+201.7857129,-117.4052,-6.552569042
+203.1805107,-126.07855,-5.884630071
+204.5663516,-133.77635,-5.225477781
+205.9397882,-140.50815,-4.578494195
+207.2972778,-146.2939,-3.947154486
+208.6357108,-151.16575,-3.334509409
+209.9523948,-155.16565,-2.74320001
+211.2446034,-158.34245,-2.175900954
+212.5101385,-160.75215,-1.63476864
+213.7470268,-162.45525,-1.121738855
+214.9536904,-163.5154,-0.638359388
+216.1287595,-163.9979,-0.185974225
+217.2712108,-163.96835,0.234413023
+218.3805098,-163.49135,0.622277789
+219.4559339,-162.6295,0.97691131
+220.4942369,-161.44685,1.295129064
+221.5075199,-159.9832,1.588802103
+222.4792033,-158.31465,1.841666034
+223.4239354,-156.4656,2.068090784
+224.3343065,-154.4936,2.260807347
+225.2273707,-152.39885,2.436545853
+226.0670777,-150.30445,2.55994107
+226.8887019,-148.15665,2.665596942
+227.6856122,-145.9985,2.747008552
+228.4576909,-143.85425,2.804060342
+229.2067199,-141.73975,2.838500402
+229.9344584,-139.668,2.852054413
+230.6426617,-137.64915,2.846444553
+231.333207,-135.6905,2.82351206
+232.0078575,-133.79775,2.784986817
+232.6683309,-131.97495,2.732553882
+233.3163885,-130.22435,2.667941037
+233.9537273,-128.54735,2.592813031
+234.5818715,-126.94465,2.508665125
+235.2024695,-125.4158,2.417114445
+235.8168436,-123.9605,2.319458052
+236.4263994,-122.5776,2.217074948
+237.0324941,-121.26575,2.111296514
+237.6360765,-120.024,2.003053522
+238.2383574,-118.85055,1.89353378
+238.8402735,-117.74385,1.783656155
+239.4427615,-116.7022,1.674339517
+240.0463696,-115.7243,1.566121738
+240.6519539,-114.8082,1.459842549
+241.2601204,-113.95205,1.35609655
+241.8712761,-113.1543,1.255282947
+242.48589,-112.413,1.157861874
+243.1042278,-111.72635,1.064093863
+243.7266798,-111.09225,0.97436201
+244.3535283,-110.50865,0.888942957
+244.9843325,-109.97395,0.807404582
+245.620579,-109.48495,0.731205029
+246.2600289,-109.04105,0.658147978
+246.9049431,-108.6384,0.590451461
+247.5539502,-108.27555,0.526770091
+248.209087,-107.94915,0.469101987
+248.867408,-107.65815,0.414557476
+249.5293985,-107.39975,0.3636128
+250.2012504,-107.1694,0.322342157
+250.8726261,-106.9682,0.280604375
+251.5487073,-106.79185,0.243482648
+252.2290449,-106.6381,0.210536449
+252.9135247,-106.50445,0.181653722
+253.6020259,-106.38855,0.156716107
+254.2940583,-106.28815,0.135242458
+254.9897787,-106.20085,0.117386854
+255.6901247,-106.1242,0.104068863
+256.3918007,-106.05635,0.092055638
+257.098215,-105.9946,0.084690682
+257.8079462,-105.93705,0.080579586
+258.5188161,-105.8816,0.07758556
+259.2339902,-105.8259,0.078813986
+259.9510269,-105.7681,0.081869644
+260.672365,-105.706,0.089144953
+261.3960256,-105.63775,0.098698525
+262.1224275,-105.56135,0.110941467
+262.8510719,-105.475,0.125384231
+263.5824378,-105.37675,0.142496757
+264.3165237,-105.26475,0.162277643
+265.0530177,-105.13725,0.184420833
+265.7913207,-104.99265,0.208338728
+266.5315578,-104.8292,0.234153891
+267.2740737,-104.64515,0.262204594
+268.0185086,-104.439,0.292137856
+268.7650267,-104.2091,0.324114761
+269.5132376,-103.95405,0.357752212
+270.2635674,-103.6722,0.393468323
+271.0156327,-103.3622,0.430887002
+271.7694079,-103.0227,0.469983036
+272.5247879,-102.65235,0.510653473
+273.2816558,-102.2499,0.552783455
+274.0401892,-101.814,0.596547369
+274.8001491,-101.3436,0.641710597
+275.5612056,-100.83775,0.687949574
+276.3236513,-100.29515,0.735551445
+277.0871972,-99.71505,0.784232567
+277.8519032,-99.09635,0.834051769
+278.6111841,-98.44395,0.878548957
+279.3842081,-97.7402,0.936528019
+280.1517162,-97.00125,0.989096123
+280.919964,-96.22095,1.042389797
+281.6889086,-95.39865,1.096367019
+282.4584507,-94.53395,1.15093044
+283.2284205,-93.6266,1.205913374
+283.9988486,-92.67615,1.261345939
+284.7696322,-91.68245,1.31712728
+285.540508,-90.64555,1.372998968
+286.3115408,-89.5653,1.429024735
+287.0826528,-88.44175,1.485128241
+287.8536035,-87.2752,1.541073467
+288.6244278,-86.0658,1.596894729
+289.3949031,-84.81405,1.652373517
+290.1649628,-83.52045,1.707444697
+290.9345363,-82.18535,1.762038933
+291.7035787,-80.80945,1.816112104
+292.4718957,-79.39355,1.869473712
+293.2392154,-77.9389,1.921856922
+294.0059247,-76.4454,1.973641326
+294.7715795,-74.9147,2.024391302
+295.5359829,-73.3482,2.073913553
+296.2993595,-71.74635,2.12242869
+297.0614069,-70.11085,2.169639762
+297.8219501,-68.4432,2.215375182
+298.5811018,-66.7444,2.259745605
+299.3386143,-65.01625,2.302508009
+300.0945519,-63.25995,2.343725425
+300.8486562,-61.4775,2.383144324
+301.6008465,-59.6706,2.420685566
+302.3512505,-57.8405,2.456474514
+303.0996127,-55.9893,2.490260441
+303.8457896,-54.1191,2.521902575
+304.5901203,-52.2307,2.551733585
+305.3318959,-50.32765,2.579058017
+306.0715304,-48.4106,2.604282078
+306.8088104,-46.4819,2.627196362
+307.5437301,-44.54345,2.647795265
+308.2761069,-42.5975,2.665899496
+309.0059536,-40.646,2.681521662
+309.7332358,-38.69085,2.694628144
+310.4580807,-36.7336,2.705343608
+311.180232,-34.7769,2.713416624
+311.8996082,-32.8228,2.718767353
+312.6165507,-30.87235,2.721730563
+313.3307625,-28.9282,2.722014908
+314.04215,-26.9925,2.719528641
+314.7510159,-25.0663,2.714568712
+315.4571296,-23.15205,2.706908906
+316.1604798,-21.2516,2.696538018
+316.8612427,-19.36635,2.683629036
+317.5592855,-17.4983,2.668051694
+318.2548096,-15.64875,2.650003491
+318.9476266,-13.8198,2.629299534
+319.6377984,-12.013,2.606000755
+320.3255972,-10.22925,2.580373988
+321.0108052,-8.4707,2.552205626
+321.6935515,-6.73845,2.521622432
+322.374039,-5.0335,2.488823308
+323.0521242,-3.3577,2.453667483
+323.7279148,-1.712,2.41626071
+324.4015494,-0.0975,2.376738858
+325.0731457,1.4849,2.335217487
+325.742631,3.0338,2.29162516
+326.410093,4.54825,2.246048021
+327.0757445,6.0277,2.198694777
+327.7396833,7.47135,2.149661375
+328.4018744,8.87815,2.0989135
+329.0624135,10.24735,2.046544998
+329.7215969,11.57885,1.992846518
+330.3793731,12.87165,1.937767634
+331.035735,14.12505,1.881301343
+331.6910568,15.33915,1.823814632
+332.3452863,16.51325,1.765256374
+332.998457,17.64685,1.705659486
+333.6508538,18.74,1.645303412
+334.3024839,19.7923,1.584195154
+334.9535271,20.80365,1.522511202
+335.6040478,21.77385,1.460314589
+336.2540815,22.70275,1.397640333
+336.9039153,23.5906,1.334769976
+337.5535022,24.43715,1.271657296
+338.2029898,25.24255,1.208447266
+338.8525873,26.00705,1.145345092
+339.5021848,26.73055,1.082242917
+340.1520751,27.41355,1.019427889
+340.8023573,28.0562,0.956997356
+341.4530757,28.6588,0.894994742
+342.1043188,29.22165,0.833506891
+342.7565157,29.7454,0.772954716
+343.4091339,30.23,0.712815752
+344.0624909,30.6761,0.653401658
+344.716816,31.0843,0.594937248
+345.3720992,31.45505,0.537412717
+346.028372,31.78895,0.480858882
+346.6858583,32.0867,0.425495653
+347.3444648,32.34885,0.371231284
+348.0038988,32.57595,0.31777863
+348.6650869,32.76905,0.266046753
+349.3276785,32.9287,0.215691778
+349.991688,33.05575,0.166727712
+350.6573009,33.15095,0.119336648
+351.3242603,33.21515,0.073266457
+351.9927796,33.24915,0.028726547
+352.6628832,33.25395,-0.014259271
+353.3345494,33.2304,-0.055712007
+354.0077992,33.1794,-0.095611351
+354.6828117,33.102,-0.133781513
+355.3594076,32.99905,-0.170398283
+356.0377276,32.8716,-0.205323691
+356.717714,32.72065,-0.238614465
Index: trunk/anuga_work/development/gareth/tests/wave_runup/initial_condition.txt
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/initial_condition.txt	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/initial_condition.txt	(revision 8751)
@@ -0,0 +1,1015 @@
+Benchmark # 1 -- runup on a uniformly sloping beach: 1-D problem.
+
+Compute the snap shots of water-surface and velocity profiles at t = 160 sec., 175 
+sec, and 220 sec.  
+Also compute the temporal variations of the shoreline location (xs) and shoreline 
+velocity (us) from 
+t = 100 sec. to 280 sec.
+
+Beach slope = 1/10
+
+Initial water surface displacement, and velocity = 0, everywhere at t = 0.
+
+x (m) 	eta (m)
+0	0.001386879
+50	0.001418557
+100	0.001448675
+150	0.001476851
+200	0.001502653
+250	0.001525595
+300	0.001545127
+350	0.001560637
+400	0.001571436
+450	0.001576752
+500	0.001575726
+550	0.0015674
+600	0.001550705
+650	0.001524456
+700	0.001487337
+750	0.001437888
+800	0.001374497
+850	0.001295378
+900	0.001198562
+950	0.00108188
+1000	0.000942942
+1050	0.000779122
+1100	0.000587533
+1150	0.000365013
+1200	0.000108095
+1250	-0.000187012
+1300	-0.000524455
+1350	-0.000908755
+1400	-0.001344846
+1450	-0.001838098
+1500	-0.002394354
+1550	-0.00301996
+1600	-0.003721805
+1650	-0.004507353
+1700	-0.005384687
+1750	-0.006362547
+1800	-0.007450373
+1850	-0.008658349
+1900	-0.009997448
+1950	-0.011479481
+2000	-0.013117144
+2050	-0.014924068
+2100	-0.016914873
+2150	-0.019105216
+2200	-0.021511848
+2250	-0.024152665
+2300	-0.027046767
+2350	-0.030214509
+2400	-0.033677557
+2450	-0.037458945
+2500	-0.041583128
+2550	-0.046076034
+2600	-0.050965122
+2650	-0.056279425
+2700	-0.062049605
+2750	-0.068307999
+2800	-0.075088659
+2850	-0.082427396
+2900	-0.090361815
+2950	-0.098931345
+3000	-0.10817727
+3050	-0.118142745
+3100	-0.128872819
+3150	-0.140414434
+3200	-0.152816431
+3250	-0.166129544
+3300	-0.180406381
+3350	-0.195701401
+3400	-0.212070878
+3450	-0.229572857
+3500	-0.248267096
+3550	-0.268215
+3600	-0.289479539
+3650	-0.312125157
+3700	-0.336217664
+3750	-0.361824121
+3800	-0.389012704
+3850	-0.417852558
+3900	-0.44841364
+3950	-0.480766537
+4000	-0.514982285
+4050	-0.55113216
+4100	-0.589287466
+4150	-0.629519299
+4200	-0.671898307
+4250	-0.716494437
+4300	-0.763376645
+4350	-0.812612645
+4400	-0.8642686
+4450	-0.918408824
+4500	-0.975095469
+4550	-1.034388211
+4600	-1.096343923
+4650	-1.161016343
+4700	-1.228455744
+4750	-1.298708591
+4800	-1.371817204
+4850	-1.447819424
+4900	-1.526748269
+4950	-1.608631608
+5000	-1.693491827
+5050	-1.781345512
+5100	-1.872203133
+5150	-1.966068741
+5200	-2.062939676
+5250	-2.162806291
+5300	-2.265651683
+5350	-2.371451433
+5400	-2.480173427
+5450	-2.59177757
+5500	-2.70621564
+5550	-2.823431106
+5600	-2.94335898
+5650	-3.06592569
+5700	-3.191048978
+5750	-3.318637827
+5800	-3.448592406
+5850	-3.58080405
+5900	-3.715155257
+5950	-3.851519724
+6000	-3.989762401
+6050	-4.129739578
+6100	-4.271298998
+6150	-4.414279999
+6200	-4.558513686
+6250	-4.703823128
+6300	-4.850023589
+6350	-4.996922778
+6400	-5.144321137
+6450	-5.292012151
+6500	-5.439782687
+6550	-5.58741336
+6600	-5.734678926
+6650	-5.881348704
+6700	-6.02718702
+6750	-6.171953678
+6800	-6.315404461
+6850	-6.457291647
+6900	-6.597364561
+6950	-6.735370141
+7000	-6.871053531
+7050	-7.004158697
+7100	-7.13442906
+7150	-7.261608157
+7200	-7.385440311
+7250	-7.505671328
+7300	-7.622049208
+7350	-7.73432487
+7400	-7.842252895
+7450	-7.945592275
+7500	-8.044107177
+7550	-8.137567719
+7600	-8.225750741
+7650	-8.308440589
+7700	-8.385429907
+7750	-8.456520381
+7800	-8.521523565
+7850	-8.580261612
+7900	-8.632568033
+7950	-8.678288437
+8000	-8.717281245
+8050	-8.749418381
+8100	-8.774585933
+8150	-8.792684782
+8200	-8.803631188
+8250	-8.807357334
+8300	-8.803811821
+8350	-8.792960111
+8400	-8.774784909
+8450	-8.74928648
+8500	-8.716482902
+8550	-8.676410242
+8600	-8.629122662
+8650	-8.574692438
+8700	-8.513209897
+8750	-8.444783276
+8800	-8.369538491
+8850	-8.287618787
+8900	-8.199184364
+8950	-8.104411852
+9000	-8.003493726
+9050	-7.896637634
+9100	-7.784065634
+9150	-7.666013357
+9200	-7.542729099
+9250	-7.414472831
+9300	-7.28151516
+9350	-7.144136223
+9400	-7.002624539
+9450	-6.857275816
+9500	-6.708391729
+9550	-6.55627867
+9600	-6.401246492
+9650	-6.243607241
+9700	-6.083673894
+9750	-5.921759116
+9800	-5.758174032
+9850	-5.593227037
+9900	-5.427222643
+9950	-5.26046037
+10000	-5.093233695
+10050	-4.925829065
+10100	-4.758524964
+10150	-4.591591061
+10200	-4.42528743
+10250	-4.259863844
+10300	-4.095559149
+10350	-3.932600726
+10400	-3.77120402
+10450	-3.611572165
+10500	-3.453895679
+10550	-3.298352239
+10600	-3.145106536
+10650	-2.994310197
+10700	-2.846101782
+10750	-2.700606845
+10800	-2.557938053
+10850	-2.418195373
+10900	-2.281466301
+10950	-2.147826147
+11000	-2.01733836
+11050	-1.890054895
+11100	-1.76601661
+11150	-1.645253691
+11200	-1.527786148
+11250	-1.413624219
+11300	-1.302768919
+11350	-1.195212528
+11400	-1.090939108
+11450	-0.989925023
+11500	-0.892139465
+11550	-0.797544971
+11600	-0.706097946
+11650	-0.617749174
+11700	-0.532444323
+11750	-0.450124438
+11800	-0.37072642
+11850	-0.2941835
+11900	-0.220425684
+11950	-0.149380187
+12000	-0.080971874
+12050	-0.015123622
+12100	0.048243274
+12150	0.109208742
+12200	0.167853593
+12250	0.224259202
+12300	0.278507202
+12350	0.330679203
+12400	0.38085653
+12450	0.429119979
+12500	0.475549594
+12550	0.520224462
+12600	0.563222526
+12650	0.604620415
+12700	0.644493293
+12750	0.682914725
+12800	0.719956554
+12850	0.755688801
+12900	0.790179575
+12950	0.823494994
+13000	0.855699125
+13050	0.886853934
+13100	0.917019246
+13150	0.946252721
+13200	0.974609831
+13250	1.002143855
+13300	1.028905882
+13350	1.054944815
+13400	1.08030739
+13450	1.105038199
+13500	1.129179719
+13550	1.152772344
+13600	1.175854426
+13650	1.19846232
+13700	1.220630429
+13750	1.242391253
+13800	1.263775447
+13850	1.284811872
+13900	1.305527654
+13950	1.325948243
+14000	1.346097472
+14050	1.365997618
+14100	1.385669461
+14150	1.40513235
+14200	1.424404255
+14250	1.443501836
+14300	1.462440499
+14350	1.481234451
+14400	1.499896764
+14450	1.518439428
+14500	1.536873406
+14550	1.555208689
+14600	1.573454347
+14650	1.591618579
+14700	1.609708764
+14750	1.627731507
+14800	1.645692682
+14850	1.663597478
+14900	1.681450441
+14950	1.699255512
+15000	1.717016065
+15050	1.734734946
+15100	1.752414505
+15150	1.770056627
+15200	1.787662769
+15250	1.805233984
+15300	1.82277095
+15350	1.840273998
+15400	1.857743134
+15450	1.875178066
+15500	1.892578223
+15550	1.909942775
+15600	1.927270656
+15650	1.944560578
+15700	1.961811051
+15750	1.979020396
+15800	1.996186764
+15850	2.013308145
+15900	2.030382385
+15950	2.047407193
+16000	2.064380161
+16050	2.081298763
+16100	2.098160374
+16150	2.114962276
+16200	2.131701664
+16250	2.148375657
+16300	2.164981307
+16350	2.181515598
+16400	2.197975461
+16450	2.214357776
+16500	2.230659377
+16550	2.246877059
+16600	2.26300758
+16650	2.27904767
+16700	2.294994031
+16750	2.310843342
+16800	2.326592264
+16850	2.342237442
+16900	2.35777551
+16950	2.373203091
+17000	2.388516803
+17050	2.403713262
+17100	2.41878908
+17150	2.433740874
+17200	2.448565264
+17250	2.463258875
+17300	2.477818341
+17350	2.492240309
+17400	2.506521436
+17450	2.520658395
+17500	2.534647874
+17550	2.54848658
+17600	2.562171241
+17650	2.575698605
+17700	2.589065444
+17750	2.602268555
+17800	2.615304762
+17850	2.628170916
+17900	2.640863898
+17950	2.65338062
+18000	2.665718025
+18050	2.677873093
+18100	2.689842836
+18150	2.701624304
+18200	2.713214585
+18250	2.724610805
+18300	2.735810131
+18350	2.746809772
+18400	2.757606981
+18450	2.768199051
+18500	2.778583325
+18550	2.788757189
+18600	2.798718078
+18650	2.808463476
+18700	2.817990916
+18750	2.827297982
+18800	2.83638231
+18850	2.845241588
+18900	2.853873559
+18950	2.862276021
+19000	2.870446825
+19050	2.878383883
+19100	2.886085162
+19150	2.893548687
+19200	2.900772544
+19250	2.907754877
+19300	2.914493892
+19350	2.920987859
+19400	2.927235105
+19450	2.933234026
+19500	2.938983077
+19550	2.944480781
+19600	2.949725724
+19650	2.954716558
+19700	2.959452001
+19750	2.963930838
+19800	2.968151923
+19850	2.972114175
+19900	2.975816582
+19950	2.979258201
+20000	2.982438159
+20050	2.985355651
+20100	2.98800994
+20150	2.990400364
+20200	2.992526325
+20250	2.9943873
+20300	2.995982835
+20350	2.997312547
+20400	2.998376124
+20450	2.999173324
+20500	2.999703978
+20550	2.999967986
+20600	2.999965321
+20650	2.999696026
+20700	2.999160217
+20750	2.998358077
+20800	2.997289863
+20850	2.995955903
+20900	2.994356594
+20950	2.992492403
+21000	2.990363869
+21050	2.987971598
+21100	2.985316269
+21150	2.982398627
+21200	2.979219488
+21250	2.975779735
+21300	2.972080318
+21350	2.968122258
+21400	2.96390664
+21450	2.959434617
+21500	2.954707406
+21550	2.949726292
+21600	2.944492623
+21650	2.939007812
+21700	2.933273336
+21750	2.927290733
+21800	2.921061605
+21850	2.914587616
+21900	2.907870488
+21950	2.900912004
+22000	2.893714009
+22050	2.886278402
+22100	2.878607142
+22150	2.870702244
+22200	2.862565779
+22250	2.854199872
+22300	2.845606703
+22350	2.836788504
+22400	2.827747559
+22450	2.818486204
+22500	2.809006824
+22550	2.799311854
+22600	2.789403774
+22650	2.779285116
+22700	2.768958452
+22750	2.758426404
+22800	2.747691633
+22850	2.736756847
+22900	2.72562479
+22950	2.714298252
+23000	2.702780057
+23050	2.691073071
+23100	2.679180194
+23150	2.667104362
+23200	2.654848547
+23250	2.642415751
+23300	2.629809013
+23350	2.617031396
+23400	2.604085999
+23450	2.590975945
+23500	2.577704385
+23550	2.564274497
+23600	2.550689483
+23650	2.536952567
+23700	2.523066996
+23750	2.509036039
+23800	2.494862982
+23850	2.480551132
+23900	2.466103811
+23950	2.451524357
+24000	2.436816124
+24050	2.421982477
+24100	2.407026795
+24150	2.391952467
+24200	2.376762891
+24250	2.361461475
+24300	2.346051632
+24350	2.330536781
+24400	2.314920348
+24450	2.299205759
+24500	2.283396444
+24550	2.267495835
+24600	2.251507362
+24650	2.235434454
+24700	2.219280538
+24750	2.203049036
+24800	2.186743366
+24850	2.17036694
+24900	2.153923164
+24950	2.137415433
+25000	2.120847134
+25050	2.104221643
+25100	2.087542326
+25150	2.070812535
+25200	2.054035608
+25250	2.037214869
+25300	2.020353625
+25350	2.003455168
+25400	1.986522771
+25450	1.969559689
+25500	1.952569155
+25550	1.935554385
+25600	1.918518571
+25650	1.901464882
+25700	1.884396465
+25750	1.867316442
+25800	1.85022791
+25850	1.83313394
+25900	1.816037576
+25950	1.798941834
+26000	1.781849703
+26050	1.764764141
+26100	1.747688077
+26150	1.73062441
+26200	1.713576006
+26250	1.696545701
+26300	1.679536296
+26350	1.662550559
+26400	1.645591227
+26450	1.628660998
+26500	1.611762539
+26550	1.594898478
+26600	1.578071408
+26650	1.561283886
+26700	1.544538431
+26750	1.527837523
+26800	1.511183606
+26850	1.494579083
+26900	1.478026321
+26950	1.461527644
+27000	1.44508534
+27050	1.428701653
+27100	1.412378788
+27150	1.396118911
+27200	1.379924144
+27250	1.363796569
+27300	1.347738226
+27350	1.331751115
+27400	1.31583719
+27450	1.299998367
+27500	1.284236516
+27550	1.268553468
+27600	1.252951008
+27650	1.23743088
+27700	1.221994785
+27750	1.206644381
+27800	1.191381282
+27850	1.176207061
+27900	1.161123246
+27950	1.146131323
+28000	1.131232734
+28050	1.116428881
+28100	1.101721119
+28150	1.087110763
+28200	1.072599084
+28250	1.058187312
+28300	1.043876633
+28350	1.029668191
+28400	1.015563088
+28450	1.001562384
+28500	0.987667098
+28550	0.973878206
+28600	0.960196644
+28650	0.946623306
+28700	0.933159047
+28750	0.919804678
+28800	0.906560973
+28850	0.893428665
+28900	0.880408447
+28950	0.867500972
+29000	0.854706856
+29050	0.842026675
+29100	0.829460966
+29150	0.817010231
+29200	0.80467493
+29250	0.79245549
+29300	0.7803523
+29350	0.76836571
+29400	0.756496039
+29450	0.744743567
+29500	0.733108539
+29550	0.721591168
+29600	0.710191629
+29650	0.698910068
+29700	0.687746594
+29750	0.676701284
+29800	0.665774186
+29850	0.654965311
+29900	0.644274643
+29950	0.633702133
+30000	0.623247703
+30050	0.612911246
+30100	0.602692623
+30150	0.592591668
+30200	0.582608189
+30250	0.572741963
+30300	0.562992741
+30350	0.553360248
+30400	0.543844184
+30450	0.534444221
+30500	0.525160009
+30550	0.51599117
+30600	0.506937307
+30650	0.497997995
+30700	0.48917279
+30750	0.480461223
+30800	0.471862806
+30850	0.463377028
+30900	0.455003358
+30950	0.446741246
+31000	0.438590122
+31050	0.430549396
+31100	0.422618462
+31150	0.414796694
+31200	0.40708345
+31250	0.399478071
+31300	0.391979882
+31350	0.384588193
+31400	0.377302298
+31450	0.370121476
+31500	0.363044993
+31550	0.356072102
+31600	0.349202042
+31650	0.342434038
+31700	0.335767307
+31750	0.329201052
+31800	0.322734465
+31850	0.316366727
+31900	0.310097012
+31950	0.30392448
+32000	0.297848286
+32050	0.291867575
+32100	0.285981483
+32150	0.28018914
+32200	0.274489668
+32250	0.268882181
+32300	0.263365791
+32350	0.257939599
+32400	0.252602704
+32450	0.247354198
+32500	0.242193171
+32550	0.237118706
+32600	0.232129885
+32650	0.227225784
+32700	0.222405478
+32750	0.217668039
+32800	0.213012537
+32850	0.208438039
+32900	0.203943613
+32950	0.199528323
+33000	0.195191234
+33050	0.190931411
+33100	0.186747918
+33150	0.18263982
+33200	0.178606182
+33250	0.17464607
+33300	0.170758552
+33350	0.166942696
+33400	0.163197575
+33450	0.159522259
+33500	0.155915825
+33550	0.152377351
+33600	0.148905918
+33650	0.14550061
+33700	0.142160514
+33750	0.138884723
+33800	0.13567233
+33850	0.132522435
+33900	0.129434142
+33950	0.126406559
+34000	0.1234388
+34050	0.120529981
+34100	0.117679227
+34150	0.114885667
+34200	0.112148433
+34250	0.109466666
+34300	0.106839512
+34350	0.104266122
+34400	0.101745655
+34450	0.099277274
+34500	0.096860151
+34550	0.094493463
+34600	0.092176394
+34650	0.089908134
+34700	0.087687883
+34750	0.085514845
+34800	0.083388232
+34850	0.081307265
+34900	0.079271169
+34950	0.07727918
+35000	0.07533054
+35050	0.073424497
+35100	0.071560311
+35150	0.069737245
+35200	0.067954573
+35250	0.066211576
+35300	0.064507542
+35350	0.062841768
+35400	0.06121356
+35450	0.05962223
+35500	0.058067099
+35550	0.056547497
+35600	0.05506276
+35650	0.053612234
+35700	0.052195273
+35750	0.05081124
+35800	0.049459503
+35850	0.048139441
+35900	0.046850441
+35950	0.045591897
+36000	0.044363213
+36050	0.043163799
+36100	0.041993075
+36150	0.040850469
+36200	0.039735416
+36250	0.038647359
+36300	0.037585751
+36350	0.036550051
+36400	0.035539728
+36450	0.034554257
+36500	0.033593122
+36550	0.032655815
+36600	0.031741836
+36650	0.030850693
+36700	0.029981899
+36750	0.02913498
+36800	0.028309465
+36850	0.027504892
+36900	0.026720809
+36950	0.025956767
+37000	0.025212329
+37050	0.024487062
+37100	0.023780543
+37150	0.023092354
+37200	0.022422086
+37250	0.021769336
+37300	0.021133708
+37350	0.020514815
+37400	0.019912273
+37450	0.01932571
+37500	0.018754757
+37550	0.018199053
+37600	0.017658243
+37650	0.017131981
+37700	0.016619923
+37750	0.016121737
+37800	0.015637093
+37850	0.015165668
+37900	0.014707148
+37950	0.014261223
+38000	0.013827587
+38050	0.013405945
+38100	0.012996004
+38150	0.012597478
+38200	0.012210087
+38250	0.011833556
+38300	0.011467616
+38350	0.011112004
+38400	0.010766462
+38450	0.010430738
+38500	0.010104584
+38550	0.009787757
+38600	0.009480021
+38650	0.009181144
+38700	0.0088909
+38750	0.008609065
+38800	0.008335422
+38850	0.00806976
+38900	0.00781187
+38950	0.007561549
+39000	0.007318599
+39050	0.007082824
+39100	0.006854036
+39150	0.006632048
+39200	0.00641668
+39250	0.006207753
+39300	0.006005094
+39350	0.005808536
+39400	0.005617911
+39450	0.005433059
+39500	0.005253823
+39550	0.005080047
+39600	0.004911583
+39650	0.004748283
+39700	0.004590004
+39750	0.004436607
+39800	0.004287955
+39850	0.004143915
+39900	0.004004358
+39950	0.003869157
+40000	0.003738188
+40050	0.003611331
+40100	0.003488469
+40150	0.003369488
+40200	0.003254275
+40250	0.003142722
+40300	0.003034723
+40350	0.002930175
+40400	0.002828977
+40450	0.002731032
+40500	0.002636243
+40550	0.002544518
+40600	0.002455766
+40650	0.002369899
+40700	0.002286831
+40750	0.002206478
+40800	0.00212876
+40850	0.002053596
+40900	0.00198091
+40950	0.001910627
+41000	0.001842674
+41050	0.00177698
+41100	0.001713475
+41150	0.001652093
+41200	0.001592769
+41250	0.001535438
+41300	0.001480039
+41350	0.001426512
+41400	0.001374799
+41450	0.001324842
+41500	0.001276588
+41550	0.001229981
+41600	0.001184971
+41650	0.001141507
+41700	0.001099538
+41750	0.001059019
+41800	0.001019903
+41850	0.000982143
+41900	0.000945698
+41950	0.000910524
+42000	0.000876581
+42050	0.000843827
+42100	0.000812226
+42150	0.000781738
+42200	0.000752328
+42250	0.00072396
+42300	0.0006966
+42350	0.000670214
+42400	0.00064477
+42450	0.000620238
+42500	0.000596585
+42550	0.000573784
+42600	0.000551804
+42650	0.00053062
+42700	0.000510204
+42750	0.000490529
+42800	0.000471572
+42850	0.000453306
+42900	0.00043571
+42950	0.000418759
+43000	0.000402432
+43050	0.000386707
+43100	0.000371563
+43150	0.000356981
+43200	0.000342941
+43250	0.000329423
+43300	0.000316411
+43350	0.000303885
+43400	0.000291829
+43450	0.000280227
+43500	0.000269061
+43550	0.000258318
+43600	0.000247982
+43650	0.000238038
+43700	0.000228473
+43750	0.000219272
+43800	0.000210423
+43850	0.000201914
+43900	0.000193731
+43950	0.000185863
+44000	0.0001783
+44050	0.000171028
+44100	0.000164039
+44150	0.000157321
+44200	0.000150865
+44250	0.000144661
+44300	0.0001387
+44350	0.000132973
+44400	0.00012747
+44450	0.000122185
+44500	0.000117109
+44550	0.000112233
+44600	0.000107551
+44650	0.000103055
+44700	9.87377E-05
+44750	9.45932E-05
+44800	9.06147E-05
+44850	8.67957E-05
+44900	8.31303E-05
+44950	7.96127E-05
+45000	7.62371E-05
+45050	7.29981E-05
+45100	6.98906E-05
+45150	6.69094E-05
+45200	6.40496E-05
+45250	6.13066E-05
+45300	5.86759E-05
+45350	5.61531E-05
+45400	5.3734E-05
+45450	5.14145E-05
+45500	4.91908E-05
+45550	4.7059E-05
+45600	4.50157E-05
+45650	4.30572E-05
+45700	4.11803E-05
+45750	3.93817E-05
+45800	3.76583E-05
+45850	3.60072E-05
+45900	3.44253E-05
+45950	3.29101E-05
+46000	3.14587E-05
+46050	3.00687E-05
+46100	2.87375E-05
+46150	2.74628E-05
+46200	2.62423E-05
+46250	2.50739E-05
+46300	2.39553E-05
+46350	2.28846E-05
+46400	2.18598E-05
+46450	2.08791E-05
+46500	1.99405E-05
+46550	1.90425E-05
+46600	1.81833E-05
+46650	1.73613E-05
+46700	1.6575E-05
+46750	1.5823E-05
+46800	1.51037E-05
+46850	1.44158E-05
+46900	1.3758E-05
+46950	1.3129E-05
+47000	1.25278E-05
+47050	1.19529E-05
+47100	1.14035E-05
+47150	1.08783E-05
+47200	1.03764E-05
+47250	9.89677E-06
+47300	9.43847E-06
+47350	9.0006E-06
+47400	8.58228E-06
+47450	8.18267E-06
+47500	7.80097E-06
+47550	7.43642E-06
+47600	7.08828E-06
+47650	6.75583E-06
+47700	6.4384E-06
+47750	6.13535E-06
+47800	5.84603E-06
+47850	5.56987E-06
+47900	5.30628E-06
+47950	5.05471E-06
+48000	4.81464E-06
+48050	4.58557E-06
+48100	4.36701E-06
+48150	4.15849E-06
+48200	3.95958E-06
+48250	3.76985E-06
+48300	3.58889E-06
+48350	3.41631E-06
+48400	3.25175E-06
+48450	3.09483E-06
+48500	2.94523E-06
+48550	2.80261E-06
+48600	2.66665E-06
+48650	2.53707E-06
+48700	2.41357E-06
+48750	2.29588E-06
+48800	2.18373E-06
+48850	2.07688E-06
+48900	1.97507E-06
+48950	1.8781E-06
+49000	1.78572E-06
+49050	1.69774E-06
+49100	1.61395E-06
+49150	1.53415E-06
+49200	1.45818E-06
+49250	1.38584E-06
+49300	1.31697E-06
+49350	1.25142E-06
+49400	1.18902E-06
+49450	1.12963E-06
+49500	1.07312E-06
+49550	1.01934E-06
+49600	9.68169E-07
+49650	9.19486E-07
+49700	8.73173E-07
+49750	8.29119E-07
+49800	7.87218E-07
+49850	7.47368E-07
+49900	7.09472E-07
+49950	6.73438E-07
+50000	6.39177E-07
+
Index: trunk/anuga_work/development/gareth/tests/wave_runup/plotme.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/plotme.py	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/plotme.py	(revision 8751)
@@ -0,0 +1,78 @@
+#from anuga.utilities import plot_utils as util
+import util
+from matplotlib import pyplot as pyplot
+import numpy
+
+p= util.get_output('runup_v2.sww')
+#p=util.get_output('runup_v2_time_184_8.sww',0.001)
+p2=util.get_centroids(p,velocity_extrapolation=True)
+
+# Find points with x<1km
+v = p2.x<1000.
+
+#pyplot.scatter(p2.x[v], p2.stage[100,v])
+
+# Get analytical solution snapshots
+t160=numpy.genfromtxt('t160.csv',delimiter=',',skip_header=1)
+t175=numpy.genfromtxt('t175.csv',delimiter=',',skip_header=1)
+t220=numpy.genfromtxt('t220.csv',delimiter=',',skip_header=1)
+shoreline=numpy.genfromtxt('Shoreline.csv',delimiter=',',skip_header=1)
+# Offset x by 200m, to reflect how the mesh is set up
+t160[:,0] = t160[:,0]+200.
+t175[:,0] = t175[:,0]+200.
+t220[:,0] = t220[:,0]+200.
+
+# Make plots
+t_wanted=[160., 175., 220.]
+
+pyplot.clf()
+for i,t in enumerate(t_wanted):
+    tmp=abs(p2.time-t)
+    p2_ind=tmp.argmin()
+    pyplot.plot(p2.x[v], p2.stage[p2_ind,v], '-')
+    if(i==0):
+        pyplot.plot(t160[:,0], t160[:,1],'-', color='red')
+    if(i==1):
+        pyplot.plot(t175[:,0], t175[:,1],'-', color='red')
+    if(i==2):
+        pyplot.plot(t220[:,0], t220[:,1],'-',color='red')
+
+    pyplot.plot(p2.x[v], p2.elev[v], '--', color='green')
+    pyplot.title('Time ' + str(round(t,2)))
+    pyplot.ylim((-25,20))
+    pyplot.savefig('figure_stage_'+str(i)+'.png')
+    pyplot.clf()
+
+    pyplot.plot(p2.x[v], p2.xvel[p2_ind,v], '-')
+    if(i==0):
+        pyplot.plot(t160[:,0], t160[:,2],'-',color='red')
+    if(i==1):
+        pyplot.plot(t175[:,0], t175[:,2],'-',color='red')
+    if(i==2):
+        pyplot.plot(t220[:,0], t220[:,2],'-',color='red')
+    pyplot.ylim((-25,20))
+    pyplot.title('Time ' + str(round(t,2)))
+    pyplot.savefig('figure_vel_'+str(i)+'.png')
+    pyplot.clf()
+
+# Plot shoreline position
+model_shore_x=p2.time*0.
+model_shore_u=p2.time*0.
+for i in range(len(model_shore_x)):
+    # Compute index of shoreline
+    vtmp = p2.stage[i,:]>p2.elev+0.002
+    # FIXME -- introduced a bug here
+    model_shore_x[i]=p2.x[vtmp].min()
+    #v_ind=p2.x[vtmp].argmin()
+    # Store x and xvel
+    #model_shore_x[i]=p2.x[vtmp[v_ind]]
+    #model_shore_u[i]=p2.xvel[i,vtmp[v_ind]]
+
+pyplot.plot(p2.time, model_shore_x-200.,'-o')
+pyplot.plot(shoreline[:,0], shoreline[:,1],'-', color='red')
+pyplot.savefig('Shoreline_position.png')
+
+# Can plot velocity as well -- but notice that velocity at the shoreline
+# keeps being set to zero, so the model result is constant zeros
+# pyplot.plot(p2.time, model_shore_u,'-o')
+# pyplot.plot(shoreline[:,0], shoreline[:,2],'-',color='red')
Index: trunk/anuga_work/development/gareth/tests/wave_runup/readme.txt
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/readme.txt	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/readme.txt	(revision 8751)
@@ -0,0 +1,3 @@
+The benchmark solution was downloaded from:
+http://isec.nacse.org/workshop/2004_cornell/bmark1.html
+on 19 August 2012
Index: trunk/anuga_work/development/gareth/tests/wave_runup/runup.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/runup.py	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/runup.py	(revision 8751)
@@ -0,0 +1,77 @@
+"""Runup example from the manual, slightly modified
+"""
+#---------
+#Import Modules
+#--------
+import anuga
+
+import numpy
+import scipy.interpolate
+
+from math import sin, pi, exp
+#from balanced_dev import *
+
+from anuga_tsunami import *
+#---------
+#Setup computational domain
+#---------
+
+# Very inefficient mesh!
+print ' Building mesh'
+dx = dy = 10.
+l1 = 60.*1000.
+l2 = 0.02*1000.
+nx =int(l1/dx)
+ny =int(l2/dy)
+points, vertices, boundary = anuga.rectangular_cross(nx,ny, len1=l1,len2=l2, origin=(-200., 0.))
+
+print 'Creating Domain'
+domain=Domain(points,vertices,boundary)    # Create Domain
+domain.set_name('runup_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})
+#------------------
+# Define topography
+#------------------
+
+# Beach slope of 1/10
+def topography(x,y):
+	return -(x-200.)/10. 
+
+# Define initial condition using file
+initial_prof=scipy.genfromtxt('initial_condition.txt', skip_header=13)
+initial_prof_fun=scipy.interpolate.interp1d(initial_prof[:,0], initial_prof[:,1], fill_value=0., bounds_error=False)
+
+def stagefun(x,y):
+    return initial_prof_fun(x-200.) 
+
+domain.set_quantity('elevation',topography)     # Use function for elevation
+
+domain.set_quantity('friction',0.000)             # Constant friction
+
+domain.set_quantity('stage', stagefun)              
+
+#--------------------------
+# Setup boundary conditions
+#--------------------------
+Br=anuga.Reflective_boundary(domain)            # Solid reflective wall
+
+#----------------------------------------------
+# 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=5.0,finaltime=350.0):
+    print domain.timestepping_statistics()
+    uh=domain.quantities['xmomentum'].centroid_values
+    vh=domain.quantities['ymomentum'].centroid_values
+    depth=domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values
+    depth=depth*(depth>1.0e-06) + 1.0e-06
+    vel=((uh/depth)**2 + (vh/depth)**2)**0.5
+    print 'peak speed is', vel.max()
+
+print 'Finished'
Index: trunk/anuga_work/development/gareth/tests/wave_runup/t160.csv
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/t160.csv	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/t160.csv	(revision 8751)
@@ -0,0 +1,102 @@
+x(m),eta(m),u(m/s)
+815.04,-1.884,-1.058239427
+808.46375,-1.9135,-1.055437999
+801.8875,-1.953,-1.051936214
+795.31125,-2,-1.047033715
+788.735,-2.0525,-1.042131216
+782.15875,-2.1095,-1.035828003
+775.5825,-2.17,-1.02952479
+769.00625,-2.234,-1.021820863
+762.43,-2.301,-1.014817293
+755.85375,-2.37,-1.006413009
+749.2775,-2.4415,-0.998008725
+742.70125,-2.515,-0.988203727
+736.125,-2.5865,-0.9804998
+729.54875,-2.665,-0.968593731
+722.9725,-2.7475,-0.954586591
+716.39625,-2.8335,-0.939879094
+709.82,-2.9225,-0.92447124
+703.24375,-3.013,-0.908363029
+696.6675,-3.1055,-0.891554461
+690.09125,-3.1995,-0.874745893
+683.515,-3.295,-0.857236968
+676.93875,-3.392,-0.839027686
+670.3625,-3.491,-0.820818404
+663.78625,-3.5915,-0.801908765
+657.21,-3.6875,-0.782999126
+650.63375,-3.7935,-0.761988416
+644.0575,-3.902,-0.740277349
+637.48125,-4.013,-0.717165568
+630.905,-4.127,-0.6929332158
+624.32875,-4.244,-0.667440221
+617.7525,-4.365,-0.6404064408
+611.17625,-4.4895,-0.6115517324
+604.6,-4.6185,-0.5806659887
+598.02375,-4.7525,-0.5476091383
+591.4475,-4.891,-0.5123811812
+584.87125,-5.035,-0.4747019746
+578.295,-5.165,-0.4410848386
+571.71875,-5.315,-0.3981529545
+565.1425,-5.48,-0.3506687499
+558.56625,-5.655,-0.2981419749
+551.99,-5.835,-0.2414830936
+545.41375,-6.02,-0.1826531056
+538.8375,-6.205,-0.1228426178
+532.26125,-6.395,-0.0621987052
+525.685,-6.58,-0.0004967632
+519.10875,-6.775,0.0632982657
+512.5325,-6.975,0.1311068304
+505.95625,-7.18,0.2040840298
+499.38,-7.395,0.2795124787
+492.80375,-7.615,0.3627148903
+486.2275,-7.85,0.4534811575
+479.65125,-8.095,0.5504105663
+473.075,-8.345,0.6512619743
+466.49875,-8.595,0.754284489
+459.9225,-8.85,0.860738753
+453.34625,-9.115,0.972795873
+446.77,-9.385,1.091856563
+440.19375,-9.665,1.219321537
+433.6175,-9.95,1.352389367
+427.04125,-10.235,1.488258625
+420.465,-10.525,1.627629668
+413.88875,-10.82,1.773303924
+407.3125,-11.115,1.928082821
+400.73625,-11.415,2.086363503
+394.16,-11.71,2.246745256
+387.58375,-12.005,2.409928437
+381.0075,-12.3,2.579414831
+374.43125,-12.59,2.751702653
+367.855,-12.87,2.923990475
+361.27875,-13.15,3.096978654
+354.7025,-13.415,3.272067904
+348.12625,-13.675,3.446456797
+341.55,-13.92,3.618044262
+334.97375,-14.155,3.788231013
+328.3975,-14.375,3.957717407
+321.82125,-14.585,4.12510273
+315.245,-14.78,4.288986268
+308.66875,-14.965,4.447967307
+302.0925,-15.135,4.604847275
+295.51625,-15.285,4.758225458
+288.94,-15.425,4.906000785
+282.36375,-15.555,5.050274327
+275.7875,-15.67,5.191746441
+269.21125,-15.77,5.327615699
+262.635,-15.845,5.452279245
+256.05875,-15.925,5.581144933
+249.4825,-15.99,5.705808479
+242.90625,-16.045,5.824168812
+236.33,-16.08,5.936926289
+229.75375,-16.1,6.044781267
+223.1775,-16.115,6.150535174
+216.60125,-16.125,6.253487653
+210.025,-16.125,6.353638704
+203.44875,-16.12,6.453789755
+196.8725,-16.095,6.549038307
+190.29625,-16.055,6.635882575
+183.72,-16,6.719225058
+177.14375,-15.945,6.795563971
+170.5675,-15.885,6.867700742
+163.99125,-15.83,6.934234657
+157.415,-15.79,6.986061075
Index: trunk/anuga_work/development/gareth/tests/wave_runup/t175.csv
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/t175.csv	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/t175.csv	(revision 8751)
@@ -0,0 +1,102 @@
+x(m),eta(m),u(m/s)
+804.5,-0.857,-1.891664257
+798.475,-0.8735,-1.900068541
+792.45,-0.8965,-1.911274253
+786.425,-0.922,-1.924581036
+780.4,-0.949,-1.937887819
+774.375,-0.977,-1.951894959
+768.35,-1.006,-1.966602456
+762.325,-1.035,-1.981309953
+756.3,-1.0655,-1.996717807
+750.275,-1.0965,-2.012125661
+744.25,-1.128,-2.028233872
+738.225,-1.1605,-2.044342083
+732.2,-1.1935,-2.060450294
+726.175,-1.227,-2.077258862
+720.15,-1.2615,-2.09406743
+714.125,-1.297,-2.111576355
+708.1,-1.3325,-2.129785637
+702.075,-1.3695,-2.147994919
+696.05,-1.4065,-2.166904558
+690.025,-1.445,-2.185814197
+684,-1.484,-2.205424193
+677.975,-1.5235,-2.223633475
+671.95,-1.5645,-2.243943828
+665.925,-1.6065,-2.264954538
+659.9,-1.649,-2.285965248
+653.875,-1.6935,-2.307676315
+647.85,-1.739,-2.330087739
+641.825,-1.786,-2.35319952
+635.8,-1.829,-2.37421023
+629.775,-1.8785,-2.398022368
+623.75,-1.93,-2.422534863
+617.725,-1.9825,-2.447747715
+611.7,-2.036,-2.472960567
+605.675,-2.0905,-2.498173419
+599.65,-2.1465,-2.524086628
+593.625,-2.202,-2.548599123
+587.6,-2.261,-2.575212689
+581.575,-2.321,-2.601826255
+575.55,-2.3825,-2.628439821
+569.525,-2.446,-2.655753744
+563.5,-2.511,-2.683067667
+557.475,-2.5775,-2.711081947
+551.45,-2.6465,-2.739796584
+545.425,-2.7175,-2.769911935
+539.4,-2.7905,-2.800027286
+533.375,-2.865,-2.831543351
+527.35,-2.9415,-2.863059416
+521.325,-3.0195,-2.895976195
+515.3,-3.1,-2.929593331
+509.275,-3.1735,-2.960409039
+503.25,-3.2595,-2.996827603
+497.225,-3.349,-3.035347238
+491.2,-3.443,-3.075267587
+485.175,-3.5405,-3.115888293
+479.15,-3.6415,-3.157909713
+473.125,-3.746,-3.199230776
+467.1,-3.849,-3.239851482
+461.075,-3.9605,-3.282573259
+455.05,-4.0755,-3.325995393
+449.025,-4.1935,-3.370117884
+443,-4.3155,-3.414940732
+436.975,-4.443,-3.461164294
+430.95,-4.5745,-3.509488927
+424.925,-4.693,-3.552911061
+418.9,-4.8305,-3.604037122
+412.875,-4.976,-3.660065682
+406.85,-5.13,-3.719596027
+400.825,-5.295,-3.7819278
+394.8,-5.465,-3.847061001
+388.775,-5.64,-3.912194202
+382.75,-5.82,-3.97802776
+376.725,-6.015,-4.046662746
+370.7,-6.21,-4.115998089
+364.675,-6.415,-4.18813486
+358.65,-6.63,-4.264473773
+352.625,-6.855,-4.345715185
+346.6,-7.095,-4.434660524
+340.575,-7.335,-4.523605863
+334.55,-7.61,-4.627959056
+328.525,-7.9,-4.735113677
+322.5,-8.205,-4.845069726
+316.475,-8.52,-4.960628631
+310.45,-8.86,-5.088793962
+304.425,-9.225,-5.233767861
+298.4,-9.61,-5.389947472
+292.375,-10.035,-5.558733509
+286.35,-10.485,-5.740826329
+280.325,-10.99,-5.963539855
+274.3,-11.54,-6.215668375
+268.275,-12.145,-6.497912246
+262.25,-12.835,-6.855094316
+256.225,-13.61,-7.27670923
+250.2,-14.52,-7.83699483
+244.175,-15.595,-8.58637682
+238.15,-16.875,-9.63691232
+232.125,-18.285,-11.03062275
+226.1,-19.525,-12.52238316
+220.075,-20.39,-13.79002933
+214.05,-20.94,-14.76352556
+208.025,-21.225,-15.30280045
+202,-21.35,-15.53391826
Index: trunk/anuga_work/development/gareth/tests/wave_runup/t220.csv
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/t220.csv	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/t220.csv	(revision 8751)
@@ -0,0 +1,102 @@
+x(m),eta(m),u(m/s)
+805,0.13185,-3.06266
+795.3,0.14285,-3.06756
+785.6,0.16445,-3.07667
+775.9,0.19475,-3.08857
+766.2,0.2303,-3.10258
+756.5,0.27245,-3.11589
+746.8,0.3241,-3.12920
+737.1,0.3855,-3.14180
+727.4,0.4479,-3.15371
+717.7,0.5035,-3.16491
+708,0.553,-3.17472
+698.3,0.6025,-3.18452
+688.6,0.6565,-3.19363
+678.9,0.715,-3.20343
+669.2,0.778,-3.21254
+659.5,0.843,-3.22024
+649.8,0.9095,-3.22795
+640.1,0.977,-3.23425
+630.4,1.0495,-3.23915
+620.7,1.129,-3.24335
+611,1.2205,-3.24545
+601.3,1.314,-3.24756
+591.6,1.408,-3.24896
+581.9,1.5,-3.25036
+572.2,1.5955,-3.25036
+562.5,1.693,-3.24966
+552.8,1.791,-3.24826
+543.1,1.8895,-3.24545
+533.4,1.991,-3.24125
+523.7,2.0975,-3.23635
+514,2.209,-3.23005
+504.3,2.327,-3.22304
+494.6,2.446,-3.21674
+484.9,2.564,-3.20974
+475.2,2.6795,-3.20063
+465.5,2.7945,-3.19013
+455.8,2.907,-3.17822
+446.1,3.0155,-3.16631
+436.4,3.128,-3.15301
+426.7,3.268,-3.13760
+417,3.4355,-3.11939
+407.3,3.6015,-3.10118
+397.6,3.739,-3.08437
+387.9,3.847,-3.06826
+378.2,3.9745,-3.05005
+368.5,4.1295,-3.02904
+358.8,4.311,-3.00593
+349.1,4.4705,-2.98282
+339.4,4.6165,-2.95901
+329.7,4.762,-2.93310
+320,4.931,-2.90368
+310.3,5.1,-2.87356
+300.6,5.26,-2.84275
+290.9,5.415,-2.80983
+281.2,5.595,-2.77131
+271.5,5.785,-2.72929
+261.8,5.97,-2.68587
+252.1,6.145,-2.64385
+242.4,6.32,-2.60113
+232.7,6.5,-2.55630
+223,6.695,-2.50868
+213.3,6.905,-2.45825
+203.6,7.105,-2.40853
+193.9,7.295,-2.36090
+184.2,7.49,-2.31188
+174.5,7.71,-2.25585
+164.8,7.955,-2.19282
+155.1,8.185,-2.12838
+145.4,8.39,-2.06815
+135.7,8.57,-2.01213
+126,8.74,-1.95610
+116.3,8.915,-1.89727
+106.6,9.115,-1.83213
+96.9,9.335,-1.76000
+87.2,9.58,-1.68296
+77.5,9.825,-1.60522
+67.8,10.075,-1.52258
+58.1,10.325,-1.43573
+48.4,10.56,-1.35099
+38.7,10.765,-1.27185
+29,10.95,-1.19621
+19.3,11.165,-1.11287
+9.6,11.42,-1.01482
+-0.1,11.715,-0.90346
+-9.8,12.005,-0.79000
+-19.5,12.255,-0.68565
+-29.2,12.475,-0.58984
+-38.9,12.69,-0.49445
+-48.6,12.93,-0.38772
+-58.3,13.2,-0.26915
+-68,13.49,-0.14455
+-77.7,13.755,-0.02424
+-87.4,13.995,0.08909
+-97.1,14.235,0.20478
+-106.8,14.515,0.33610
+-116.5,14.83,0.48465
+-126.2,15.14,0.63284
+-135.9,15.39,0.75989
+-145.6,15.575,0.86144
+-155.3,15.7,0.93778
+-165,15.775,0.98120
Index: trunk/anuga_work/development/gareth/tests/wave_runup/util.py
===================================================================
--- trunk/anuga_work/development/gareth/tests/wave_runup/util.py	(revision 8751)
+++ trunk/anuga_work/development/gareth/tests/wave_runup/util.py	(revision 8751)
@@ -0,0 +1,433 @@
+""" Random utilities for reading sww file data and for plotting (in ipython, or
+    in scripts)
+
+    Functionality of note:
+
+    util.get_outputs -- read the data from a single sww file into a single object
+    
+    util.combine_outputs -- read the data from a list of sww files into a single object
+    
+    util.near_transect -- for finding the indices of points 'near' to a given
+                       line, and assigning these points a coordinate along that line. 
+                       This is useful for plotting outputs which are 'almost' along a
+                       transect (e.g. a channel cross-section) -- see example below
+
+    util.sort_sww_filenames -- match sww filenames by a wildcard, and order
+                               them according to their 'time'. This means that
+                               they can be stuck together using 'combine_outputs' correctly
+
+    util.triangle_areas -- compute the areas of every triangle in a get_outputs object [ must be vertex-based]
+
+    util.water_volume -- compute the water volume at every time step in an sww file (needs both vertex and centroid value input). 
+ 
+    Here is an example ipython session which uses some of these functions:
+
+    > import util
+    > from matplotlib import pyplot as pyplot
+    > p=util.get_output('myfile.sww',minimum_allowed_height=0.01)
+    > p2=util.get_centroids(p,velocity_extrapolation=True)
+    > xxx=util.near_transect(p,[95., 85.], [120.,68.],tol=2.) # Could equally well use p2
+    > pyplot.ion() # Interactive plotting
+    > pyplot.scatter(xxx[1],p.vel[140,xxx[0]],color='red') # Plot along the transect
+
+    FIXME: TODO -- Convert to a single function 'get_output', which can either take a
+          single filename, a list of filenames, or a wildcard defining a number of
+          filenames, and ensure that in each case, the output will be as desired.
+
+"""
+from Scientific.IO.NetCDF import NetCDFFile
+import numpy
+
+class combine_outputs:
+    """
+    Read in a list of filenames, and combine all their outputs into a single object.
+    e.g.:
+
+    p = util.combine_outputs(['file1.sww', 'file1_time_10000.sww', 'file1_time_20000.sww'], 0.01)
+    
+    will make an object p which has components p.x,p.y,p.time,p.stage, .... etc,
+    where the values of stage / momentum / velocity from the sww files are concatenated as appropriate.
+
+    This is nice for interactive interrogation of model outputs, or for sticking together outputs in scripts
+   
+    WARNING: It is easy to use lots of memory, if the sww files are large.
+
+    Note: If you want the centroid values, then you could subsequently use:
+
+    p2 = util.get_centroids(p,velocity_extrapolation=False)
+
+    which would make an object p2 that is like p, but holds information at centroids
+    """
+    def __init__(self, filename_list, minimum_allowed_height=1.0e-03):
+        #
+        # Go through the sww files in 'filename_list', and combine them into one object.
+        #
+
+        for i, filename in enumerate(filename_list):
+            print i, filename
+            # Store output from filename
+            p_tmp = get_output(filename, minimum_allowed_height)
+            if(i==0):
+                # Create self
+                p1=p_tmp
+            else:
+                # Append extra data to self
+                # Note that p1.x, p1.y, p1.vols, p1.elev should not change
+                assert (p1.x == p_tmp.x).all()
+                assert (p1.y == p_tmp.y).all()
+                assert (p1.vols ==p_tmp.vols).all()
+                p1.time = numpy.append(p1.time, p_tmp.time)
+                p1.stage = numpy.append(p1.stage, p_tmp.stage, axis=0)
+                p1.xmom = numpy.append(p1.xmom, p_tmp.xmom, axis=0)
+                p1.ymom = numpy.append(p1.ymom, p_tmp.ymom, axis=0)
+                p1.xvel = numpy.append(p1.xvel, p_tmp.xvel, axis=0)
+                p1.yvel = numpy.append(p1.yvel, p_tmp.yvel, axis=0)
+                p1.vel = numpy.append(p1.vel, p_tmp.vel, axis=0)
+
+        self.x, self.y, self.time, self.vols, self.elev, self.stage, self.xmom, \
+                self.ymom, self.xvel, self.yvel, self.vel, self.minimum_allowed_height = \
+                p1.x, p1.y, p1.time, p1.vols, p1.elev, p1.stage, p1.xmom, p1.ymom, p1.xvel,\
+                p1.yvel, p1.vel, p1.minimum_allowed_height
+
+####################
+
+def sort_sww_filenames(sww_wildcard):
+    # Function to take a 'wildcard' sww filename, 
+    # and return a list of all filenames of this type,
+    # sorted by their time.
+    # This can then be used efficiently in 'combine_outputs'
+    # if you have many filenames starting with the same pattern
+    import glob
+    filenames=glob.glob(sww_wildcard)
+    
+    # Extract time from filenames
+    file_time=range(len(filenames)) # Predefine
+     
+    for i,filename in enumerate(filenames):
+        filesplit=filename.rsplit('_time_')
+        if(len(filesplit)>1):
+            file_time[i]=int(filesplit[1].split('_[0-9].sww')[0])
+        else:
+            file_time[i]=0         
+    
+    name_and_time=zip(file_time,filenames)
+    name_and_time.sort() # Sort by file_time
+    
+    output_times, output_names = zip(*name_and_time)
+    
+    return list(output_names)
+
+##############
+
+class get_output:
+    """Read in data from an .sww file in a convenient form
+       e.g. 
+        p = util.get_output('channel3.sww', minimum_allowed_height=0.01)
+        
+       p then contains most relevant information as e.g., p.stage, p.elev, p.xmom, etc 
+    """
+    def __init__(self, filename, minimum_allowed_height=1.0e-03):
+        self.x, self.y, self.time, self.vols, self.stage, \
+                self.elev, self.xmom, self.ymom, \
+                self.xvel, self.yvel, self.vel, self.minimum_allowed_height = \
+                read_output(filename, minimum_allowed_height)
+
+
+def read_output(filename, minimum_allowed_height):
+    # Input: The name of an .sww file to read data from,
+    #                    e.g. read_sww('channel3.sww')
+    #
+    # Purpose: To read the sww file, and output a number of variables as arrays that 
+    #          we can then manipulate (e.g. plot, interrogate)
+    #
+    # Output: x, y, time, stage, elev, xmom, ymom, xvel, yvel, vel
+
+    # Import modules
+
+
+
+    # Open ncdf connection
+    fid=NetCDFFile(filename)
+
+
+    # Read variables
+    x=fid.variables['x']
+    x=x.getValue()
+    y=fid.variables['y']
+    y=y.getValue()
+
+    stage=fid.variables['stage']
+    stage=stage.getValue()
+
+    elev=fid.variables['elevation']
+    elev=elev.getValue()
+
+    xmom=fid.variables['xmomentum']
+    xmom=xmom.getValue()
+
+    ymom=fid.variables['ymomentum']
+    ymom=ymom.getValue()
+
+    time=fid.variables['time']
+    time=time.getValue()
+
+    vols=fid.variables['volumes']
+    vols=vols.getValue()
+
+
+    # Calculate velocity = momentum/depth
+    xvel=xmom*0.0
+    yvel=ymom*0.0
+
+    for i in range(xmom.shape[0]):
+        xvel[i,:]=xmom[i,:]/(stage[i,:]-elev+1.0e-06)*(stage[i,:]> elev+minimum_allowed_height)
+        yvel[i,:]=ymom[i,:]/(stage[i,:]-elev+1.0e-06)*(stage[i,:]> elev+minimum_allowed_height)
+
+    vel = (xvel**2+yvel**2)**0.5
+
+    return x, y, time, vols, stage, elev, xmom, ymom, xvel, yvel, vel, minimum_allowed_height
+
+##############
+
+
+
+class get_centroids:
+    """
+    Extract centroid values from the output of get_output.  
+    e.g.
+        p = util.get_output('my_sww.sww', minimum_allowed_height=0.01) # vertex values
+        pc=util.get_centroids(p, velocity_extrapolation=True) # centroid values
+    """
+    def __init__(self,p, velocity_extrapolation=False):
+        self.time, self.x, self.y, self.stage, self.xmom,\
+             self.ymom, self.elev, self.xvel, \
+             self.yvel, self.vel= \
+             get_centroid_values(p, velocity_extrapolation)
+                                 
+
+def get_centroid_values(p, velocity_extrapolation):
+    # Input: p is the result of e.g. p=util.get_output('mysww.sww'). See the get_output class defined above
+    # Output: Values of x, y, Stage, xmom, ymom, elev, xvel, yvel, vel at centroids
+    #import numpy
+    
+    # Make 3 arrays, each containing one index of a vertex of every triangle.
+    l=len(p.vols)
+    vols0=numpy.zeros(l, dtype='int')
+    vols1=numpy.zeros(l, dtype='int')
+    vols2=numpy.zeros(l, dtype='int')
+
+    # FIXME: 22/2/12/ - I think this loop is slow, should be able to do this
+    # another way
+    for i in range(l):
+        vols0[i]=p.vols[i][0]
+        vols1[i]=p.vols[i][1]
+        vols2[i]=p.vols[i][2]
+
+    # Then use these to compute centroid averages 
+    x_cent=(p.x[vols0]+p.x[vols1]+p.x[vols2])/3.0
+    y_cent=(p.y[vols0]+p.y[vols1]+p.y[vols2])/3.0
+
+    stage_cent=(p.stage[:,vols0]+p.stage[:,vols1]+p.stage[:,vols2])/3.0
+    elev_cent=(p.elev[vols0]+p.elev[vols1]+p.elev[vols2])/3.0
+
+    # Here, we need to treat differently the case of momentum extrapolation or
+    # velocity extrapolation
+    if velocity_extrapolation:
+        xvel_cent=(p.xvel[:,vols0]+p.xvel[:,vols1]+p.xvel[:,vols2])/3.0
+        yvel_cent=(p.yvel[:,vols0]+p.yvel[:,vols1]+p.yvel[:,vols2])/3.0
+        
+        # Now compute momenta
+        xmom_cent=stage_cent*0.0
+        ymom_cent=stage_cent*0.0
+
+        t=len(p.time)
+
+        for i in range(t):
+            xmom_cent[i,:]=xvel_cent[i,:]*(stage_cent[i,:]-elev_cent+1.0e-06)*\
+                                            (stage_cent[i,:]>elev_cent+p.minimum_allowed_height)
+            ymom_cent[i,:]=yvel_cent[i,:]*(stage_cent[i,:]-elev_cent+1.0e-06)*\
+                                            (stage_cent[i,:]>elev_cent+p.minimum_allowed_height)
+
+    else:
+        xmom_cent=(p.xmom[:,vols0]+p.xmom[:,vols1]+p.xmom[:,vols2])/3.0
+        ymom_cent=(p.ymom[:,vols0]+p.ymom[:,vols1]+p.ymom[:,vols2])/3.0
+
+        # Now compute velocities
+        xvel_cent=stage_cent*0.0
+        yvel_cent=stage_cent*0.0
+
+        t=len(p.time)
+
+        for i in range(t):
+            xvel_cent[i,:]=xmom_cent[i,:]/(stage_cent[i,:]-elev_cent+1.0e-06)*(stage_cent[i,:]>elev_cent+p.minimum_allowed_height)
+            yvel_cent[i,:]=ymom_cent[i,:]/(stage_cent[i,:]-elev_cent+1.0e-06)*(stage_cent[i,:]>elev_cent+p.minimum_allowed_height)
+   
+
+    # Compute velocity 
+    vel_cent=(xvel_cent**2 + yvel_cent**2)**0.5
+
+    return p.time, x_cent, y_cent, stage_cent, xmom_cent,\
+             ymom_cent, elev_cent, xvel_cent, yvel_cent, vel_cent
+
+# Make plot of stage over time.
+#pylab.close()
+#pylab.ion()
+#pylab.plot(time, stage[:,1])
+#for i in range(201):
+#    pylab.plot(time,stage[:,i])
+
+# Momentum should be 0. 
+#print 'Momentum max/min is', xmom.max() , xmom.min()
+
+#pylab.gca().set_aspect('equal')
+#pylab.scatter(x,y,c=elev,edgecolors='none')
+#pylab.colorbar()
+#
+#n=xvel.shape[0]-1
+#pylab.quiver(x,y,xvel[n,:],yvel[n,:])
+#pylab.savefig('Plot1.png')
+
+def animate_1D(time, var, x, ylab=' '): #, x=range(var.shape[1]), vmin=var.min(), vmax=var.max()):
+    # Input: time = one-dimensional time vector;
+    #        var =  array with first dimension = len(time) ;
+    #        x = (optional) vector width dimension equal to var.shape[1];
+    
+    import pylab
+    import numpy
+   
+    
+
+    pylab.close()
+    pylab.ion()
+
+    # Initial plot
+    vmin=var.min()
+    vmax=var.max()
+    line, = pylab.plot( (x.min(), x.max()), (vmin, vmax), 'o')
+
+    # Lots of plots
+    for i in range(len(time)):
+        line.set_xdata(x)
+        line.set_ydata(var[i,:])
+        pylab.draw()
+        pylab.xlabel('x')
+        pylab.ylabel(ylab)
+        pylab.title('time = ' + str(time[i]))
+    
+    return
+
+def near_transect(p, point1, point2, tol=1.):
+    # Function to get the indices of points in p less than 'tol' from the line
+    # joining (x1,y1), and (x2,y2)
+    # p comes from util.get_output('mysww.sww')
+    #
+    # e.g.
+    # import util
+    # from matplotlib import pyplot
+    # p=util.get_output('merewether_1m.sww',0.01)
+    # p2=util.get_centroids(p,velocity_extrapolation=True)
+    # #xxx=transect_interpolate.near_transect(p,[95., 85.], [120.,68.],tol=2.)
+    # xxx=util.near_transect(p,[95., 85.], [120.,68.],tol=2.)
+    # pyplot.scatter(xxx[1],p.vel[140,xxx[0]],color='red')
+
+    x1=point1[0]
+    y1=point1[1]
+
+    x2=point2[0]
+    y2=point2[1]
+
+    # Find line equation a*x + b*y + c = 0
+    # based on y=gradient*x +intercept
+    if x1!=x2:
+        gradient= (y2-y1)/(x2-x1)
+        intercept = y1 - gradient*x1
+
+        a = -gradient
+        b = 1.
+        c = -intercept
+    else:
+        #print 'FIXME: Still need to treat 0 and infinite gradients'
+        #assert 0==1
+        a=1.
+        b=0.
+        c=-x2 
+
+    # Distance formula
+    inv_denom = 1./(a**2 + b**2)**0.5
+    distp = abs(p.x*a + p.y*b + c)*inv_denom
+
+    near_points = (distp<tol).nonzero()[0]
+    
+    # Now find a 'local' coordinate for the point, projected onto the line
+    # g1 = unit vector parallel to the line
+    # g2 = vector joining (x1,y1) and (p.x,p.y)
+    g1x = x2-x1 
+    g1y = y2-y1
+    g1_norm = (g1x**2 + g1y**2)**0.5
+    g1x=g1x/g1_norm
+    g1y=g1x/g1_norm
+
+    g2x = p.x[near_points] - x1
+    g2y = p.y[near_points] - y1
+    
+    # Dot product = projected distance == a local coordinate
+    local_coord = g1x*g2x + g1y*g2y
+
+    return near_points, local_coord
+
+########################
+# TRIANGLE AREAS, WATER VOLUME
+def triangle_areas(p, subset='null'):
+    # Compute areas of triangles in p -- assumes p contains vertex information
+    # subset = vector of centroid indices to include in the computation. 
+
+    if(subset=='null'):
+        subset=range(len(p.vols[:,0]))
+    
+    x0=p.x[p.vols[subset,0]]
+    x1=p.x[p.vols[subset,1]]
+    x2=p.x[p.vols[subset,2]]
+    
+    y0=p.y[p.vols[subset,0]]
+    y1=p.y[p.vols[subset,1]]
+    y2=p.y[p.vols[subset,2]]
+    
+    # Vectors for cross-product
+    v1_x=x0-x1
+    v1_y=y0-y1
+    #
+    v2_x=x2-x1
+    v2_y=y2-y1
+    # Area
+    area=(v1_x*v2_y-v1_y*v2_x)*0.5
+    area=abs(area)
+    return area
+
+###
+
+def water_volume(p,p2, per_unit_area=False, subset='null'):
+    # Compute the water volume from p(vertex values) and p2(centroid values)
+
+    if(subset=='null'):
+        subset=range(len(p2.x))
+
+    l=len(p2.time)
+    area=triangle_areas(p, subset=subset)
+    
+    total_area=area.sum()
+    volume=p2.time*0.
+   
+    # This accounts for how volume is measured in ANUGA 
+    # Compute in 2 steps to reduce precision error (important sometimes)
+    for i in range(l):
+        #volume[i]=((p2.stage[i,subset]-p2.elev[subset])*(p2.stage[i,subset]>p2.elev[subset])*area).sum()
+        volume[i]=((p2.stage[i,subset])*(p2.stage[i,subset]>p2.elev[subset])*area).sum()
+        volume[i]=volume[i]+((-p2.elev[subset])*(p2.stage[i,subset]>p2.elev[subset])*area).sum()
+    
+    if(per_unit_area):
+        volume=volume/total_area 
+    
+    return volume
+
+
+
