Index: /anuga_validation/conical_island/run_circular.py
===================================================================
--- /anuga_validation/conical_island/run_circular.py	(revision 4796)
+++ /anuga_validation/conical_island/run_circular.py	(revision 4797)
@@ -10,6 +10,8 @@
 from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary
 from anuga.shallow_water import Dirichlet_boundary, Time_boundary
+from anuga.shallow_water.data_manager import get_maximum_inundation_data
 from anuga.abstract_2d_finite_volumes.util import file_function
 from anuga.pmesh.mesh_interface import create_mesh_from_regions
+from anuga.utilities.polygon import read_polygon, plot_polygons
 #from cmath import cos,sin,cosh,pi
 from math import cos,pi,sin,tan,sqrt
@@ -22,4 +24,9 @@
 #-------------------------
 
+def get_xy(x=0,y=0,r=1,angle=1):
+    x1 = x + cos(angle)*r
+    y1 = y + sin(-angle)*r
+#    print "get",x,y,r,x1,y1,"angle",angle, cos(angle),sin(angle)
+    return x1,y1,
 
 def prepare_timeboundary(filename):
@@ -50,5 +57,5 @@
     for i, line in enumerate(lines):
         fields = line.split()
-        print 'fields',i,line
+#        print 'fields',i,line
 
         T[i] = float(fields[0])
@@ -82,11 +89,57 @@
 
 
-
-poly_all= [[0,0],[0,25],[30,25],[30,0]]
-poly=[[9,10],[9,17.6],[16.6,17.6],[16.6,10]]
-internal_poly=[[poly,1]]
+angles = (0.0, 22.5, 45.0, 67.5, 75.0, 80.0, 85.0, 87.5, 90.0, 92.5,
+          95.0, 100.0, 105.0, 112.5, 135.0, 157.5, 180.0, 202.5, 225.0,
+          247.5, 270.0, 292.5, 315.0, 337.5)
+angles1 = (0.0, 22.5, 45.0, 67.5, 90.0, 112.5, 135.0, 157.5, 180.0, 202.5, 225.0,
+          247.5, 270.0, 292.5, 315.0, 337.5)
+
+x = 12.96
+y = 13.80
+r1 = 1.5
+r2 = 2.5
+d=0.75
+res=0.0005
+
+poly = []
+internal_poly=[]
+for i,angle in enumerate(angles):
+    angle = ((angle-180)/180.0)*pi
+#    p1 = get_xy(x,y,r1,angle-0.01745*d)
+#    p2 = get_xy(x,y,r2,angle-0.01745*d)
+#    p3 = get_xy(x,y,r2,angle+0.01745*d)
+#    p4 = get_xy(x,y,r1,angle+0.01745*d)
+#    poly[i] = [[p1[0],p1[1]],[p2[0],p2[1]],[p3[0],p3[1]],[p4[0],p4[1]]]
+
+    p = get_xy(x,y,4,angle)
+    poly.insert(0,[p[0],p[1]])
+internal_poly.insert(0,(poly,1))
+
+poly1 = []
+for i,angle in enumerate(angles):
+    angle = ((angle-180)/180.0)*pi
+    p = get_xy(x,y,2.,angle)
+    poly1.insert(0,[p[0],p[1]])
+    
+internal_poly.insert(1,(poly1,.1))
+
+poly2 = []
+for i,angle in enumerate(angles):
+    angle = ((angle-180)/180.0)*pi
+    p = get_xy(x,y,1.,angle)
+    poly2.insert(0,[p[0],p[1]])
+    
+internal_poly.insert(2,(poly2,1))
+
+print internal_poly
+
+plot_polygons(internal_poly,'poly.png',)
+
+poly_all= [[0,7],[0,25],[30,25],[30,7]]
+#poly1=[[9,10],[9,17.6],[16.6,17.6],[16.6,10]]
+#internal_poly.insert(0,(poly1,0.025))
 create_mesh_from_regions(poly_all,
-                         boundary_tags={'wall': [0,1,2],'wave': [3]},
-                         maximum_triangle_area=10,
+                         boundary_tags={'wall': [0,2],'wave': [3], 'buffer':[1]},
+                         maximum_triangle_area=1,
                          interior_regions=internal_poly,
                          filename='temp.msh',
@@ -101,5 +154,5 @@
 #-------------------------
 domain.set_quantity('friction', 0.0)
-water_height = 0.32
+water_height = 0.322
 domain.set_quantity('stage', water_height)
 
@@ -121,5 +174,5 @@
                 z=0.625
 
-            print 'x,y,f',i,j,a,b,z
+#            print 'x,y,f',i,j,a,b,z
             file.write("%s, %s, %s\n" %(i, j, z))
     file.close()
@@ -133,5 +186,5 @@
 # Set simulation parameters
 #-------------------------
-domain.set_name('test')  # Name of output sww file
+domain.set_name('test1')  # Name of output sww file
 domain.set_default_order(1)               # Apply second order scheme 
 domain.set_all_limiters(0.9)              # Max second order scheme (old lim)
@@ -160,5 +213,5 @@
 
 # Create and assign boundary objects
-boundary_filename="ts2a_edit_input_32"
+boundary_filename="ts2cnew1_input"
 prepare_timeboundary(boundary_filename+'.txt')
 
@@ -174,5 +227,5 @@
 Br = Reflective_boundary(domain)
 Bd = Dirichlet_boundary([water_height,0,0])
-domain.set_boundary({'wave': Bts, 'wall': Bd})
+domain.set_boundary({'wave': Bts, 'wall': Br, 'buffer':Bd})
 
 #-------------------------
@@ -182,7 +235,47 @@
 t0 = time.time()
 
-for t in domain.evolve(yieldstep = 5, finaltime = 75):
+for t in domain.evolve(yieldstep = 1, finaltime = 32):
     domain.write_time()
 #    domain.write_time(track_speeds=False)
 
+for t in domain.evolve(yieldstep = 0.1, finaltime = 36
+                       ,skip_initial_step = True): 
+    domain.write_time()
+   
+for t in domain.evolve(yieldstep = 1, finaltime = 75
+                       ,skip_initial_step = True): 
+    domain.write_time()
+
 print 'That took %.2f seconds' %(time.time()-t0)
+
+
+
+#angles = (0.0, 22.5, 45.0, 67.5, 75.0, 80.0, 85.0, 87.5, 90.0, 92.5,
+#          95.0, 100.0, 105.0, 112.5, 135.0, 157.5, 180.0, 202.5, 225.0,
+#          247.5, 270.0, 292.5, 315.0, 337.5)
+#x = 12.96
+#y = 13.80
+#r1 = 1.1
+#r2 = 3.6
+#d=2
+#poly = {}
+for i,angle in enumerate(angles):
+#    angle = ((angle-180)/180.0)*pi
+##    angle = angle1*3.14157
+#    p1 = get_xy(x,y,r1,angle-0.01745*d)
+#    p2 = get_xy(x,y,r2,angle-0.01745*d)
+#    p3 = get_xy(x,y,r2,angle+0.01745*d)
+#    p4 = get_xy(x,y,r1,angle+0.01745*d)
+#    poly[i] = [[p1[0],p1[1]],[p2[0],p2[1]],[p3[0],p3[1]],[p4[0],p4[1]]]
+##    print i,poly[i]
+#    
+    
+    run_up, x_y = get_maximum_inundation_data(filename='test.sww',polygon=poly[i], verbose=False)
+    
+    print 'maximum_inundation_data',angle, run_up, x_y 
+    
+
+
+
+
+
