Index: /trunk/anuga_core/source/anuga/__init__.py
===================================================================
--- /trunk/anuga_core/source/anuga/__init__.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/__init__.py	(revision 7780)
@@ -1,11 +1,16 @@
-""" This is the public API to ANUGA. It provides a toolkit of often-used
+""" ANUGA models the effect of tsunamis and flooding upon a terrain mesh.
+    In typical usage, a Domain class is created for a particular piece of
+    terrain. Boundary conditions are specified for the domain, such as inflow
+    and outflow, and then the simulation is run.
+
+    This is the public API to ANUGA. It provides a toolkit of often-used
     modules, which can be used directly by including the following line in
     the user's code:
 
     import anuga
-    
-    It abstracts away the internal heirarchy of the ANUGA system, allowing the
-    user to concentrate on writing simulations without searching through the
-    ANUGA source tree for the functions that they need.
+        
+    This usage pattern abstracts away the internal heirarchy of the ANUGA
+    system, allowing the user to concentrate on writing simulations without
+    searching through the ANUGA source tree for the functions that they need.
     
     Also, it isolates the user from "under-the-hood" refactorings.
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py	(revision 7780)
@@ -146,5 +146,5 @@
     from anuga.utilities.numerical_tools import ensure_numeric, mean, NAN
     import string
-    from anuga.shallow_water.data_manager import get_all_swwfiles
+    from anuga.utilities.file_utils import get_all_swwfiles
     from anuga.abstract_2d_finite_volumes.util import file_function    
 
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py	(revision 7780)
@@ -1,4 +1,9 @@
 """Class Domain - 2D triangular domains for finite-volume computations of
    conservation laws.
+   
+   This is the base class for various domain models, such as: the Advection
+   implementation is a simple algorithm, mainly for testing purposes, and
+   the standard Shallow Water Wave domain (simply known as Domain) is the
+   standard for realistic simulation.
 
 
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_domain.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_domain.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_domain.py	(revision 7780)
@@ -886,122 +886,4 @@
 
 
-    def test_that_mesh_methods_exist(self):
-        """test_that_mesh_methods_exist
-        
-        Test that relavent mesh methods are made available in 
-        domain through composition
-        """
-        from mesh_factory import rectangular
-        from shallow_water import Domain
-
-        # Create basic mesh
-        points, vertices, boundary = rectangular(1, 3)
-
-        # Create shallow water domain
-        domain = Domain(points, vertices, boundary)                             
-        
-        
-        domain.get_centroid_coordinates()
-        domain.get_radii()
-        domain.get_areas()
-        domain.get_area()
-        domain.get_vertex_coordinates()
-        domain.get_triangles()
-        domain.get_nodes()
-        domain.get_number_of_nodes()
-        domain.get_normal(0,0)
-        domain.get_triangle_containing_point([0.4,0.5])
-        domain.get_intersecting_segments([[0.0, 0.0], [0.0, 1.0]])
-        domain.get_disconnected_triangles()
-        domain.get_boundary_tags()
-        domain.get_boundary_polygon()
-        #domain.get_number_of_triangles_per_node()
-        domain.get_triangles_and_vertices_per_node()
-        domain.get_interpolation_object()
-        domain.get_tagged_elements()
-        domain.get_lone_vertices()
-        domain.get_unique_vertices()
-        g = domain.get_georeference()
-        domain.set_georeference(g)
-        domain.build_tagged_elements_dictionary()
-        domain.statistics()
-        domain.get_extent()
-
-    def NOtest_vertex_within_hole(self):
-        """ NOTE: This test fails - it is designed to test fitting on
-            a mesh with a hole, but more info is needed on the specific
-            problem."""
-        
-        # For test_fitting_using_shallow_water_domain example
-        def linear_function(point):
-            point = num.array(point)
-            return point[:,0]+point[:,1]        
-        
-        meshname = 'test_mesh.msh'
-        verbose = False
-        W = 0
-        S = 0
-        E = 10
-        N = 10
-
-        bounding_polygon = [[W, S], [E, S], [E, N], [W, N]]
-        hole = [[[.1,.1], [9.9,1.1], [9.9,9.9], [1.1,9.9]]]
-
-        create_mesh_from_regions(bounding_polygon,
-                                 boundary_tags={'south': [0], 
-                                                'east': [1], 
-                                                'north': [2], 
-                                                'west': [3]},
-                                 maximum_triangle_area=1,
-                                 filename=meshname,
-                                 interior_holes = hole,
-                                 use_cache=False,
-                                 verbose=verbose)
-
-        domain = Domain(meshname, use_cache=False, verbose=verbose)
-        quantity = Quantity(domain)
-        
-         # Get (enough) datapoints (relative to georef)
-        data_points     = [[ 0.66666667, 0.66666667],
-                           [ 1.33333333, 1.33333333],
-                           [ 2.66666667, 0.66666667],
-                           [ 0.66666667, 2.66666667],
-                           [ 0.0,        1.0],
-                           [ 0.0,        3.0],
-                           [ 1.0,        0.0],
-                           [ 1.0,        1.0],
-                           [ 1.0,        2.0],
-                           [ 1.0,        3.0],
-                           [ 2.0,        1.0],
-                           [ 3.0,        0.0],
-                           [ 3.0,        1.0]]
-
-
-        attributes = linear_function(data_points)
-        att = 'spam_and_eggs'
-
-        # Create .txt file
-        ptsfile = "points.txt"
-        file = open(ptsfile, "w")
-        file.write(" x,y," + att + " \n")
-        for data_point, attribute in map(None, data_points, attributes):
-            row = (str(data_point[0]) + ',' +
-                   str(data_point[1]) + ',' +
-                   str(attribute))
-            file.write(row + "\n")
-        file.close()
-
-        # Check that values can be set from file
-        quantity.set_values(filename=ptsfile, attribute_name=att, alpha=0)
-        answer = linear_function(quantity.domain.get_vertex_coordinates())
-
-        assert num.allclose(quantity.vertex_values.flat, answer)
-
-        # Check that values can be set from file using default attribute
-        quantity.set_values(filename = ptsfile, alpha = 0)
-        assert num.allclose(quantity.vertex_values.flat, answer)       
-        
-        
-
 #-------------------------------------------------------------
 
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_general_mesh.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_general_mesh.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_general_mesh.py	(revision 7780)
@@ -9,4 +9,6 @@
 from general_mesh import General_mesh
 from anuga.coordinate_transforms.geo_reference import Geo_reference
+from mesh_factory import rectangular
+from anuga.shallow_water.shallow_water_domain import Domain
 
 import numpy as num
@@ -340,7 +342,4 @@
 
     def test_areas(self):
-        from mesh_factory import rectangular
-        from shallow_water import Domain
-
         #Create basic mesh
         points, vertices, boundary = rectangular(1, 3)
@@ -354,6 +353,4 @@
         get unique_vertex based on triangle lists.
         """
-        from mesh_factory import rectangular
-        from shallow_water import Domain
 
         #Create basic mesh
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py	(revision 7780)
@@ -1,3 +1,12 @@
 #!/usr/bin/env python
+"""
+    Generic boundary conditions for a domain.
+    
+    A boundary represents the edge of the model, where inflow, outflow, and
+    reflection can take place.
+    
+    The boundaries in this model can be applied universally across all
+    domain models, without being tied to a particular implementation.
+"""
 
 import unittest
@@ -404,5 +413,5 @@
 
         #Convert ASCII file to NetCDF (Which is what we really like!)
-        from anuga.shallow_water.file_conversion import timefile2netcdf
+        from anuga.file_conversion.file_conversion import timefile2netcdf
         
         timefile2netcdf(filename, quantity_names = ['stage', 'xmomentum'])
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_region.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_region.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_region.py	(revision 7780)
@@ -4,4 +4,6 @@
 from math import sqrt
 
+from mesh_factory import rectangular
+from anuga.shallow_water.shallow_water_domain import Domain
 from generic_domain import Generic_Domain
 from region import *
@@ -43,7 +45,4 @@
     def test_region_tags(self):
         """get values based on triangle lists."""
-
-        from mesh_factory import rectangular
-        from shallow_water import Domain
 
         #Create basic mesh
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py	(revision 7780)
@@ -18,6 +18,10 @@
 
 from anuga.pmesh.mesh import Mesh
+import time
+from mesh_factory import rectangular
+from anuga.coordinate_transforms.geo_reference import Geo_reference
 from anuga.shallow_water.shallow_water_domain import Domain
-from generic_boundary_conditions import Transmissive_boundary
+from generic_boundary_conditions import \
+                                Transmissive_boundary, Dirichlet_boundary
 from anuga.file.sww import SWW_file
 from csv import reader,writer
@@ -128,6 +132,4 @@
         #Create sww file of simple propagation from left to right
         #through rectangular domain
-        from shallow_water import Domain, Dirichlet_boundary
-        from mesh_factory import rectangular
 
         #Create basic mesh and shallow water domain
@@ -333,13 +335,4 @@
         NetCDF version (x,y,t dependency)        
         """
-        import time
-
-        #Create sww file of simple propagation from left to right
-        #through rectangular domain
-        from shallow_water import Domain, Dirichlet_boundary
-        from mesh_factory import rectangular
-
-
-        from anuga.coordinate_transforms.geo_reference import Geo_reference
         xllcorner = 2048
         yllcorner = 11000
@@ -613,6 +606,5 @@
         from anuga.config import time_format
         from mesh_factory import rectangular
-        from shallow_water import Domain
-        import anuga.shallow_water.data_manager
+        from anuga.shallow_water.shallow_water_domain import Domain
 
         finaltime = 1200
Index: /trunk/anuga_core/source/anuga/damage_modelling/test_inundation_damage.py
===================================================================
--- /trunk/anuga_core/source/anuga/damage_modelling/test_inundation_damage.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/damage_modelling/test_inundation_damage.py	(revision 7780)
@@ -15,4 +15,5 @@
 from anuga.utilities.numerical_tools import mean
 from anuga.file.sww import SWW_file
+from anuga.shallow_water.shallow_water_domain import Domain
 
 import numpy as num
Index: /trunk/anuga_core/source/anuga/file/csv_file.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/csv_file.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/file/csv_file.py	(revision 7780)
@@ -271,5 +271,5 @@
     """
 
-    polygons, values = csv2polygons(file_name,
+    polygons, values = load_csv_as_polygons(file_name,
                                     value_name='floors',
                                     clipping_polygons=None)    
Index: /trunk/anuga_core/source/anuga/file/sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/sww.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/file/sww.py	(revision 7780)
@@ -1039,5 +1039,5 @@
     
     from Scientific.IO.NetCDF import NetCDFFile
-    from shallow_water import Domain
+    from anuga.shallow_water_domain.shallow_water import Domain
 
     # initialise NaN.
@@ -1225,5 +1225,4 @@
     import types
     from Scientific.IO.NetCDF import NetCDFFile
-    from shallow_water import Domain
     from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
 
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py	(revision 7780)
@@ -4,4 +4,5 @@
 
 # external modules
+import os
 import numpy as num
 
@@ -11,4 +12,5 @@
 from anuga.utilities.system_tools import get_vars_in_expression
 import anuga.utilities.log as log
+from anuga.utilities.file_utils import get_all_swwfiles
 
 
Index: /trunk/anuga_core/source/anuga/file_conversion/test_file_conversion.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_file_conversion.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_file_conversion.py	(revision 7780)
@@ -9,4 +9,5 @@
 from anuga.file.sww import SWW_file
 from anuga.file.sww import extent_sww
+from anuga.file_conversion.urs2nc import lon_lat2grid
 from anuga.config import netcdf_float, epsilon, g
 from Scientific.IO.NetCDF import NetCDFFile
@@ -2346,4 +2347,67 @@
         return base_name, files
 
+
+
+    def test_lon_lat2grid(self):
+        lonlatdep = [
+            [ 113.06700134  ,  -26.06669998 ,   1.        ] ,
+            [ 113.06700134  ,  -26.33329964 ,   3.        ] ,
+            [ 113.19999695  ,  -26.06669998 ,   2.        ] ,
+            [ 113.19999695  ,  -26.33329964 ,   4.        ] ]
+            
+        long, lat, quantity = lon_lat2grid(lonlatdep)
+
+        for i, result in enumerate(lat):
+            assert lonlatdep [i][1] == result
+        assert len(lat) == 2 
+
+        for i, result in enumerate(long):
+            assert lonlatdep [i*2][0] == result
+        assert len(long) == 2
+
+        for i,q in enumerate(quantity):
+            assert q == i+1
+            
+    def test_lon_lat2grid_bad(self):
+        lonlatdep  = [
+            [ -26.06669998,  113.06700134,    1.        ],
+            [ -26.06669998 , 113.19999695 ,   2.        ],
+            [ -26.06669998 , 113.33300018,    3.        ],
+            [ -26.06669998 , 113.43299866   , 4.        ],
+            [ -26.20000076 , 113.06700134,    5.        ],
+            [ -26.20000076 , 113.19999695 ,   6.        ],
+            [ -26.20000076 , 113.33300018  ,  7.        ],
+            [ -26.20000076 , 113.43299866   , 8.        ],
+            [ -26.33329964 , 113.06700134,    9.        ],
+            [ -26.33329964 , 113.19999695 ,   10.        ],
+            [ -26.33329964 , 113.33300018  ,  11.        ],
+            [ -26.33329964 , 113.43299866 ,   12.        ],
+            [ -26.43330002 , 113.06700134 ,   13        ],
+            [ -26.43330002 , 113.19999695 ,   14.        ],
+            [ -26.43330002 , 113.33300018,    15.        ],
+            [ -26.43330002 , 113.43299866,    16.        ]]
+        try:
+            long, lat, quantity = lon_lat2grid(lonlatdep)
+        except AssertionError:
+            pass
+        else:
+            msg = 'Should have raised exception'
+            raise msg
+       
+    def test_lon_lat2gridII(self):
+        lonlatdep = [
+            [ 113.06700134  ,  -26.06669998 ,   1.        ] ,
+            [ 113.06700134  ,  -26.33329964 ,   2.        ] ,
+            [ 113.19999695  ,  -26.06669998 ,   3.        ] ,
+            [ 113.19999695  ,  -26.344329964 ,   4.        ] ]
+        try:
+            long, lat, quantity = lon_lat2grid(lonlatdep)
+        except AssertionError:
+            pass
+        else:
+            msg = 'Should have raised exception'
+            raise msg
+        
+
 #-------------------------------------------------------------
 
Index: /trunk/anuga_core/source/anuga/fit_interpolate/test_interpolate.py
===================================================================
--- /trunk/anuga_core/source/anuga/fit_interpolate/test_interpolate.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/fit_interpolate/test_interpolate.py	(revision 7780)
@@ -60,5 +60,5 @@
         ######################
         # Boundary conditions
-        B = Transmissive_boundary(domain)
+        B = anuga.Transmissive_boundary(domain)
         domain.set_boundary( {'left': B, 'right': B, 'top': B, 'bottom': B})
 
Index: /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py
===================================================================
--- /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 7780)
@@ -1556,5 +1556,5 @@
     """
 
-    from anuga.shallow_water import Domain
+    from anuga.shallow_water.shallow_water_domain import Domain
     from anuga.geospatial_data.geospatial_data import Geospatial_data
     from anuga.pmesh.mesh_interface import create_mesh_from_regions
Index: /trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 7780)
@@ -28,13 +28,17 @@
 from anuga.utilities.system_tools import get_pathname_from_package, \
                                             get_revision_number
+from anuga.utilities.file_utils import get_all_swwfiles
 from anuga.utilities.file_utils import del_dir
 from anuga.utilities.numerical_tools import ensure_numeric, mean
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
 from anuga.config import netcdf_float, epsilon, g
-
+from anuga.pmesh.mesh_interface import create_mesh_from_regions
+from anuga.file_conversion.sww2dem import sww2dem_batch
 from anuga.file.csv_file import load_csv_as_dict, load_csv_as_array, \
                                 load_csv_as_building_polygons, \
                                 load_csv_as_polygons
 from anuga.file.sts import create_sts_boundary
+from anuga.file.pts import load_pts_as_polygon
+from anuga.file.sww import Write_sww
 
 
@@ -803,5 +807,5 @@
 
         #Export to ascii/prj files
-        export_grid(self.domain.get_name(),
+        sww2dem_batch(self.domain.get_name(),
                 quantities = 'elevation',
                 cellsize = cellsize,
@@ -890,5 +894,5 @@
         #Export to ascii/prj files
         if True:
-            export_grid(self.domain.get_name(),
+            sww2dem_batch(self.domain.get_name(),
                         quantities = ['elevation', 'depth'],
                         cellsize = cellsize,
@@ -897,5 +901,5 @@
 
         else:
-            export_grid(self.domain.get_name(),
+            sww2dem_batch(self.domain.get_name(),
                 quantities = ['depth'],
                 cellsize = cellsize,
@@ -1023,5 +1027,5 @@
         extra_name_out = 'yeah'
         if True:
-            export_grid(self.domain.get_name(),
+            sww2dem_batch(self.domain.get_name(),
                         quantities = ['elevation', 'depth'],
                         extra_name_out = extra_name_out,
@@ -1031,5 +1035,5 @@
 
         else:
-            export_grid(self.domain.get_name(),
+            sww2dem_batch(self.domain.get_name(),
                 quantities = ['depth'],
                 cellsize = cellsize,
@@ -1038,5 +1042,5 @@
 
 
-            export_grid(self.domain.get_name(),
+            sww2dem_batch(self.domain.get_name(),
                 quantities = ['elevation'],
                 cellsize = cellsize,
@@ -1107,5 +1111,5 @@
 
         try:
-            export_grid('a_small_round-egg',
+            sww2dem_batch('a_small_round-egg',
                         quantities = ['elevation', 'depth'],
                         cellsize = 99,
@@ -1168,5 +1172,5 @@
         #Export to ascii/prj files
         extra_name_out = 'yeah'
-        export_grid(base_name,
+        sww2dem_batch(base_name,
                     quantities = ['elevation', 'depth'],
                     extra_name_out = extra_name_out,
@@ -1486,10 +1490,4 @@
         This one uses a sine wave and compares to time boundary
         """
-        
-        from anuga.shallow_water.shallow_water_domain import Domain
-        from anuga.shallow_water import Reflective_boundary
-        from anuga.shallow_water import Dirichlet_boundary
-        from anuga.shallow_water import File_boundary
-        from anuga.pmesh.mesh_interface import create_mesh_from_regions
 
         lat_long_points=[[6.01,97.0],[6.02,97.0],[6.05,96.9],[6.0,97.0]]
@@ -1683,10 +1681,4 @@
         """
         
-        from anuga.shallow_water.shallow_water_domain import Domain
-        from anuga.shallow_water import Reflective_boundary
-        from anuga.shallow_water import Dirichlet_boundary
-        from anuga.shallow_water import File_boundary
-        from anuga.pmesh.mesh_interface import create_mesh_from_regions
-
         lat_long_points=[[6.01,97.0],[6.02,97.0],[6.05,96.9],[6.0,97.0]]
         bounding_polygon=[[6.0,97.0],[6.01,97.0],[6.02,97.0],[6.02,97.02],[6.00,97.02]]
@@ -1830,64 +1822,4 @@
             raise Exception, 'Should have raised Exception here'
 
-    def test_lon_lat2grid(self):
-        lonlatdep = [
-            [ 113.06700134  ,  -26.06669998 ,   1.        ] ,
-            [ 113.06700134  ,  -26.33329964 ,   3.        ] ,
-            [ 113.19999695  ,  -26.06669998 ,   2.        ] ,
-            [ 113.19999695  ,  -26.33329964 ,   4.        ] ]
-            
-        long, lat, quantity = lon_lat2grid(lonlatdep)
-
-        for i, result in enumerate(lat):
-            assert lonlatdep [i][1] == result
-        assert len(lat) == 2 
-
-        for i, result in enumerate(long):
-            assert lonlatdep [i*2][0] == result
-        assert len(long) == 2
-
-        for i,q in enumerate(quantity):
-            assert q == i+1
-            
-    def test_lon_lat2grid_bad(self):
-        lonlatdep  = [
-            [ -26.06669998,  113.06700134,    1.        ],
-            [ -26.06669998 , 113.19999695 ,   2.        ],
-            [ -26.06669998 , 113.33300018,    3.        ],
-            [ -26.06669998 , 113.43299866   , 4.        ],
-            [ -26.20000076 , 113.06700134,    5.        ],
-            [ -26.20000076 , 113.19999695 ,   6.        ],
-            [ -26.20000076 , 113.33300018  ,  7.        ],
-            [ -26.20000076 , 113.43299866   , 8.        ],
-            [ -26.33329964 , 113.06700134,    9.        ],
-            [ -26.33329964 , 113.19999695 ,   10.        ],
-            [ -26.33329964 , 113.33300018  ,  11.        ],
-            [ -26.33329964 , 113.43299866 ,   12.        ],
-            [ -26.43330002 , 113.06700134 ,   13        ],
-            [ -26.43330002 , 113.19999695 ,   14.        ],
-            [ -26.43330002 , 113.33300018,    15.        ],
-            [ -26.43330002 , 113.43299866,    16.        ]]
-        try:
-            long, lat, quantity = lon_lat2grid(lonlatdep)
-        except AssertionError:
-            pass
-        else:
-            msg = 'Should have raised exception'
-            raise msg
-       
-    def test_lon_lat2gridII(self):
-        lonlatdep = [
-            [ 113.06700134  ,  -26.06669998 ,   1.        ] ,
-            [ 113.06700134  ,  -26.33329964 ,   2.        ] ,
-            [ 113.19999695  ,  -26.06669998 ,   3.        ] ,
-            [ 113.19999695  ,  -26.344329964 ,   4.        ] ]
-        try:
-            long, lat, quantity = lon_lat2grid(lonlatdep)
-        except AssertionError:
-            pass
-        else:
-            msg = 'Should have raised exception'
-            raise msg
-        
     #### END TESTS FOR URS 2 SWW  ###
 
@@ -2076,61 +2008,4 @@
                                            new_origin)),points_utm)
         os.remove(filename)
-        
-
-        
-    def test_get_all_swwfiles(self):
-        try:
-            swwfiles = get_all_swwfiles('','test.txt')  #Invalid
-        except IOError:
-            pass
-        else:
-            raise 'Should have raised exception' 
-        
-    def test_get_all_swwfiles1(self):
-        
-        temp_dir = tempfile.mkdtemp('','sww_test')
-        filename0 = tempfile.mktemp('.sww','test',temp_dir)
-        filename1 = tempfile.mktemp('.sww','test',temp_dir)
-        filename2 = tempfile.mktemp('.sww','test',temp_dir)
-        filename3 = tempfile.mktemp('.sww','test',temp_dir)
-       
-        #print'filename', filename0,filename1,filename2,filename3
-        
-        fid0 = open(filename0, 'w')
-        fid1 = open(filename1, 'w')
-        fid2 = open(filename2, 'w')
-        fid3 = open(filename3, 'w')
-
-        fid0.write('hello')
-        fid1.write('hello')
-        fid2.write('hello')
-        fid3.write('hello')
-        
-        fid0.close()
-        fid1.close()
-        fid2.close()
-        fid3.close()
-        
-        
-        dir, name0 = os.path.split(filename0)
-        #print 'dir',dir,name0
-        
-        iterate=get_all_swwfiles(dir,'test')
-        
-        del_dir(temp_dir)
-#        removeall(temp_dir)
-
-        _, name0 = os.path.split(filename0) 
-        #print'name0',name0[:-4],iterate[0]    
-        _, name1 = os.path.split(filename1)       
-        _, name2 = os.path.split(filename2)       
-        _, name3 = os.path.split(filename3)       
-
-        assert name0[:-4] in iterate
-        assert name1[:-4] in iterate
-        assert name2[:-4] in iterate
-        assert name3[:-4] in iterate
-        
-        assert len(iterate)==4
 
  
@@ -2147,5 +2022,5 @@
         G.export_points_file(fileName)
         
-        polygon = points2polygon(fileName)
+        polygon = load_pts_as_polygon(fileName)
         
         # This test may fail if the order changes
@@ -2160,5 +2035,5 @@
         testfile = os.path.join(path, 'polygon_values_example.csv')                
 
-        polygons, values = csv2polygons(testfile, 
+        polygons, values = load_csv_as_polygons(testfile, 
                                         value_name='floors')
 
@@ -2237,5 +2112,5 @@
         testfile = os.path.join(path, 'polygon_values_example.csv')                
 
-        polygons, values = csv2polygons(testfile, 
+        polygons, values = load_csv_as_polygons(testfile, 
                                         value_name='floors',
                                         clipping_polygons=None)
@@ -2317,5 +2192,5 @@
         testfile = os.path.join(path, 'polygon_values_example.csv')                
 
-        polygons, values = csv2building_polygons(testfile, 
+        polygons, values = load_csv_as_building_polygons(testfile, 
                                                  floor_height=3)
 
Index: /trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py	(revision 7780)
@@ -1548,7 +1548,4 @@
         from anuga.abstract_2d_finite_volumes.mesh_factory \
                 import rectangular_cross
-        from anuga.shallow_water.shallow_water_domain import Domain
-        from anuga.shallow_water import Reflective_boundary
-        from anuga.shallow_water import Dirichlet_boundary
 
         #-----------------------------------------------------------------
@@ -6003,8 +6000,4 @@
         #---------------------------------------------------------------------
         from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
-        from anuga.shallow_water.shallow_water_domain import Domain
-        from anuga.shallow_water import Reflective_boundary
-        from anuga.shallow_water import Dirichlet_boundary
-        from anuga.shallow_water import Time_boundary
 
         #---------------------------------------------------------------------
@@ -6524,5 +6517,4 @@
         """
         from mesh_factory import rectangular
-        from shallow_water import Domain
 
         #Create basic mesh
@@ -6540,5 +6532,4 @@
         """
         from mesh_factory import rectangular
-        from shallow_water import Domain
 
         #Create basic mesh
@@ -6580,5 +6571,4 @@
         """
         from mesh_factory import rectangular
-        from shallow_water import Domain
 
         #Create basic mesh
@@ -6792,4 +6782,45 @@
 
 
+    def test_that_mesh_methods_exist(self):
+        """test_that_mesh_methods_exist
+        
+        Test that relavent mesh methods are made available in 
+        domain through composition
+        """
+
+        # Create basic mesh
+        points, vertices, boundary = rectangular(1, 3)
+
+        # Create shallow water domain
+        domain = Domain(points, vertices, boundary)                             
+        
+        
+        domain.get_centroid_coordinates()
+        domain.get_radii()
+        domain.get_areas()
+        domain.get_area()
+        domain.get_vertex_coordinates()
+        domain.get_triangles()
+        domain.get_nodes()
+        domain.get_number_of_nodes()
+        domain.get_normal(0,0)
+        domain.get_triangle_containing_point([0.4,0.5])
+        domain.get_intersecting_segments([[0.0, 0.0], [0.0, 1.0]])
+        domain.get_disconnected_triangles()
+        domain.get_boundary_tags()
+        domain.get_boundary_polygon()
+        #domain.get_number_of_triangles_per_node()
+        domain.get_triangles_and_vertices_per_node()
+        domain.get_interpolation_object()
+        domain.get_tagged_elements()
+        domain.get_lone_vertices()
+        domain.get_unique_vertices()
+        g = domain.get_georeference()
+        domain.set_georeference(g)
+        domain.build_tagged_elements_dictionary()
+        domain.statistics()
+        domain.get_extent()
+
+
 
 #################################################################################
Index: /trunk/anuga_core/source/anuga/shallow_water/test_smf.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_smf.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_smf.py	(revision 7780)
@@ -2,4 +2,5 @@
 import numpy as num
 from smf import slide_tsunami, slump_tsunami, Double_gaussian
+from shallow_water_domain import Domain
 
 class Test_smf(unittest.TestCase):
@@ -106,5 +107,4 @@
                                  verbose = False)
 
-        from anuga.shallow_water import Domain
         domain = Domain('test.msh', use_cache = True, verbose = False)
 
Index: /trunk/anuga_core/source/anuga/shallow_water/test_tsunami_okada.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_tsunami_okada.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_tsunami_okada.py	(revision 7780)
@@ -2,4 +2,5 @@
 import numpy as num
 from tsunami_okada import earthquake_tsunami,Okada_func
+from anuga.shallow_water.shallow_water_domain import Domain
 
 class Test_eq(unittest.TestCase):
@@ -14,6 +15,7 @@
         from os import sep, getenv
         import sys
-        from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
-        from anuga.shallow_water import Domain
+        from anuga.abstract_2d_finite_volumes.mesh_factory \
+        import rectangular_cross
+
         from anuga.abstract_2d_finite_volumes.quantity import Quantity
         from anuga.utilities.system_tools import get_pathname_from_package
@@ -150,6 +152,6 @@
         from os import sep, getenv
         import sys
-        from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
-        from anuga.shallow_water import Domain
+        from anuga.abstract_2d_finite_volumes.mesh_factory \
+                        import rectangular_cross
         from anuga.abstract_2d_finite_volumes.quantity import Quantity
         from anuga.utilities.system_tools import get_pathname_from_package
Index: /trunk/anuga_core/source/anuga/utilities/test_file_utils.py
===================================================================
--- /trunk/anuga_core/source/anuga/utilities/test_file_utils.py	(revision 7779)
+++ /trunk/anuga_core/source/anuga/utilities/test_file_utils.py	(revision 7780)
@@ -4,5 +4,6 @@
 import shutil
 
-from anuga.utilities.file_utils import copy_code_files
+from anuga.utilities.file_utils import copy_code_files, get_all_swwfiles
+from anuga.utilities.file_utils import del_dir
 
 
@@ -52,5 +53,59 @@
         # clean up
         shutil.rmtree(work_dir)
-            
+        
+    def test_get_all_swwfiles(self):
+        try:
+            swwfiles = get_all_swwfiles('','test.txt')  #Invalid
+        except IOError:
+            pass
+        else:
+            raise 'Should have raised exception' 
+        
+    def test_get_all_swwfiles1(self):
+        
+        temp_dir = tempfile.mkdtemp('','sww_test')
+        filename0 = tempfile.mktemp('.sww','test',temp_dir)
+        filename1 = tempfile.mktemp('.sww','test',temp_dir)
+        filename2 = tempfile.mktemp('.sww','test',temp_dir)
+        filename3 = tempfile.mktemp('.sww','test',temp_dir)
+       
+        #print'filename', filename0,filename1,filename2,filename3
+        
+        fid0 = open(filename0, 'w')
+        fid1 = open(filename1, 'w')
+        fid2 = open(filename2, 'w')
+        fid3 = open(filename3, 'w')
+
+        fid0.write('hello')
+        fid1.write('hello')
+        fid2.write('hello')
+        fid3.write('hello')
+        
+        fid0.close()
+        fid1.close()
+        fid2.close()
+        fid3.close()
+        
+        
+        dir, name0 = os.path.split(filename0)
+        #print 'dir',dir,name0
+        
+        iterate=get_all_swwfiles(dir,'test')
+        
+        del_dir(temp_dir)
+#        removeall(temp_dir)
+
+        _, name0 = os.path.split(filename0) 
+        #print'name0',name0[:-4],iterate[0]    
+        _, name1 = os.path.split(filename1)       
+        _, name2 = os.path.split(filename2)       
+        _, name3 = os.path.split(filename3)       
+
+        assert name0[:-4] in iterate
+        assert name1[:-4] in iterate
+        assert name2[:-4] in iterate
+        assert name3[:-4] in iterate
+        
+        assert len(iterate)==4            
 
 #-------------------------------------------------------------
