Index: /anuga_core/source/anuga/interface.py
===================================================================
--- /anuga_core/source/anuga/interface.py	(revision 6190)
+++ /anuga_core/source/anuga/interface.py	(revision 6190)
@@ -0,0 +1,164 @@
+"""This is the public API to ANUGA.
+
+Ideally, all tools needed to run simulations should be 
+imported from this module
+"""
+
+# FIXME(Ole): This is one step towards the API envisioned in ticket:308
+
+
+from anuga.shallow_water import Domain
+from anuga.shallow_water import Dirichlet_boundary
+from anuga.shallow_water import File_boundary
+from anuga.shallow_water import Reflective_boundary
+from anuga.shallow_water import Field_boundary
+
+from anuga.shallow_water.data_manager import export_grid, create_sts_boundary
+from anuga.shallow_water.data_manager import csv2building_polygons
+
+from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area
+from anuga.utilities.polygon import Polygon_function
+
+
+#---------------------------
+# Create domain from regions
+#---------------------------
+
+def create_domain_from_regions(bounding_polygon,
+                               boundary_tags,
+                               maximum_triangle_area=None,
+                               mesh_filename=None,
+                               interior_regions=None,
+                               interior_holes=None,
+                               poly_geo_reference=None,
+                               mesh_geo_reference=None,
+                               minimum_triangle_angle=28.0,
+                               fail_if_polygons_outside=True,
+                               use_cache=False,
+                               verbose=True):
+    """Create domain from bounding polygons and resolutions.
+
+    bounding_polygon is a list of points in Eastings and Northings,
+    relative to the zone stated in poly_geo_reference if specified.
+    Otherwise points are just x, y coordinates with no particular 
+    association to any location.
+
+    boundary_tags is a dictionary of symbolic tags. For every tag there
+    is a list of indices referring to segments associated with that tag.
+    If a segment is omitted it will be assigned the default tag ''.
+
+    maximum_triangle_area is the maximal area per triangle
+    for the bounding polygon, excluding the  interior regions.
+
+    Interior_regions is a list of tuples consisting of (polygon,
+    resolution) for each region to be separately refined. Do not have
+    polygon lines cross or be on-top of each other.  Also do not have
+    polygon close to each other.
+    
+    NOTE: If a interior_region is outside the bounding_polygon it should 
+    throw an error
+    
+    Interior_holes is a list of ploygons for each hole.
+
+    This function does not allow segments to share points - use underlying
+    pmesh functionality for that
+
+    poly_geo_reference is the geo_reference of the bounding polygon and
+    the interior polygons.
+    If none, assume absolute.  Please pass one though, since absolute
+    references have a zone.
+    
+    mesh_geo_reference is the geo_reference of the mesh to be created.
+    If none is given one will be automatically generated.  It was use
+    the lower left hand corner of  bounding_polygon (absolute)
+    as the x and y values for the geo_ref.
+    
+    Returns the shallow water domain instance
+
+    Note, interior regions should be fully nested, as overlaps may cause
+    unintended resolutions. 
+
+    fail_if_polygons_outside: If True (the default) Exception in thrown
+    where interior polygons fall outside bounding polygon. If False, these
+    will be ignored and execution continued.
+        
+    
+    """
+
+
+    # Build arguments and keyword arguments for use with caching or apply.
+    args = (bounding_polygon,
+            boundary_tags)
+    
+    kwargs = {'maximum_triangle_area': maximum_triangle_area,
+              'mesh_filename': mesh_filename,
+              'interior_regions': interior_regions,
+              'interior_holes': interior_holes,
+              'poly_geo_reference': poly_geo_reference,
+              'mesh_geo_reference': mesh_geo_reference,
+              'minimum_triangle_angle': minimum_triangle_angle,
+              'fail_if_polygons_outside': fail_if_polygons_outside,
+              'verbose': verbose} #FIXME (Ole): See ticket:14
+
+    # Call underlying engine with or without caching
+    if use_cache is True:
+        try:
+            from anuga.caching import cache
+        except:
+            msg = 'Caching was requested, but caching module'+\
+                  'could not be imported'
+            raise msg
+
+
+        domain = cache(_create_domain_from_regions,
+                       args, kwargs,
+                       verbose=verbose,
+                       compression=False)
+    else:
+        domain = apply(_create_domain_from_regions,
+                       args, kwargs)
+
+    return domain
+
+        
+def _create_domain_from_regions(bounding_polygon,
+                                boundary_tags,
+                                maximum_triangle_area=None,
+                                mesh_filename=None,                           
+                                interior_regions=None,
+                                interior_holes=None,
+                                poly_geo_reference=None,
+                                mesh_geo_reference=None,
+                                minimum_triangle_angle=28.0,
+                                fail_if_polygons_outside=True,
+                                verbose=True):
+    """_create_domain_from_regions - internal function.
+
+    See create_domain_from_regions for documentation.
+    """
+
+    from anuga.shallow_water import Domain
+    from anuga.mesh_interface import create_mesh_from_regions
+    
+    create_mesh_from_regions(bounding_polygon,
+                             boundary_tags,
+                             maximum_triangle_area=maximum_triangle_area,
+                             interior_regions=interior_regions,
+                             filename=mesh_filename,
+                             interior_holes=interior_holes,
+                             poly_geo_reference=poly_geo_reference,
+                             mesh_geo_reference=mesh_geo_reference,
+                             minimum_triangle_angle=minimum_triangle_angle,
+                             fail_if_polygons_outside=fail_if_polygons_outside,
+                             use_cache=False,
+                             verbose=verbose)
+
+    domain = Domain(mesh_filename, use_cache=False, verbose=verbose)
+
+
+    return domain
+    
+
+
+
+
Index: /anuga_core/source/anuga/shallow_water/__init__.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/__init__.py	(revision 6189)
+++ /anuga_core/source/anuga/shallow_water/__init__.py	(revision 6190)
@@ -8,5 +8,4 @@
 # Make selected classes available directly
 from shallow_water_domain import Domain,\
-     create_domain_from_regions,\
      Transmissive_boundary, Reflective_boundary,\
      Dirichlet_boundary, Time_boundary, File_boundary,\
Index: /anuga_core/source/anuga/shallow_water/shallow_water_domain.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/shallow_water_domain.py	(revision 6189)
+++ /anuga_core/source/anuga/shallow_water/shallow_water_domain.py	(revision 6190)
@@ -115,142 +115,4 @@
 from types import IntType, FloatType
 from warnings import warn
-
-
-
-#---------------------------
-# Create domain from regions
-#---------------------------
-
-def create_domain_from_regions(bounding_polygon,
-                               boundary_tags,
-                               maximum_triangle_area=None,
-                               mesh_filename=None,
-                               interior_regions=None,
-                               interior_holes=None,
-                               poly_geo_reference=None,
-                               mesh_geo_reference=None,
-                               minimum_triangle_angle=28.0,
-                               fail_if_polygons_outside=True,
-                               use_cache=False,
-                               verbose=True):
-    """Create domain from bounding polygons and resolutions.
-
-    bounding_polygon is a list of points in Eastings and Northings,
-    relative to the poly_geo_reference.
-
-    Boundary tags is a dictionary of symbolic tags. For every tag there
-    is a list of indices referring to segments associated with that tag.
-    If a segment is omitted it will be assigned the default tag ''.
-
-    maximum_triangle_area is the maximal area per triangle
-    for the bounding polygon, excluding the  interior regions.
-
-    Interior_regions is a list of tuples consisting of (polygon,
-    resolution) for each region to be separately refined. Do not have
-    polygon lines cross or be on-top of each other.  Also do not have
-    polygon close to each other.
-    
-    NOTE: If a interior_region is outside the bounding_polygon it should 
-    throw an error
-    
-    Interior_holes is a list of ploygons for each hole.
-
-    This function does not allow segments to share points - use underlying
-    pmesh functionality for that
-
-    poly_geo_reference is the geo_reference of the bounding polygon and
-    the interior polygons.
-    If none, assume absolute.  Please pass one though, since absolute
-    references have a zone.
-    
-    mesh_geo_reference is the geo_reference of the mesh to be created.
-    If none is given one will be automatically generated.  It was use
-    the lower left hand corner of  bounding_polygon (absolute)
-    as the x and y values for the geo_ref.
-    
-    Returns the shallow water domain instance
-
-    Note, interior regions should be fully nested, as overlaps may cause
-    unintended resolutions. 
-
-    fail_if_polygons_outside: If True (the default) Exception in thrown
-    where interior polygons fall outside bounding polygon. If False, these
-    will be ignored and execution continued.
-        
-    
-    """
-
-
-    # Build arguments and keyword arguments for use with caching or apply.
-    args = (bounding_polygon,
-            boundary_tags)
-    
-    kwargs = {'maximum_triangle_area': maximum_triangle_area,
-              'mesh_filename': mesh_filename,
-              'interior_regions': interior_regions,
-              'interior_holes': interior_holes,
-              'poly_geo_reference': poly_geo_reference,
-              'mesh_geo_reference': mesh_geo_reference,
-              'minimum_triangle_angle': minimum_triangle_angle,
-              'fail_if_polygons_outside': fail_if_polygons_outside,
-              'verbose': verbose} #FIXME (Ole): See ticket:14
-
-    # Call underlying engine with or without caching
-    if use_cache is True:
-        try:
-            from anuga.caching import cache
-        except:
-            msg = 'Caching was requested, but caching module'+\
-                  'could not be imported'
-            raise msg
-
-
-        domain = cache(_create_domain_from_regions,
-                       args, kwargs,
-                       verbose=verbose,
-                       compression=False)
-    else:
-        domain = apply(_create_domain_from_regions,
-                       args, kwargs)
-
-    return domain
-
-        
-def _create_domain_from_regions(bounding_polygon,
-                                boundary_tags,
-                                maximum_triangle_area=None,
-                                mesh_filename=None,                           
-                                interior_regions=None,
-                                interior_holes=None,
-                                poly_geo_reference=None,
-                                mesh_geo_reference=None,
-                                minimum_triangle_angle=28.0,
-                                fail_if_polygons_outside=True,
-                                verbose=True):
-    """_create_domain_from_regions - internal function.
-
-    See create_domain_from_regions for documentation.
-    """
-
-    create_mesh_from_regions(bounding_polygon,
-                             boundary_tags,
-                             maximum_triangle_area=maximum_triangle_area,
-                             interior_regions=interior_regions,
-                             filename=mesh_filename,
-                             interior_holes=interior_holes,
-                             poly_geo_reference=poly_geo_reference,
-                             mesh_geo_reference=mesh_geo_reference,
-                             minimum_triangle_angle=minimum_triangle_angle,
-                             fail_if_polygons_outside=fail_if_polygons_outside,
-                             use_cache=False,
-                             verbose=verbose)
-
-    domain = Domain(mesh_filename, use_cache=False, verbose=verbose)
-
-
-    return domain
-    
-
-
 
 
Index: /anuga_work/production/patong/build_patong.py
===================================================================
--- /anuga_work/production/patong/build_patong.py	(revision 6189)
+++ /anuga_work/production/patong/build_patong.py	(revision 6190)
@@ -84,5 +84,5 @@
 G1_clip = G1.clip(project.extent_elev_dir4, verbose=True) 
 G3_clip1 = G3.clip_outside(project.extent_elev_dir4, verbose=True) 
-G3_clip2 =G3_clip1.clip_outside(project.extent_elev_dir2, verbose=True)
+G3_clip2 = G3_clip1.clip_outside(project.extent_elev_dir2, verbose=True)
 G4_clip = G4.clip_outside(project.extent_elev_dir3, verbose=True)
 
Index: /anuga_work/production/patong/run_patong.py
===================================================================
--- /anuga_work/production/patong/run_patong.py	(revision 6189)
+++ /anuga_work/production/patong/run_patong.py	(revision 6190)
@@ -1,10 +1,11 @@
-"""Script for running a tsunami inundation scenario for Perth, WA, Australia.
+"""Script for running a tsunami inundation scenario for Patong Beach, Thailand.
 
 The scenario is defined by a triangular mesh created from project.polygon,
-the elevation data is compiled into a pts file through build_perth.py
-and a simulated tsunami is generated through an sts file from build_boundary.py.
+the elevation data is compiled into a pts file through build_patong.py
+and a simulated tsunami for the 2004 event is generated through 
+an sts file from build_boundary.py.
 
 Input: sts file (build_boundary.py)
-       pts file (build_perth.py)
+       pts file (build_patong.py)
        information from project file
 Outputs: sww file stored in project.output_run_time_dir 
@@ -12,6 +13,4 @@
 on the outputs of this script
 
-Ole Nielsen and Duncan Gray, GA - 2005, Jane Sexton, Nick Bartzis, GA - 2006
-Ole Nielsen, Jane Sexton and Kristy Van Putten - 2008
 """
 
@@ -27,14 +26,14 @@
 
 # Related major packages
-from anuga.shallow_water import Domain
-from anuga.shallow_water import Dirichlet_boundary
-from anuga.shallow_water import File_boundary
-from anuga.shallow_water import Reflective_boundary
-from anuga.shallow_water import Field_boundary
-from anuga.shallow_water.data_manager import export_grid, create_sts_boundary, csv2building_polygons
-from anuga.shallow_water import create_domain_from_regions
+from anuga.interface import create_domain_from_regions
+from anuga.interface import Domain
+from anuga.interface import Dirichlet_boundary
+from anuga.interface import File_boundary
+from anuga.interface import Reflective_boundary
+from anuga.interface import Field_boundary
+from anuga.interface import export_grid, create_sts_boundary
+from anuga.interface import csv2building_polygons
+
 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters
-from anuga.caching import myhash
-from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
 from anuga.fit_interpolate.benchmark_least_squares import mem_usage 
 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
@@ -178,5 +177,5 @@
 
 for t in domain.evolve(yieldstep=project.yieldstep,
-                       finaltime=project.finaltime)
+                       finaltime=project.finaltime):
     print domain.timestepping_statistics()
     print domain.boundary_statistics(tags='ocean')
