Index: /anuga_work/production/dampier_2006/build_dampier.py
===================================================================
--- /anuga_work/production/dampier_2006/build_dampier.py	(revision 4281)
+++ /anuga_work/production/dampier_2006/build_dampier.py	(revision 4282)
@@ -33,4 +33,5 @@
 from anuga.geospatial_data.geospatial_data import *
 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
+from anuga_parallel.parallel_abstraction import get_processor_name
 
 # Application specific imports
@@ -45,4 +46,5 @@
 
 start_screen_catcher(project.output_build_time_dir)
+print "Processor Name:",get_processor_name()
 
 print 'USER:    ', project.user
@@ -128,8 +130,12 @@
 G_other.export_points_file(project.combined_dir_name + '_other' + '.pts')
 
-print 'start reading:',project.combined_dir_name + '.pts'
-G = Geospatial_data(file_name = project.combined_dir_name + '.pts')
-print 'start export',project.combined_dir_name + '.txt'
-G.export_points_file(project.combined_dir_name + '.txt')
+print 'start reading:',project.combined_smaller_dir_name + '.txt'
+G = Geospatial_data(file_name = project.combined_smaller_dir_name + '.txt')
+print 'start split'
+G_smallest, G_other = G.split(0.1,True)
+
+print 'start export',project.combined_smallest_dir_name + '.txt'
+#G.export_points_file(project.combined_smaller_dir_name + '.txt')
+#G_smallest.export_points_file(project.combined_smallest_dir_name + '.txt')
 '''
 #-------------------------------------------------------------------------
@@ -152,5 +158,5 @@
 cache(urs2sww,
       (boundaries_in_dir_name,
-       project.boundaries_dir_name1), 
+       project.boundaries_dir_name+'2'),
       {'verbose': True,
        'minlat': project.south_boundary,
@@ -158,5 +164,5 @@
        'minlon': project.west_boundary,
        'maxlon': project.east_boundary,
-       'mint': 0, 'maxt': 40000,
+       'mint': 8500, 'maxt': 12000,
 #       'origin': domain.geo_reference.get_origin(),
        'mean_stage': project.tide,
Index: /anuga_work/production/dampier_2006/get_timeseries.py
===================================================================
--- /anuga_work/production/dampier_2006/get_timeseries.py	(revision 4281)
+++ /anuga_work/production/dampier_2006/get_timeseries.py	(revision 4282)
@@ -24,5 +24,5 @@
 # sww file created from URS boundary
 production_dirs = {#'20070206_005106_run': '10000 yr wave height'}
-                   'boundaries': 'URS boundary condition'}
+                   '20070223_031527_run': 'URS boundary condition'}
 
 is_parallel = False
@@ -42,5 +42,5 @@
             if label_id == 'boundaries':
                 file_loc = project.boundaries_in_dir
-                swwfile = file_loc + sep + '20061102_221245_build' + sep + 'dampier.sww'
+                swwfile = file_loc + sep + '20070223_031527_run' + sep + 'dampier.sww'
                 print 'hi'
             #else:
@@ -51,5 +51,5 @@
 
         texname, elev_output = sww2timeseries(swwfiles,
-                                              project.gauges_dir_name,
+                                              project.gauges_dir_name_test,
                                               production_dirs,
                                               report = False,
@@ -71,5 +71,5 @@
         if label_id == 'boundaries':
                 file_loc = project.boundaries_in_dir
-                swwfile = file_loc + sep + '20061102_221245_build' + sep + 'dampier.sww'
+                swwfile = file_loc + sep + '20070223_031527_run' + sep + 'dampier.sww'
         else:
             file_loc = project.output_dir + label_id + sep
@@ -78,5 +78,5 @@
         
     texname, elev_output = sww2timeseries(swwfiles,
-                                          project.gauges_dir_name,
+                                          project.gauges_dir_name_test,
                                           production_dirs,
                                           report = False,
Index: /anuga_work/production/dampier_2006/project.py
===================================================================
--- /anuga_work/production/dampier_2006/project.py	(revision 4281)
+++ /anuga_work/production/dampier_2006/project.py	(revision 4282)
@@ -6,5 +6,5 @@
 import sys
 from time import localtime, strftime, gmtime
-from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon # number_mesh_triangles
+from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
 from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_from_latlon_to_utm
 from anuga.utilities.system_tools import get_user_name
@@ -25,4 +25,5 @@
 build_time = time+'_build'
 run_time = time+'_run'
+temp_time = time+'_temp'
 print 'gtime: ', gtime
 
@@ -45,9 +46,13 @@
 #final topo name
 combined_name ='dampier_combined_elevation'
-combined_smaller_name = 'dampier_combined_elevation_smaller'
+combined_smaller_name = 'dampier_combined_elevation_small'
+combined_smallest_name = 'dampier_combined_elevation_smallest'
 
 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'070112'+sep+'points'+sep
 topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
 topographies_time_dir = topographies_dir+build_time+sep
+
+temp_dir = home+sep+state+sep+scenario+sep+'anuga'+sep
+temp_dir_name = temp_dir + temp_time+sep
 
 # input topo file location
@@ -67,5 +72,6 @@
 combined_dir_name = topographies_dir + combined_name
 combined_time_dir_name = topographies_time_dir + combined_name
-combined_smaller_name_dir = topographies_dir + combined_smaller_name
+combined_smaller_dir_name = topographies_dir + combined_smaller_name
+combined_smallest_dir_name = topographies_dir + combined_smallest_name
 #combined_time_dir_final_name = topographies_time_dir + combined_final_name
 
@@ -78,13 +84,18 @@
 boundaries_source = ''
 boundaries_name = 'o'
-boundaries_name1 = 'o_new'
+boundaries_name1 = 'o_new1'
+boundaries_name2 = 'o_test'
 
 #boundaries locations
-boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'
-#boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+'1_10000'+sep
+#boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep
+boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+'1_10000'+sep
 boundaries_in_dir_name = boundaries_in_dir + boundaries_name
 boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep
 boundaries_dir_name = boundaries_dir + boundaries_name
 boundaries_dir_name1 = boundaries_dir + boundaries_name1
+boundaries_dir_name2 = boundaries_dir + boundaries_name2
+boundaries_dir_name3 = boundaries_dir + boundaries_name+'_test_8500_12000'
+boundaries_dir_name4 = boundaries_dir + boundaries_name+'_8500_12000_no_zone'
+
 #boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
 #boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
@@ -98,6 +109,9 @@
 #gauges
 gauge_name = 'dampier_gauges_up2.csv' #'dampier.csv'
+gauge_name_test = 'dampier_gauges_up_test.csv' #'dampier.csv'
 gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
 gauges_dir_name = gauges_dir + gauge_name
+gauges_dir_name_test = gauges_dir + gauge_name_test
+
 
 #buildings_filename = gauges_dir + 'dampier_res_nexis.csv'
@@ -109,5 +123,6 @@
 refzone = 50 
 south_boundary = degminsec2decimal_degrees(-20,58,0)
-north_boundary = degminsec2decimal_degrees(-20,13,0)
+#north_boundary = degminsec2decimal_degrees(-20,13,0)
+north_boundary = degminsec2decimal_degrees(-19,30,0)
 west_boundary = degminsec2decimal_degrees(116,15,0)
 east_boundary = degminsec2decimal_degrees(117,11,0)
@@ -128,5 +143,5 @@
 print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
 
-res_poly_all = 100000
+res_poly_all = 400000
 #res_poly_all = 500000
 
@@ -139,5 +154,6 @@
 
 poly_dampier = read_polygon(polygons_dir+'dampier_town.csv')
-res_dampier = 500
+res_dampier = 1000
+#res_dampier = 500
 #res_dampier = 5000
 
@@ -146,5 +162,6 @@
 
 poly_karratha_town = read_polygon(polygons_dir+'karratha_townv2.csv')
-res_karratha_town = 500
+res_karratha_town = 1000
+#res_karratha_town = 500
 #res_karratha_town = 5000
 
@@ -226,8 +243,11 @@
                     [poly_ref_nw5,res_ref_nw5],[poly_ref_nw6,res_ref_nw6],
                     [poly_ref_nw7,res_ref_nw7],[poly_ref_nw8,res_ref_nw8]]
-                    
-#trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
-#
-#print 'min number triangles', trigs_min
+
+interior_regions_test = [[poly_dampier,res_dampier], 
+                    [poly_karratha,res_karratha],[poly_karratha_town,res_karratha_town]]
+
+trigs_min = number_mesh_triangles(interior_regions_test, poly_all, res_poly_all)
+
+print 'min number triangles', trigs_min
 
 ###################################################################
Index: /anuga_work/production/dampier_2006/run_dampier.py
===================================================================
--- /anuga_work/production/dampier_2006/run_dampier.py	(revision 4281)
+++ /anuga_work/production/dampier_2006/run_dampier.py	(revision 4282)
@@ -34,4 +34,5 @@
 from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier
 from anuga_parallel.parallel_abstraction import get_processor_name
+from anuga.caching import myhash
 # Application specific imports
 import project                 # Definition of file names and polygons
@@ -81,13 +82,16 @@
 
 sys.exit()
-'''
+
 if myid == 0:
     
     print 'start create mesh from regions'
+#    print 'project.res_poly_all',project.res_poly_all
+#    print 'project.interior_regions_test',project.interior_regions_test
+#    print 'meshes_dir_name',meshes_dir_name
     create_mesh_from_regions(project.poly_all,
                              boundary_tags={'back': [2,3], 'side': [0, 1, 4],
                                             'ocean': [5]},
                              maximum_triangle_area=project.res_poly_all,
-                             interior_regions=project.interior_regions,
+                             interior_regions=project.interior_regions_test,
                              filename=meshes_dir_name,
                              use_cache=True,
@@ -96,4 +100,13 @@
 # to sync all processors are ready 
 barrier()
+'''
+create_mesh_from_regions(project.poly_all,
+                             boundary_tags={'back': [2,3], 'side': [0, 1, 4],
+                                            'ocean': [5]},
+                             maximum_triangle_area=project.res_poly_all,
+                             interior_regions=project.interior_regions_test,
+                             filename=meshes_dir_name,
+                             use_cache=True,
+                             verbose=True)
 
 #-------------------------------------------------------------------------
@@ -101,6 +114,11 @@
 #-------------------------------------------------------------------------
 print 'Setup computational domain'
-domain = Domain(meshes_dir_name, use_cache=True, verbose=True)
+from caching import cache
+domain = cache(Domain, (meshes_dir_name), {'use_cache':True, 'verbose':True}, verbose=True)
+print 'domain id', id(domain) 
+print 'myhash', myhash(domain)      
+       
 print domain.statistics()
+
 boundaries_dir_name=project.boundaries_dir_name
 
@@ -108,5 +126,5 @@
 
 from anuga.shallow_water.data_manager import urs2sww
-
+'''
 # put above distribute
 print 'boundary file is: ',project.boundaries_dir_name
@@ -129,5 +147,5 @@
            )
 barrier()
-
+'''
 
 #-------------------------------------------------------------------------
@@ -148,6 +166,6 @@
 #                    filename = project.combined_dir_name + '.pts',
 # MUST USE TXT FILES FOR CACHING TO WORK!
-                    filename = project.combined_dir_name + '.txt',
-                    use_cache = False,
+                    filename = project.combined_smaller_dir_name + '.txt',
+                    use_cache = True,
                     verbose = True,
                     alpha = 0.1)
@@ -166,5 +184,5 @@
 # Set domain parameters
 #------------------------------------------------------
-
+print 'domain id', id(domain)
 domain.set_name(project.scenario_name)
 domain.set_datadir(project.output_run_time_dir)
@@ -174,4 +192,7 @@
 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
 domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK)
+print 'domain id', id(domain)
+domain.beta_h = 0
+domain.limit2007 = 1
 
 #-------------------------------------------------------------------------
@@ -180,6 +201,7 @@
 print 'Available boundary tags', domain.get_boundary_tags()
 print 'domain id', id(domain)
-print 'Reading Boundary file'
-Bf = File_boundary(boundaries_dir_name + '.sww',
+print 'Reading Boundary file',project.boundaries_dir_name4 + '.sww'
+#Bf = File_boundary(boundaries_dir_name + '.sww',
+Bf = File_boundary(project.boundaries_dir_name4 + '.sww',
                   domain, time_thinning=4, use_cache=True, verbose=True)
 
@@ -204,5 +226,5 @@
 t0 = time.time()
 
-for t in domain.evolve(yieldstep = 120, finaltime = 9000):
+for t in domain.evolve(yieldstep = 60, finaltime = 9000):
     domain.write_time()
     domain.write_boundary_statistics(tags = 'ocean')
