Index: /anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
===================================================================
--- /anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py	(revision 3845)
+++ /anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py	(revision 3846)
@@ -196,5 +196,5 @@
         from anuga.config import default_datadir
         self.datadir = default_datadir
-        self.filename = 'domain'
+        self.simulation_name = 'domain'
         self.checkpoint = False
 
@@ -633,8 +633,15 @@
 
     def get_name(self):
-        return self.filename
+        return self.simulation_name
 
     def set_name(self, name):
-        self.filename = name
+        """Assign a name to this simulation.
+        This will be used to identify the output sww file.
+
+        """
+        if name.endswith('.sww'):
+            name = name[-4:]
+            
+        self.simulation_name = name
 
     def get_datadir(self):
Index: /anuga_core/source/anuga/abstract_2d_finite_volumes/show_balanced_limiters.py
===================================================================
--- /anuga_core/source/anuga/abstract_2d_finite_volumes/show_balanced_limiters.py	(revision 3845)
+++ /anuga_core/source/anuga/abstract_2d_finite_volumes/show_balanced_limiters.py	(revision 3846)
@@ -39,5 +39,5 @@
 #domain.visualise = True
 domain.default_order = 2
-domain.filename = 'show_balanced_limiters'
+domain.set_name('show_balanced_limiters')
 domain.store = True
 domain.format = 'sww'   #Native netcdf visualisation format
Index: /anuga_core/source/anuga/damage_modelling/test_inundation_damage.py
===================================================================
--- /anuga_core/source/anuga/damage_modelling/test_inundation_damage.py	(revision 3845)
+++ /anuga_core/source/anuga/damage_modelling/test_inundation_damage.py	(revision 3846)
@@ -115,7 +115,5 @@
         
         #sww_file = tempfile.mktemp("")
-        self.domain.filename = 'datatest' + str(time.time())
-        #self.domain.filename = sww_file
-        #print "self.domain.filename",self.domain.filename 
+        self.domain.set_name('datatest' + str(time.time()))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -158,5 +156,5 @@
         # Note, this isn't testing the results,
         # just that is all runs
-        sww_file = self.domain.filename + "." + self.domain.format
+        sww_file = self.domain.get_name() + "." + self.domain.format
         #print "sww_file",sww_file 
         inundation_damage(sww_file, self.csv_file, verbose=False)
@@ -197,7 +195,5 @@
 
         #sww_file = tempfile.mktemp("")
-        domain.filename = 'datatest' + str(time.time())
-        #domain.filename = sww_file
-        #print "domain.filename",domain.filename 
+        domain.set_name('datatest' + str(time.time()))
         domain.format = 'sww'
         domain.smooth = True
@@ -222,5 +218,5 @@
         fd.close()
 
-        sww_file = domain.filename + "." + domain.format
+        sww_file = domain.get_name() + "." + domain.format
         #print "sww_file",sww_file 
         inundation_damage(sww_file, csv_file, verbose=False)
@@ -239,5 +235,5 @@
         
     def ztest_add_depth_and_momentum2csv(self):
-        sww_file = self.domain.filename + "." + self.domain.format
+        sww_file = self.domain.get_name() + "." + self.domain.format
         #print "sww_file",sww_file
         
Index: /anuga_core/source/anuga/examples/beach.py
===================================================================
--- /anuga_core/source/anuga/examples/beach.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/beach.py	(revision 3846)
@@ -37,5 +37,5 @@
 domain.default_order = 2
 print "Output being written to " + domain.get_datadir() + sep + \
-      domain.filename + domain.format
+      domain.get_name() + domain.format
 
 
Index: /anuga_core/source/anuga/examples/cornell_room.py
===================================================================
--- /anuga_core/source/anuga/examples/cornell_room.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/cornell_room.py	(revision 3846)
@@ -73,5 +73,5 @@
 else:
     s = 'nonsmooth'        
-domain.filename = root + '_' + s
+domain.set_name(root + '_' + s)
 
 #Set bed-slope and friction
Index: /anuga_core/source/anuga/examples/flatbed.py
===================================================================
--- /anuga_core/source/anuga/examples/flatbed.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/flatbed.py	(revision 3846)
@@ -25,5 +25,5 @@
 domain.set_name('polygons')
 print "Output being written to " + domain.get_datadir() + sep + \
-	      domain.filename + "_size%d." %len(domain) + domain.format
+	      domain.get_name() + "_size%d." %len(domain) + domain.format
 	
 
Index: /anuga_core/source/anuga/examples/netherlands.py
===================================================================
--- /anuga_core/source/anuga/examples/netherlands.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/netherlands.py	(revision 3846)
@@ -126,5 +126,6 @@
     #FIXME: This was os.path.splitext but caused weird filenames based on root
     base = os.path.basename(sys.argv[0])
-    domain.filename, _ = os.path.splitext(base)
+    basename, _ = os.path.splitext(base)
+    domain.set_name(basename)
 else:
     #domain.initialise_visualiser(rect=[0.0,0.0,1.0,1.0])
Index: /anuga_core/source/anuga/examples/pressure_force.py
===================================================================
--- /anuga_core/source/anuga/examples/pressure_force.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/pressure_force.py	(revision 3846)
@@ -24,5 +24,5 @@
 
 domain.store = True
-domain.filename = 'pressure'
+domain.set_name('pressure')
 
 #######################
Index: /anuga_core/source/anuga/examples/run_gong.py
===================================================================
--- /anuga_core/source/anuga/examples/run_gong.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/run_gong.py	(revision 3846)
@@ -63,8 +63,8 @@
         file_path, filename = path.split(filename)
         filename, ext = path.splitext(filename)
-        domain.filename = filename + '_' + '_ys'+ str(yieldstep) + \
-                          '_ft' + str(finaltime)
+        domain.set_name(filename + '_' + '_ys'+ str(yieldstep) + \
+                        '_ft' + str(finaltime))
         print "Output being written to " + domain.get_datadir() + sep + \
-              domain.filename + "." + domain.format
+              domain.get_name() + "." + domain.format
 
 
Index: /anuga_core/source/anuga/examples/run_tsh.py
===================================================================
--- /anuga_core/source/anuga/examples/run_tsh.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/run_tsh.py	(revision 3846)
@@ -76,8 +76,8 @@
         else:
             s = 'nonsmooth'        
-        domain.filename = filename + '_' + s + '_ys'+ str(yieldstep) + \
-                          '_ft' + str(finaltime)
+        domain.set_name(filename + '_' + s + '_ys'+ str(yieldstep) + \
+                        '_ft' + str(finaltime))
         print "Output being written to " + domain.get_datadir() + sep + \
-              domain.filename + "." + domain.format
+              domain.get_name() + "." + domain.format
 
 
Index: /anuga_core/source/anuga/examples/run_tsh_weir.py
===================================================================
--- /anuga_core/source/anuga/examples/run_tsh_weir.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/run_tsh_weir.py	(revision 3846)
@@ -41,5 +41,5 @@
 domain.store = False #True
 domain.format = 'sww'
-domain.filename = 'weir'
+domain.set_name('weir')
 domain.checkpoint = False #True
 domain.visualise = True #False
Index: /anuga_core/source/anuga/examples/twolevels.py
===================================================================
--- /anuga_core/source/anuga/examples/twolevels.py	(revision 3845)
+++ /anuga_core/source/anuga/examples/twolevels.py	(revision 3846)
@@ -25,5 +25,5 @@
 domain.set_name('two_levels')
 print "Output being written to " + domain.get_datadir() + sep + \
-	      domain.filename + "_size%d." %len(domain) + domain.format
+	      domain.get_name() + "_size%d." %len(domain) + domain.format
 	
 
Index: /anuga_core/source/anuga/fit_interpolate/test_interpolate.py
===================================================================
--- /anuga_core/source/anuga/fit_interpolate/test_interpolate.py	(revision 3845)
+++ /anuga_core/source/anuga/fit_interpolate/test_interpolate.py	(revision 3846)
@@ -1493,8 +1493,6 @@
         domain.set_quantity('stage', 1.0)
 
-        #sww_file = tempfile.mktemp("")
-        domain.filename = 'datatest' + str(time.time())
-        #domain.filename = sww_file
-        #print "domain.filename",domain.filename 
+
+        domain.set_name('datatest' + str(time.time()))
         domain.format = 'sww'
         domain.smooth = True
Index: /anuga_core/source/anuga/shallow_water/data_manager.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/data_manager.py	(revision 3845)
+++ /anuga_core/source/anuga/shallow_water/data_manager.py	(revision 3846)
@@ -212,8 +212,4 @@
 
         #Create filename
-        #self.filename = create_filename(domain.get_datadir(),
-        #domain.get_name(), extension, len(domain))
-
-
         self.filename = create_filename(domain.get_datadir(),
             domain.get_name(), extension)
@@ -429,7 +425,8 @@
             #remember the old filename, then give domain a
             #name with the extension
-            old_domain_filename = self.domain.filename
+            old_domain_filename = self.domain.get_name()
             if not self.recursion:
-                self.domain.filename = self.domain.filename+filename_ext
+                self.domain.set_name(old_domain_filename+filename_ext)
+
 
             #change the domain starttime to the current time
@@ -456,5 +453,5 @@
             #restore the old starttime and filename
             self.domain.starttime = old_domain_starttime
-            self.domain.filename = old_domain_filename
+            self.domain.set_name(old_domain_filename)            
         else:
             self.recursion = False
@@ -3563,5 +3560,5 @@
     file_path, filename = path.split(filename)
     filename, ext = path.splitext(filename)
-    domain.filename = filename
+    domain.set_name(filename)    
     domain.reduction = mean
     if verbose == True:print "file_path",file_path
@@ -3571,5 +3568,5 @@
     if verbose == True:
         print "Output written to " + domain.get_datadir() + sep + \
-              domain.filename + "." + domain.format
+              domain.get_name() + "." + domain.format
     sww = get_dataobject(domain)
     sww.store_connectivity()
Index: /anuga_core/source/anuga/shallow_water/test_data_manager.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 3845)
+++ /anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 3846)
@@ -162,6 +162,6 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
-        self.domain.format = 'sww'
+        self.domain.set_name('datatest' + str(id(self)))
+        self.domain.format = 'sww' #Remove??
         self.domain.smooth = False
 
@@ -209,5 +209,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -266,5 +266,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -321,5 +321,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -376,5 +376,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -432,5 +432,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'synctest'
+        self.domain.set_name('synctest')
         self.domain.format = 'sww'
         self.domain.smooth = False
@@ -467,5 +467,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -515,5 +515,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -1136,9 +1136,9 @@
 
         #Setup
-        self.domain.filename = 'datatest'
-
-        prjfile = self.domain.filename + '_elevation.prj'
-        ascfile = self.domain.filename + '_elevation.asc'
-        swwfile = self.domain.filename + '.sww'
+        self.domain.set_name('datatest')
+
+        prjfile = self.domain.get_name() + '_elevation.prj'
+        ascfile = self.domain.get_name() + '_elevation.asc'
+        swwfile = self.domain.get_name() + '.sww'
 
         self.domain.set_datadir('.')
@@ -1171,5 +1171,5 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.filename,
+        sww2dem(self.domain.get_name(),
                 quantity = 'elevation',
                 cellsize = cellsize,
@@ -1303,9 +1303,9 @@
         domain.default_order = 2
 
-        domain.filename = 'datatest'
-
-        prjfile = domain.filename + '_elevation.prj'
-        ascfile = domain.filename + '_elevation.asc'
-        swwfile = domain.filename + '.sww'
+        domain.set_name('datatest')
+
+        prjfile = domain.get_name() + '_elevation.prj'
+        ascfile = domain.get_name() + '_elevation.asc'
+        swwfile = domain.get_name() + '.sww'
 
         domain.set_datadir('.')
@@ -1347,5 +1347,5 @@
 
         #Export to ascii/prj files
-        sww2dem(domain.filename,
+        sww2dem(domain.get_name(),
                 quantity = 'elevation',
                 cellsize = cellsize,
@@ -1487,9 +1487,9 @@
         domain.default_order = 2
 
-        domain.filename = 'datatest'
-
-        prjfile = domain.filename + '_elevation.prj'
-        ascfile = domain.filename + '_elevation.asc'
-        swwfile = domain.filename + '.sww'
+        domain.set_name('datatest')
+
+        prjfile = domain.get_name() + '_elevation.prj'
+        ascfile = domain.get_name() + '_elevation.asc'
+        swwfile = domain.get_name() + '.sww'
 
         domain.set_datadir('.')
@@ -1531,5 +1531,5 @@
 
         #Export to ascii/prj files
-        sww2dem(domain.filename,
+        sww2dem(domain.get_name(),
                 quantity = 'elevation',
                 cellsize = cellsize,
@@ -1641,9 +1641,9 @@
 
         #Setup
-        self.domain.filename = 'datatest'
-
-        prjfile = self.domain.filename + '_stage.prj'
-        ascfile = self.domain.filename + '_stage.asc'
-        swwfile = self.domain.filename + '.sww'
+        self.domain.set_name('datatest')
+
+        prjfile = self.domain.get_name() + '_stage.prj'
+        ascfile = self.domain.get_name() + '_stage.asc'
+        swwfile = self.domain.get_name() + '.sww'
 
         self.domain.set_datadir('.')
@@ -1677,9 +1677,9 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.filename,
+        sww2dem(self.domain.get_name(),
                 quantity = 'stage',
                 cellsize = cellsize,
                 reduction = min,
-		format = 'asc')
+                format = 'asc')
 
 
@@ -1750,9 +1750,9 @@
 
         #Setup
-        self.domain.filename = 'datatest'
-
-        prjfile = self.domain.filename + '_depth.prj'
-        ascfile = self.domain.filename + '_depth.asc'
-        swwfile = self.domain.filename + '.sww'
+        self.domain.set_name('datatest')
+
+        prjfile = self.domain.get_name() + '_depth.prj'
+        ascfile = self.domain.get_name() + '_depth.asc'
+        swwfile = self.domain.get_name() + '.sww'
 
         self.domain.set_datadir('.')
@@ -1787,10 +1787,10 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.filename,
+        sww2dem(self.domain.get_name(),
                 basename_out = 'datatest_depth',
                 quantity = 'stage - elevation',
                 cellsize = cellsize,
                 reduction = min,
-		format = 'asc',
+                format = 'asc',
                 verbose = False)
 
@@ -1905,9 +1905,9 @@
         domain.distribute_to_vertices_and_edges()
 
-        domain.filename = 'datatest'
-
-        prjfile = domain.filename + '_elevation.prj'
-        ascfile = domain.filename + '_elevation.asc'
-        swwfile = domain.filename + '.sww'
+        domain.set_name('datatest')
+
+        prjfile = domain.get_name() + '_elevation.prj'
+        ascfile = domain.get_name() + '_elevation.asc'
+        swwfile = domain.get_name() + '.sww'
 
         domain.set_datadir('.')
@@ -1939,9 +1939,9 @@
 
         #Export to ascii/prj files
-        sww2dem(domain.filename,
+        sww2dem(domain.get_name(),
                 quantity = 'elevation',
                 cellsize = cellsize,
                 verbose = False,
-		format = 'asc')
+                format = 'asc')
 
 
@@ -2011,8 +2011,8 @@
 
         #Setup
-        self.domain.filename = 'datatest'
-
-        headerfile = self.domain.filename + '.ers'
-        swwfile = self.domain.filename + '.sww'
+        self.domain.set_name('datatest')
+
+        headerfile = self.domain.get_name() + '.ers'
+        swwfile = self.domain.get_name() + '.sww'
 
         self.domain.set_datadir('.')
@@ -2045,15 +2045,15 @@
 
         #Export to ers files
-        sww2dem(self.domain.filename,
+        sww2dem(self.domain.get_name(),
                 quantity = 'elevation',
                 cellsize = cellsize,
                 NODATA_value = NODATA_value,
                 verbose = False,
-		format = 'ers')
+                format = 'ers')
 
         #Check header data
-	from ermapper_grids import read_ermapper_header, read_ermapper_data
-
-	header = read_ermapper_header(self.domain.filename + '_elevation.ers')
+        from ermapper_grids import read_ermapper_header, read_ermapper_data
+
+        header = read_ermapper_header(self.domain.get_name() + '_elevation.ers')
         #print header
         assert header['projection'].lower() == '"utm-56"'
@@ -2068,20 +2068,20 @@
         assert int(header['nrofcellsperline']) == 5
         assert int(header['nullcellvalue']) == NODATA_value
-	#FIXME - there is more in the header
+        #FIXME - there is more in the header
 
 
         #Check grid data
-        grid = read_ermapper_data(self.domain.filename + '_elevation')
-
-	#FIXME (Ole): Why is this the desired reference grid for -x-y?
-	ref_grid = [NODATA_value, NODATA_value, NODATA_value, NODATA_value, NODATA_value,
-	            -1,    -1.25, -1.5,  -1.75, -2.0,
-	            -0.75, -1.0,  -1.25, -1.5,  -1.75,
-		    -0.5,  -0.75, -1.0,  -1.25, -1.5,
-		    -0.25, -0.5,  -0.75, -1.0,  -1.25]
+        grid = read_ermapper_data(self.domain.get_name() + '_elevation')
+
+        #FIXME (Ole): Why is this the desired reference grid for -x-y?
+        ref_grid = [NODATA_value, NODATA_value, NODATA_value, NODATA_value, NODATA_value,
+                    -1,    -1.25, -1.5,  -1.75, -2.0,
+                    -0.75, -1.0,  -1.25, -1.5,  -1.75,
+                    -0.5,  -0.75, -1.0,  -1.25, -1.5,
+                    -0.25, -0.5,  -0.75, -1.0,  -1.25]
 
 
         #print grid
-	assert allclose(grid, ref_grid)
+        assert allclose(grid, ref_grid)
 
         fid.close()
@@ -2091,6 +2091,6 @@
         #Done (Ole) - it was because sww2ers didn't close it's sww file
         os.remove(sww.filename)
-        os.remove(self.domain.filename + '_elevation')
-        os.remove(self.domain.filename + '_elevation.ers')
+        os.remove(self.domain.get_name() + '_elevation')
+        os.remove(self.domain.get_name() + '_elevation.ers')
 
 
@@ -2110,8 +2110,8 @@
 
         # Setup
-        self.domain.filename = 'datatest'
-
-        ptsfile = self.domain.filename + '_elevation.pts'
-        swwfile = self.domain.filename + '.sww'
+        self.domain.set_name('datatest')
+
+        ptsfile = self.domain.get_name() + '_elevation.pts'
+        swwfile = self.domain.get_name() + '.sww'
 
         self.domain.set_datadir('.')
@@ -2144,5 +2144,5 @@
         # Invoke interpolation for vertex points       
         points = concatenate( (x[:,NewAxis],y[:,NewAxis]), axis=1 )
-        sww2pts(self.domain.filename,
+        sww2pts(self.domain.get_name(),
                 quantity = 'elevation',
                 data_points = points,
@@ -2153,5 +2153,5 @@
         #print 'P', point_values
         #print 'Ref', ref_point_values        
-	assert allclose(point_values, ref_point_values)        
+        assert allclose(point_values, ref_point_values)        
 
 
@@ -2160,5 +2160,5 @@
         points = self.domain.get_centroid_coordinates()
         #print points
-        sww2pts(self.domain.filename,
+        sww2pts(self.domain.get_name(),
                 quantity = 'elevation',
                 data_points = points,
@@ -2171,5 +2171,5 @@
         #print 'P', point_values
         #print 'Ref', ref_point_values        
-	assert allclose(point_values, ref_point_values)        
+        assert allclose(point_values, ref_point_values)        
 
 
@@ -2233,8 +2233,8 @@
         #Check first value
         stage = fid.variables['stage'][:]
-	xmomentum = fid.variables['xmomentum'][:]
-	ymomentum = fid.variables['ymomentum'][:]
-
-	#print ymomentum
+        xmomentum = fid.variables['xmomentum'][:]
+        ymomentum = fid.variables['ymomentum'][:]
+
+        #print ymomentum
 
         assert allclose(stage[0,0], first_value/100)  #Meters
@@ -2351,36 +2351,36 @@
 
         for fid in [fid1,fid2,fid3]:
-	    fid.createDimension(long_name,nx)
-	    fid.createVariable(long_name,'d',(long_name,))
-	    fid.variables[long_name].point_spacing='uneven'
-	    fid.variables[long_name].units='degrees_east'
-	    fid.variables[long_name].assignValue(h1_list)
-
-	    fid.createDimension(lat_name,ny)
-	    fid.createVariable(lat_name,'d',(lat_name,))
-	    fid.variables[lat_name].point_spacing='uneven'
-	    fid.variables[lat_name].units='degrees_north'
-	    fid.variables[lat_name].assignValue(h2_list)
-
-	    fid.createDimension(time_name,2)
-	    fid.createVariable(time_name,'d',(time_name,))
-	    fid.variables[time_name].point_spacing='uneven'
-	    fid.variables[time_name].units='seconds'
-	    fid.variables[time_name].assignValue([0.,1.])
-	    if fid == fid3: break
+            fid.createDimension(long_name,nx)
+            fid.createVariable(long_name,'d',(long_name,))
+            fid.variables[long_name].point_spacing='uneven'
+            fid.variables[long_name].units='degrees_east'
+            fid.variables[long_name].assignValue(h1_list)
+
+            fid.createDimension(lat_name,ny)
+            fid.createVariable(lat_name,'d',(lat_name,))
+            fid.variables[lat_name].point_spacing='uneven'
+            fid.variables[lat_name].units='degrees_north'
+            fid.variables[lat_name].assignValue(h2_list)
+
+            fid.createDimension(time_name,2)
+            fid.createVariable(time_name,'d',(time_name,))
+            fid.variables[time_name].point_spacing='uneven'
+            fid.variables[time_name].units='seconds'
+            fid.variables[time_name].assignValue([0.,1.])
+            if fid == fid3: break
 
 
         for fid in [fid4]:
-	    fid.createDimension(long_name,nx)
-	    fid.createVariable(long_name,'d',(long_name,))
-	    fid.variables[long_name].point_spacing='uneven'
-	    fid.variables[long_name].units='degrees_east'
-	    fid.variables[long_name].assignValue(h1_list)
-
-	    fid.createDimension(lat_name,ny)
-	    fid.createVariable(lat_name,'d',(lat_name,))
-	    fid.variables[lat_name].point_spacing='uneven'
-	    fid.variables[lat_name].units='degrees_north'
-	    fid.variables[lat_name].assignValue(h2_list)
+            fid.createDimension(long_name,nx)
+            fid.createVariable(long_name,'d',(long_name,))
+            fid.variables[long_name].point_spacing='uneven'
+            fid.variables[long_name].units='degrees_east'
+            fid.variables[long_name].assignValue(h1_list)
+
+            fid.createDimension(lat_name,ny)
+            fid.createVariable(lat_name,'d',(lat_name,))
+            fid.variables[lat_name].point_spacing='uneven'
+            fid.variables[lat_name].units='degrees_north'
+            fid.variables[lat_name].assignValue(h2_list)
 
         name = {}
@@ -2515,36 +2515,36 @@
 
         for fid in [fid1,fid2,fid3]:
-	    fid.createDimension(long_name,nx)
-	    fid.createVariable(long_name,'d',(long_name,))
-	    fid.variables[long_name].point_spacing='uneven'
-	    fid.variables[long_name].units='degrees_east'
-	    fid.variables[long_name].assignValue(h1_list)
-
-	    fid.createDimension(lat_name,ny)
-	    fid.createVariable(lat_name,'d',(lat_name,))
-	    fid.variables[lat_name].point_spacing='uneven'
-	    fid.variables[lat_name].units='degrees_north'
-	    fid.variables[lat_name].assignValue(h2_list)
-
-	    fid.createDimension(time_name,2)
-	    fid.createVariable(time_name,'d',(time_name,))
-	    fid.variables[time_name].point_spacing='uneven'
-	    fid.variables[time_name].units='seconds'
-	    fid.variables[time_name].assignValue([0.,1.])
-	    if fid == fid3: break
+            fid.createDimension(long_name,nx)
+            fid.createVariable(long_name,'d',(long_name,))
+            fid.variables[long_name].point_spacing='uneven'
+            fid.variables[long_name].units='degrees_east'
+            fid.variables[long_name].assignValue(h1_list)
+
+            fid.createDimension(lat_name,ny)
+            fid.createVariable(lat_name,'d',(lat_name,))
+            fid.variables[lat_name].point_spacing='uneven'
+            fid.variables[lat_name].units='degrees_north'
+            fid.variables[lat_name].assignValue(h2_list)
+
+            fid.createDimension(time_name,2)
+            fid.createVariable(time_name,'d',(time_name,))
+            fid.variables[time_name].point_spacing='uneven'
+            fid.variables[time_name].units='seconds'
+            fid.variables[time_name].assignValue([0.,1.])
+            if fid == fid3: break
 
 
         for fid in [fid4]:
-	    fid.createDimension(long_name,nx)
-	    fid.createVariable(long_name,'d',(long_name,))
-	    fid.variables[long_name].point_spacing='uneven'
-	    fid.variables[long_name].units='degrees_east'
-	    fid.variables[long_name].assignValue(h1_list)
-
-	    fid.createDimension(lat_name,ny)
-	    fid.createVariable(lat_name,'d',(lat_name,))
-	    fid.variables[lat_name].point_spacing='uneven'
-	    fid.variables[lat_name].units='degrees_north'
-	    fid.variables[lat_name].assignValue(h2_list)
+            fid.createDimension(long_name,nx)
+            fid.createVariable(long_name,'d',(long_name,))
+            fid.variables[long_name].point_spacing='uneven'
+            fid.variables[long_name].units='degrees_east'
+            fid.variables[long_name].assignValue(h1_list)
+
+            fid.createDimension(lat_name,ny)
+            fid.createVariable(lat_name,'d',(lat_name,))
+            fid.variables[lat_name].point_spacing='uneven'
+            fid.variables[lat_name].units='degrees_north'
+            fid.variables[lat_name].assignValue(h2_list)
 
         name = {}
@@ -2575,5 +2575,5 @@
 
         for fid in [fid4]:
-	    fid.createVariable(name[fid],'d',(lat_name,long_name))
+            fid.createVariable(name[fid],'d',(lat_name,long_name))
             fid.variables[name[fid]].point_spacing='uneven'
             fid.variables[name[fid]].units=units[fid]
@@ -2677,5 +2677,5 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(id(self))
+        self.domain.set_name('datatest' + str(id(self)))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -2695,5 +2695,5 @@
         sww.store_timestep('stage')
 
-        file_and_extension_name = self.domain.filename + ".sww"
+        file_and_extension_name = self.domain.get_name() + ".sww"
         #print "file_and_extension_name",file_and_extension_name
         [xmin, xmax, ymin, ymax, stagemin, stagemax] = \
@@ -2731,5 +2731,5 @@
         domain.visualise = False
         domain.store = True
-        domain.filename = 'bedslope'
+        domain.set_name('bedslope')
         domain.default_order=2
         #Bed-slope and friction
@@ -2766,5 +2766,5 @@
         import os
 
-        filename = domain.datadir+os.sep+domain.filename+'.sww'
+        filename = domain.datadir + os.sep + domain.get_name() + '.sww'
         domain2 = sww2domain(filename,None,fail_if_NaN=False,verbose = False)
         #points, vertices, boundary = rectangular(15,15)
@@ -2774,5 +2774,5 @@
         ###################
 
-        #os.remove(domain.filename + '.sww')
+        #os.remove(domain.get_name() + '.sww')
         os.remove(filename)
 
@@ -2856,65 +2856,65 @@
 
     def test_sww2domain2(self):
-	##################################################################
-	#Same as previous test, but this checks how NaNs are handled.
-	##################################################################
-
-
-	from mesh_factory import rectangular
-	from Numeric import array
-
-	#Create basic mesh
-	points, vertices, boundary = rectangular(2,2)
-
-	#Create shallow water domain
-	domain = Domain(points, vertices, boundary)
-	domain.smooth = False
-	domain.visualise = False
-	domain.store = True
-	domain.set_name('test_file')
+        ##################################################################
+        #Same as previous test, but this checks how NaNs are handled.
+        ##################################################################
+
+
+        from mesh_factory import rectangular
+        from Numeric import array
+
+        #Create basic mesh
+        points, vertices, boundary = rectangular(2,2)
+
+        #Create shallow water domain
+        domain = Domain(points, vertices, boundary)
+        domain.smooth = False
+        domain.visualise = False
+        domain.store = True
+        domain.set_name('test_file')
         domain.set_datadir('.')
-	domain.default_order=2
-	domain.quantities_to_be_stored=['stage']
-
-	domain.set_quantity('elevation', lambda x,y: -x/3)
-	domain.set_quantity('friction', 0.1)
-
-	from math import sin, pi
-	Br = Reflective_boundary(domain)
-	Bt = Transmissive_boundary(domain)
-	Bd = Dirichlet_boundary([0.2,0.,0.])
-	Bw = Time_boundary(domain=domain,
-			   f=lambda t: [(0.1*sin(t*2*pi)), 0.0, 0.0])
-
-	domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})
-
-	h = 0.05
-	elevation = domain.quantities['elevation'].vertex_values
-	domain.set_quantity('stage', elevation + h)
-
-	domain.check_integrity()
-
-	for t in domain.evolve(yieldstep = 1, finaltime = 2.0):
-	    pass
-	    #domain.write_time()
+        domain.default_order=2
+        domain.quantities_to_be_stored=['stage']
+
+        domain.set_quantity('elevation', lambda x,y: -x/3)
+        domain.set_quantity('friction', 0.1)
+
+        from math import sin, pi
+        Br = Reflective_boundary(domain)
+        Bt = Transmissive_boundary(domain)
+        Bd = Dirichlet_boundary([0.2,0.,0.])
+        Bw = Time_boundary(domain=domain,
+                           f=lambda t: [(0.1*sin(t*2*pi)), 0.0, 0.0])
+
+        domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})
+
+        h = 0.05
+        elevation = domain.quantities['elevation'].vertex_values
+        domain.set_quantity('stage', elevation + h)
+
+        domain.check_integrity()
+
+        for t in domain.evolve(yieldstep = 1, finaltime = 2.0):
+            pass
+            #domain.write_time()
 
 
 
         ##################################
-	#Import the file as a new domain
+        #Import the file as a new domain
         ##################################
-	from data_manager import sww2domain
-	from Numeric import allclose
+        from data_manager import sww2domain
+        from Numeric import allclose
         import os
 
-	filename = domain.datadir+os.sep+domain.filename+'.sww'
-
-	#Fail because NaNs are present
-	try:
-	    domain2 = sww2domain(filename,boundary,fail_if_NaN=True,verbose=False)
-	except:
-	    #Now import it, filling NaNs to be 0
-	    filler = 0
-	    domain2 = sww2domain(filename,None,fail_if_NaN=False,NaN_filler = filler,verbose=False)
+        filename = domain.datadir + os.sep + domain.get_name() + '.sww'
+
+        #Fail because NaNs are present
+        try:
+            domain2 = sww2domain(filename,boundary,fail_if_NaN=True,verbose=False)
+        except:
+            #Now import it, filling NaNs to be 0
+            filler = 0
+            domain2 = sww2domain(filename,None,fail_if_NaN=False,NaN_filler = filler,verbose=False)
 
         #Clean up
@@ -2926,21 +2926,21 @@
                 'vertex_coordinates']
 
-	for quantity in ['elevation']+domain.quantities_to_be_stored:
-	    bits.append('get_quantity("%s").get_integral()' %quantity)
-	    bits.append('get_quantity("%s").get_values()' %quantity)
-
-	for bit in bits:
-	#    print 'testing that domain.'+bit+' has been restored'
-	    assert allclose(eval('domain.'+bit),eval('domain2.'+bit))
-
-	assert max(max(domain2.get_quantity('xmomentum').get_values()))==filler
-	assert min(min(domain2.get_quantity('xmomentum').get_values()))==filler
-	assert max(max(domain2.get_quantity('ymomentum').get_values()))==filler
-	assert min(min(domain2.get_quantity('ymomentum').get_values()))==filler
+        for quantity in ['elevation']+domain.quantities_to_be_stored:
+            bits.append('get_quantity("%s").get_integral()' %quantity)
+            bits.append('get_quantity("%s").get_values()' %quantity)
+
+        for bit in bits:
+        #    print 'testing that domain.'+bit+' has been restored'
+            assert allclose(eval('domain.'+bit),eval('domain2.'+bit))
+
+        assert max(max(domain2.get_quantity('xmomentum').get_values()))==filler
+        assert min(min(domain2.get_quantity('xmomentum').get_values()))==filler
+        assert max(max(domain2.get_quantity('ymomentum').get_values()))==filler
+        assert min(min(domain2.get_quantity('ymomentum').get_values()))==filler
 
 
 
     #def test_weed(self):
-	from data_manager import weed
+        from data_manager import weed
 
         coordinates1 = [[0.,0.],[1.,0.],[1.,1.],[1.,0.],[2.,0.],[1.,1.]]
@@ -2965,81 +2965,81 @@
     #FIXME This fails - smooth makes the comparism too hard for allclose
     def ztest_sww2domain3(self):
-	################################################
-	#DOMAIN.SMOOTH = TRUE !!!!!!!!!!!!!!!!!!!!!!!!!!
-	################################################
-	from mesh_factory import rectangular
-	from Numeric import array
-	#Create basic mesh
+        ################################################
+        #DOMAIN.SMOOTH = TRUE !!!!!!!!!!!!!!!!!!!!!!!!!!
+        ################################################
+        from mesh_factory import rectangular
+        from Numeric import array
+        #Create basic mesh
 
         yiel=0.01
-	points, vertices, boundary = rectangular(10,10)
-
-	#Create shallow water domain
-	domain = Domain(points, vertices, boundary)
+        points, vertices, boundary = rectangular(10,10)
+
+        #Create shallow water domain
+        domain = Domain(points, vertices, boundary)
         domain.geo_reference = Geo_reference(56,11,11)
-	domain.smooth = True
-	domain.visualise = False
-	domain.store = True
-	domain.filename = 'bedslope'
-	domain.default_order=2
-	#Bed-slope and friction
-	domain.set_quantity('elevation', lambda x,y: -x/3)
-	domain.set_quantity('friction', 0.1)
-	# Boundary conditions
-	from math import sin, pi
-	Br = Reflective_boundary(domain)
-	Bt = Transmissive_boundary(domain)
-	Bd = Dirichlet_boundary([0.2,0.,0.])
- 	Bw = Time_boundary(domain=domain,
-			   f=lambda t: [(0.1*sin(t*2*pi)), 0.0, 0.0])
-
-	domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd})
-
-	domain.quantities_to_be_stored.extend(['xmomentum','ymomentum'])
-	#Initial condition
-	h = 0.05
-	elevation = domain.quantities['elevation'].vertex_values
-	domain.set_quantity('stage', elevation + h)
-
-
-	domain.check_integrity()
-	#Evolution
-	for t in domain.evolve(yieldstep = yiel, finaltime = 0.05):
-	#    domain.write_time()
-	    pass
-
-
-	##########################################
-	#Import the example's file as a new domain
-	##########################################
-	from data_manager import sww2domain
-	from Numeric import allclose
+        domain.smooth = True
+        domain.visualise = False
+        domain.store = True
+        domain.set_name('bedslope')
+        domain.default_order=2
+        #Bed-slope and friction
+        domain.set_quantity('elevation', lambda x,y: -x/3)
+        domain.set_quantity('friction', 0.1)
+        # Boundary conditions
+        from math import sin, pi
+        Br = Reflective_boundary(domain)
+        Bt = Transmissive_boundary(domain)
+        Bd = Dirichlet_boundary([0.2,0.,0.])
+        Bw = Time_boundary(domain=domain,
+                           f=lambda t: [(0.1*sin(t*2*pi)), 0.0, 0.0])
+
+        domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd})
+
+        domain.quantities_to_be_stored.extend(['xmomentum','ymomentum'])
+        #Initial condition
+        h = 0.05
+        elevation = domain.quantities['elevation'].vertex_values
+        domain.set_quantity('stage', elevation + h)
+
+
+        domain.check_integrity()
+        #Evolution
+        for t in domain.evolve(yieldstep = yiel, finaltime = 0.05):
+        #    domain.write_time()
+            pass
+
+
+        ##########################################
+        #Import the example's file as a new domain
+        ##########################################
+        from data_manager import sww2domain
+        from Numeric import allclose
         import os
 
-	filename = domain.datadir+os.sep+domain.filename+'.sww'
-	domain2 = sww2domain(filename,None,fail_if_NaN=False,verbose = False)
-	#points, vertices, boundary = rectangular(15,15)
+        filename = domain.datadir + os.sep + domain.get_name() + '.sww'
+        domain2 = sww2domain(filename,None,fail_if_NaN=False,verbose = False)
+        #points, vertices, boundary = rectangular(15,15)
         #domain2.boundary = boundary
         ###################
-	##NOW TEST IT!!!
+        ##NOW TEST IT!!!
         ###################
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
         #FIXME smooth domain so that they can be compared
 
 
-	bits = []#'vertex_coordinates']
-	for quantity in ['elevation']+domain.quantities_to_be_stored:
-	    bits.append('quantities["%s"].get_integral()'%quantity)
-
-
-	for bit in bits:
-	    #print 'testing that domain.'+bit+' has been restored'
+        bits = []#'vertex_coordinates']
+        for quantity in ['elevation']+domain.quantities_to_be_stored:
+            bits.append('quantities["%s"].get_integral()'%quantity)
+
+
+        for bit in bits:
+            #print 'testing that domain.'+bit+' has been restored'
             #print bit
             #print 'done'
             #print ('domain.'+bit), eval('domain.'+bit)
             #print ('domain2.'+bit), eval('domain2.'+bit)
-	    assert allclose(eval('domain.'+bit),eval('domain2.'+bit),rtol=1.0e-1,atol=1.e-3)
+            assert allclose(eval('domain.'+bit),eval('domain2.'+bit),rtol=1.0e-1,atol=1.e-3)
             pass
 
@@ -3049,5 +3049,5 @@
         visualise = False
         visualise = True
-	domain.visualise = visualise
+        domain.visualise = visualise
         domain.time = 0.
         from time import sleep
@@ -3055,49 +3055,49 @@
         final = .5
         domain.set_quantity('friction', 0.1)
-	domain.store = False
-	domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Br})
-
-	for t in domain.evolve(yieldstep = yiel, finaltime = final):
+        domain.store = False
+        domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Br})
+
+        for t in domain.evolve(yieldstep = yiel, finaltime = final):
             if visualise: sleep(.03)
-	    #domain.write_time()
-	    pass
-
-	domain2.smooth = True
-	domain2.visualise = visualise
-	domain2.store = False
-	domain2.default_order=2
-	domain2.set_quantity('friction', 0.1)
-	#Bed-slope and friction
-	# Boundary conditions
+            #domain.write_time()
+            pass
+
+        domain2.smooth = True
+        domain2.visualise = visualise
+        domain2.store = False
+        domain2.default_order=2
+        domain2.set_quantity('friction', 0.1)
+        #Bed-slope and friction
+        # Boundary conditions
         Bd2=Dirichlet_boundary([0.2,0.,0.])
-	Br2 = Reflective_boundary(domain2)
+        Br2 = Reflective_boundary(domain2)
         domain2.boundary = domain.boundary
         #print 'domain2.boundary'
         #print domain2.boundary
-	domain2.set_boundary({'left': Bd2, 'right': Bd2, 'top': Bd2, 'bottom': Br2})
+        domain2.set_boundary({'left': Bd2, 'right': Bd2, 'top': Bd2, 'bottom': Br2})
         #domain2.boundary = domain.boundary
-	#domain2.set_boundary({'exterior': Bd})
-
-	domain2.check_integrity()
-
-	for t in domain2.evolve(yieldstep = yiel, finaltime = final):
+        #domain2.set_boundary({'exterior': Bd})
+
+        domain2.check_integrity()
+
+        for t in domain2.evolve(yieldstep = yiel, finaltime = final):
             if visualise: sleep(.03)
-	    #domain2.write_time()
-	    pass
+            #domain2.write_time()
+            pass
 
         ###################
-	##NOW TEST IT!!!
+        ##NOW TEST IT!!!
         ##################
 
         print '><><><><>>'
-	bits = [ 'vertex_coordinates']
-
-	for quantity in ['elevation','xmomentum','ymomentum']:#+domain.quantities_to_be_stored:
-	    #bits.append('quantities["%s"].get_integral()'%quantity)
-	    bits.append('get_quantity("%s").get_values()' %quantity)
-
-	for bit in bits:
+        bits = [ 'vertex_coordinates']
+
+        for quantity in ['elevation','xmomentum','ymomentum']:#+domain.quantities_to_be_stored:
+            #bits.append('quantities["%s"].get_integral()'%quantity)
+            bits.append('get_quantity("%s").get_values()' %quantity)
+
+        for bit in bits:
             print bit
-	    assert allclose(eval('domain.'+bit),eval('domain2.'+bit))
+            assert allclose(eval('domain.'+bit),eval('domain2.'+bit))
 
 
@@ -3289,15 +3289,15 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-	# the memory optimised least squares
-	#  cellsize = 20,   # this one seems to hang
-	#  cellsize = 200000, # Ran 1 test in 269.703s
-				#Ran 1 test in 267.344s
-	#  cellsize = 20000,  # Ran 1 test in 460.922s
-	#  cellsize = 2000   #Ran 1 test in 5340.250s
-	#  cellsize = 200   #this one seems to hang, building matirx A
-
-	# not optimised
-	# seems to hang
-	#  cellsize = 2000   # Ran 1 test in 5334.563s
+        # the memory optimised least squares
+        #  cellsize = 20,   # this one seems to hang
+        #  cellsize = 200000, # Ran 1 test in 269.703s
+                                #Ran 1 test in 267.344s
+        #  cellsize = 20000,  # Ran 1 test in 460.922s
+        #  cellsize = 2000   #Ran 1 test in 5340.250s
+        #  cellsize = 200   #this one seems to hang, building matirx A
+
+        # not optimised
+        # seems to hang
+        #  cellsize = 2000   # Ran 1 test in 5334.563s
         #Export to ascii/prj files
         sww2dem('karratha_100m',
@@ -4675,8 +4675,8 @@
         #Check first value
         stage = fid.variables['stage'][:]
-	xmomentum = fid.variables['xmomentum'][:]
-	ymomentum = fid.variables['ymomentum'][:]
-
-	#print ymomentum
+        xmomentum = fid.variables['xmomentum'][:]
+        ymomentum = fid.variables['ymomentum'][:]
+
+        #print ymomentum
         assert allclose(stage[0,0], e +tide)  #Meters
 
Index: /anuga_core/source/anuga/shallow_water/test_interpolate_sww.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/test_interpolate_sww.py	(revision 3845)
+++ /anuga_core/source/anuga/shallow_water/test_interpolate_sww.py	(revision 3846)
@@ -80,5 +80,8 @@
         from Scientific.IO.NetCDF import NetCDFFile
 
-        self.domain.filename = 'datatest' + str(time.time())
+        #FIXME (Ole): This test still passes if commented out
+        #self.domain.set_name('datatest' + str(time.time()))
+        
+        
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -148,5 +151,5 @@
              concatinate_attributelist
 
-        self.domain.filename = 'datatest' + str(time.time())
+        self.domain.set_name('datatest' + str(time.time()))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -159,5 +162,4 @@
         sww.store_timestep('stage')
 
-        #print "self.domain.filename",self.domain.filename
         interp = Interpolate_sww(sww.filename, 'depth')
 
@@ -267,5 +269,5 @@
              concatinate_attributelist
 
-        self.domain.filename = 'datatest' + str(time.time())
+        self.domain.set_name('datatest' + str(time.time()))
         self.domain.format = 'sww'
         self.domain.smooth = True
@@ -279,5 +281,5 @@
         
         try:
-            interpolate_sww2xya(self.domain.filename,
+            interpolate_sww2xya(self.domain.get_name(),
                                 'stage','yeah','yeah.x',
                                 verbose = False)
Index: /anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py	(revision 3845)
+++ /anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py	(revision 3846)
@@ -1106,5 +1106,5 @@
                 assert not allclose(stage, initial_stage)
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
 
@@ -1626,10 +1626,10 @@
         L = domain.quantities['stage'].vertex_values
 
-	#First order
+        #First order
         domain._order_ = 1
         domain.distribute_to_vertices_and_edges()
-	assert allclose(L[1], val1)
-
-	#Second order
+        assert allclose(L[1], val1)
+
+        #Second order
         domain._order_ = 2
         domain.beta_w      = 0.9
@@ -1640,5 +1640,5 @@
         domain.beta_vh_dry = 0.9
         domain.distribute_to_vertices_and_edges()
-	assert allclose(L[1], [2.2, 4.9, 4.9])
+        assert allclose(L[1], [2.2, 4.9, 4.9])
 
 
@@ -1662,12 +1662,12 @@
         L = domain.quantities['stage'].vertex_values
 
-	def stage(x,y):
+        def stage(x,y):
             return x**2
 
-	domain.set_quantity('stage', stage, location='centroids')
+        domain.set_quantity('stage', stage, location='centroids')
 
         a, b = domain.quantities['stage'].compute_gradients()
-	assert allclose(a[1], 3.33333334)
-	assert allclose(b[1], 0.0)
+        assert allclose(a[1], 3.33333334)
+        assert allclose(b[1], 0.0)
 
         domain._order_ = 1
@@ -1705,13 +1705,13 @@
         L = domain.quantities['stage'].vertex_values
 
-	def stage(x,y):
+        def stage(x,y):
             return x**4+y**2
 
-	domain.set_quantity('stage', stage, location='centroids')
+        domain.set_quantity('stage', stage, location='centroids')
         #print domain.quantities['stage'].centroid_values
 
         a, b = domain.quantities['stage'].compute_gradients()
-	assert allclose(a[1], 25.18518519)
-	assert allclose(b[1], 3.33333333)
+        assert allclose(a[1], 25.18518519)
+        assert allclose(b[1], 3.33333333)
 
         domain._order_ = 1
@@ -1769,10 +1769,10 @@
         domain._order_ = 1
         domain.distribute_to_vertices_and_edges()
-	##assert allclose(L[1], [0.19999999, 20.05, 20.05])
-	assert allclose(L[1], [0.1, 20.1, 20.1])
+        ##assert allclose(L[1], [0.19999999, 20.05, 20.05])
+        assert allclose(L[1], [0.1, 20.1, 20.1])
 
         domain._order_ = 2
         domain.distribute_to_vertices_and_edges()
-	assert allclose(L[1], [0.1, 20.1, 20.1])
+        assert allclose(L[1], [0.1, 20.1, 20.1])
 
     def test_distribute_near_bed1(self):
@@ -1814,10 +1814,10 @@
         domain._order_ = 1
         domain.distribute_to_vertices_and_edges()
-	##assert allclose(L[1], [4.19999999, 16.07142857, 20.02857143])
-	assert allclose(L[1], [4.1, 16.1, 20.1])
+        ##assert allclose(L[1], [4.19999999, 16.07142857, 20.02857143])
+        assert allclose(L[1], [4.1, 16.1, 20.1])
 
         domain._order_ = 2
         domain.distribute_to_vertices_and_edges()
-	assert allclose(L[1], [4.1, 16.1, 20.1])
+        assert allclose(L[1], [4.1, 16.1, 20.1])
 
 
@@ -1832,5 +1832,5 @@
         d = [1.0/5, 0.0]
         e = [1.0/5, 1.0/5]
-	f = [1.0/5, 2.0/5]
+        f = [1.0/5, 2.0/5]
         g = [2.0/5, 2.0/5]
 
@@ -1846,15 +1846,15 @@
         domain.set_quantity('elevation', slope)
         domain.set_quantity('stage',
-			    [0.01298164, 0.00365611,
+                            [0.01298164, 0.00365611,
                              0.01440365, -0.0381856437096],
-			    location='centroids')
+                            location='centroids')
         domain.set_quantity('xmomentum',
-			    [0.00670439, 0.01263789,
+                            [0.00670439, 0.01263789,
                              0.00647805, 0.0178180740668],
-			    location='centroids')
+                            location='centroids')
         domain.set_quantity('ymomentum',
-			    [-7.23510980e-004, -6.30413883e-005,
+                            [-7.23510980e-004, -6.30413883e-005,
                              6.30413883e-005, 0.000200907255866],
-			    location='centroids')
+                            location='centroids')
 
         E = domain.quantities['elevation'].vertex_values
@@ -1875,14 +1875,14 @@
 
         #print L[1,:]
-	#print X[1,:]
-	#print Y[1,:]
+        #print X[1,:]
+        #print Y[1,:]
 
         assert allclose(L[1,:], [-0.00825735775384,
                                  -0.00801881482869,
                                  0.0272445025825])
-	assert allclose(X[1,:], [0.0143507718962,
+        assert allclose(X[1,:], [0.0143507718962,
                                  0.0142502147066,
                                  0.00931268339717])
-	assert allclose(Y[1,:], [-0.000117062180693,
+        assert allclose(Y[1,:], [-0.000117062180693,
                                  7.94434448109e-005,
                                  -0.000151505429018])
@@ -1892,5 +1892,5 @@
     def test_balance_deep_and_shallow(self):
         """Test that balanced limiters preserve conserved quantites.
-	"""
+        """
         import copy
 
@@ -1913,10 +1913,10 @@
         mesh.set_quantity('stage', [[3,0,3], [2,2,6], [5,3,8], [8,3,5]])
         mesh.set_quantity('elevation', 0) #Flat bed
-	stage = mesh.quantities['stage']
-
-	ref_centroid_values = copy.copy(stage.centroid_values[:]) #Copy
+        stage = mesh.quantities['stage']
+
+        ref_centroid_values = copy.copy(stage.centroid_values[:]) #Copy
 
         #Limit
-	mesh.distribute_to_vertices_and_edges()
+        mesh.distribute_to_vertices_and_edges()
 
         #Assert that quantities are conserved
@@ -1928,22 +1928,22 @@
 
         #Now try with a non-flat bed - closely hugging initial stage in places
-	#This will create alphas in the range [0, 0.478260, 1]
+        #This will create alphas in the range [0, 0.478260, 1]
         mesh.set_quantity('stage', [[3,0,3], [2,2,6], [5,3,8], [8,3,5]])
         mesh.set_quantity('elevation', [[0,0,0],
-					[1.8,1.9,5.9],
-					[4.6,0,0],
-					[0,2,4]])
-	stage = mesh.quantities['stage']
-
-	ref_centroid_values = copy.copy(stage.centroid_values[:]) #Copy
-	ref_vertex_values = copy.copy(stage.vertex_values[:]) #Copy
+                                        [1.8,1.9,5.9],
+                                        [4.6,0,0],
+                                        [0,2,4]])
+        stage = mesh.quantities['stage']
+
+        ref_centroid_values = copy.copy(stage.centroid_values[:]) #Copy
+        ref_vertex_values = copy.copy(stage.vertex_values[:]) #Copy
 
         #Limit
-	mesh.distribute_to_vertices_and_edges()
+        mesh.distribute_to_vertices_and_edges()
 
 
         #Assert that all vertex quantities have changed
         for k in range(mesh.number_of_elements):
-	    #print ref_vertex_values[k,:], stage.vertex_values[k,:]
+            #print ref_vertex_values[k,:], stage.vertex_values[k,:]
             assert not allclose (ref_vertex_values[k,:], stage.vertex_values[k,:])
         #and assert that quantities are still conserved
@@ -1956,8 +1956,8 @@
         #Also check that Python and C version produce the same
         assert allclose (stage.vertex_values,
-			 [[2,2,2],
-			  [1.93333333, 2.03333333, 6.03333333],
-			  [6.93333333, 4.53333333, 4.53333333],
-			  [5.33333333, 5.33333333, 5.33333333]])
+                         [[2,2,2],
+                          [1.93333333, 2.03333333, 6.03333333],
+                          [6.93333333, 4.53333333, 4.53333333],
+                          [5.33333333, 5.33333333, 5.33333333]])
 
 
@@ -1967,7 +1967,7 @@
         """Test that stage is conserved globally
 
-	This one uses a flat bed, reflective bdries and a suitable
-	initial condition
-	"""
+        This one uses a flat bed, reflective bdries and a suitable
+        initial condition
+        """
         from mesh_factory import rectangular
         from Numeric import array
@@ -1981,5 +1981,5 @@
         domain.default_order=2
 
-	#IC
+        #IC
         def x_slope(x, y):
             return x/3
@@ -1995,23 +1995,23 @@
         domain.check_integrity()
 
-	#domain.visualise = True #If you want to take a sticky beak
-
-	initial_volume = domain.quantities['stage'].get_integral()
-	initial_xmom = domain.quantities['xmomentum'].get_integral()
-
-	#print initial_xmom
+        #domain.visualise = True #If you want to take a sticky beak
+
+        initial_volume = domain.quantities['stage'].get_integral()
+        initial_xmom = domain.quantities['xmomentum'].get_integral()
+
+        #print initial_xmom
 
         #Evolution
         for t in domain.evolve(yieldstep = 0.05, finaltime = 5.0):
             volume =  domain.quantities['stage'].get_integral()
-	    assert allclose (volume, initial_volume)
+            assert allclose (volume, initial_volume)
 
             #I don't believe that the total momentum should be the same
-	    #It starts with zero and ends with zero though
+            #It starts with zero and ends with zero though
             #xmom = domain.quantities['xmomentum'].get_integral()
-	    #print xmom
-	    #assert allclose (xmom, initial_xmom)
-
-        os.remove(domain.filename + '.sww')
+            #print xmom
+            #assert allclose (xmom, initial_xmom)
+
+        os.remove(domain.get_name() + '.sww')
 
 
@@ -2019,7 +2019,7 @@
         """Test that stage is conserved globally
 
-	This one uses a slopy bed, reflective bdries and a suitable
-	initial condition
-	"""
+        This one uses a slopy bed, reflective bdries and a suitable
+        initial condition
+        """
         from mesh_factory import rectangular
         from Numeric import array
@@ -2033,5 +2033,5 @@
         domain.default_order=2
 
-	#IC
+        #IC
         def x_slope(x, y):
             return x/3
@@ -2047,29 +2047,29 @@
         domain.check_integrity()
 
-	#domain.visualise = True #If you want to take a sticky beak
-
-	initial_volume = domain.quantities['stage'].get_integral()
-	initial_xmom = domain.quantities['xmomentum'].get_integral()
-
-	#print initial_xmom
+        #domain.visualise = True #If you want to take a sticky beak
+
+        initial_volume = domain.quantities['stage'].get_integral()
+        initial_xmom = domain.quantities['xmomentum'].get_integral()
+
+        #print initial_xmom
 
         #Evolution
         for t in domain.evolve(yieldstep = 0.05, finaltime = 5.0):
             volume =  domain.quantities['stage'].get_integral()
-	    assert allclose (volume, initial_volume)
+            assert allclose (volume, initial_volume)
 
             #FIXME: What would we expect from momentum
             #xmom = domain.quantities['xmomentum'].get_integral()
-	    #print xmom
-	    #assert allclose (xmom, initial_xmom)
-
-        os.remove(domain.filename + '.sww')
+            #print xmom
+            #assert allclose (xmom, initial_xmom)
+
+        os.remove(domain.get_name() + '.sww')
 
     def test_conservation_3(self):
         """Test that stage is conserved globally
 
-	This one uses a larger grid, convoluted bed, reflective bdries and a suitable
-	initial condition
-	"""
+        This one uses a larger grid, convoluted bed, reflective bdries and a suitable
+        initial condition
+        """
         from mesh_factory import rectangular
         from Numeric import array
@@ -2082,11 +2082,11 @@
         domain.smooth = False
         domain.default_order = 2
-	domain.beta_h = 0.2
-	domain.set_quantities_to_be_stored(['stage'])
-
-	#IC
+        domain.beta_h = 0.2
+        domain.set_quantities_to_be_stored(['stage'])
+
+        #IC
         def x_slope(x, y):
-	    z = 0*x
-	    for i in range(len(x)):
+            z = 0*x
+            for i in range(len(x)):
                 if x[i] < 0.3:
                     z[i] = x[i]/3
@@ -2111,25 +2111,25 @@
         domain.check_integrity()
 
-	#domain.visualise = True #If you want to take a sticky beak
-
-	initial_volume = domain.quantities['stage'].get_integral()
-	initial_xmom = domain.quantities['xmomentum'].get_integral()
-
-	import copy
-	ref_centroid_values =\
-		 copy.copy(domain.quantities['stage'].centroid_values)
-
-	#print 'ORG', domain.quantities['stage'].centroid_values
-	domain.distribute_to_vertices_and_edges()
-
-
-	#print domain.quantities['stage'].centroid_values
-	assert allclose(domain.quantities['stage'].centroid_values,
-	                ref_centroid_values)
-
-
-	#Check that initial limiter doesn't violate cons quan
-	assert allclose (domain.quantities['stage'].get_integral(),
-	                 initial_volume)
+        #domain.visualise = True #If you want to take a sticky beak
+
+        initial_volume = domain.quantities['stage'].get_integral()
+        initial_xmom = domain.quantities['xmomentum'].get_integral()
+
+        import copy
+        ref_centroid_values =\
+                 copy.copy(domain.quantities['stage'].centroid_values)
+
+        #print 'ORG', domain.quantities['stage'].centroid_values
+        domain.distribute_to_vertices_and_edges()
+
+
+        #print domain.quantities['stage'].centroid_values
+        assert allclose(domain.quantities['stage'].centroid_values,
+                        ref_centroid_values)
+
+
+        #Check that initial limiter doesn't violate cons quan
+        assert allclose (domain.quantities['stage'].get_integral(),
+                         initial_volume)
 
         #Evolution
@@ -2137,14 +2137,14 @@
             volume =  domain.quantities['stage'].get_integral()
             #print t, volume, initial_volume
-	    assert allclose (volume, initial_volume)
-
-        os.remove(domain.filename + '.sww')
+            assert allclose (volume, initial_volume)
+
+        os.remove(domain.get_name() + '.sww')
 
     def test_conservation_4(self):
         """Test that stage is conserved globally
 
-	This one uses a larger grid, convoluted bed, reflective bdries and a suitable
-	initial condition
-	"""
+        This one uses a larger grid, convoluted bed, reflective bdries and a suitable
+        initial condition
+        """
         from mesh_factory import rectangular
         from Numeric import array
@@ -2157,10 +2157,10 @@
         domain.smooth = False
         domain.default_order=2
-	domain.beta_h = 0.0
-
-	#IC
+        domain.beta_h = 0.0
+
+        #IC
         def x_slope(x, y):
-	    z = 0*x
-	    for i in range(len(x)):
+            z = 0*x
+            for i in range(len(x)):
                 if x[i] < 0.3:
                     z[i] = x[i]/3
@@ -2171,5 +2171,5 @@
                     z[i] = 0.34 #OK with beta == 0.0
                     #z[i] = 0.35#Fails after 80 timesteps with an error
-		                #of the order 1.0e-5
+                                #of the order 1.0e-5
                 if 0.7 <= x[i]:
                     z[i] = x[i]/3
@@ -2188,21 +2188,21 @@
         domain.check_integrity()
 
-	#domain.visualise = True #If you want to take a sticky beak
-
-	initial_volume = domain.quantities['stage'].get_integral()
-	initial_xmom = domain.quantities['xmomentum'].get_integral()
-
-	import copy
-	ref_centroid_values =\
-		 copy.copy(domain.quantities['stage'].centroid_values)
-
-	#Test limiter by itself
-	domain.distribute_to_vertices_and_edges()
-
-	#Check that initial limiter doesn't violate cons quan
-	assert allclose (domain.quantities['stage'].get_integral(),
-	                 initial_volume)
+        #domain.visualise = True #If you want to take a sticky beak
+
+        initial_volume = domain.quantities['stage'].get_integral()
+        initial_xmom = domain.quantities['xmomentum'].get_integral()
+
+        import copy
+        ref_centroid_values =\
+                 copy.copy(domain.quantities['stage'].centroid_values)
+
+        #Test limiter by itself
+        domain.distribute_to_vertices_and_edges()
+
+        #Check that initial limiter doesn't violate cons quan
+        assert allclose (domain.quantities['stage'].get_integral(),
+                         initial_volume)
         #NOTE: This would fail if any initial stage was less than the
-	#corresponding bed elevation - but that is reasonable.
+        #corresponding bed elevation - but that is reasonable.
 
 
@@ -2214,23 +2214,23 @@
 
 
-	    #if not allclose (volume, initial_volume):
-	    #    print 't==4.05'
+            #if not allclose (volume, initial_volume):
+            #    print 't==4.05'
             #    for k in range(domain.number_of_elements):
-	    # 	    pass
-	    #	    print domain.quantities['stage'].centroid_values[k] -\
+            #       pass
+            #       print domain.quantities['stage'].centroid_values[k] -\
             #             ref_centroid_values[k]
 
-	    assert allclose (volume, initial_volume)
-
-
-        os.remove(domain.filename + '.sww')
+            assert allclose (volume, initial_volume)
+
+
+        os.remove(domain.get_name() + '.sww')
 
 
     def test_conservation_5(self):
         """Test that momentum is conserved globally in
-	steady state scenario
-
-	This one uses a slopy bed, dirichlet and reflective bdries
-	"""
+        steady state scenario
+
+        This one uses a slopy bed, dirichlet and reflective bdries
+        """
         from mesh_factory import rectangular
         from Numeric import array
@@ -2244,5 +2244,5 @@
         domain.default_order=2
 
-	#IC
+        #IC
         def x_slope(x, y):
             return x/3
@@ -2257,12 +2257,12 @@
         Bright = Dirichlet_boundary([0.1,0,0])
         domain.set_boundary({'left': Bleft, 'right': Bright,
-			     'top': Br, 'bottom': Br})
+                             'top': Br, 'bottom': Br})
 
         domain.check_integrity()
 
-	#domain.visualise = True #If you want to take a sticky beak
-
-	initial_volume = domain.quantities['stage'].get_integral()
-	initial_xmom = domain.quantities['xmomentum'].get_integral()
+        #domain.visualise = True #If you want to take a sticky beak
+
+        initial_volume = domain.quantities['stage'].get_integral()
+        initial_xmom = domain.quantities['xmomentum'].get_integral()
 
 
@@ -2273,10 +2273,10 @@
             ymom = domain.quantities['ymomentum'].get_integral()
 
-	    if allclose(t, 6):  #Steady state reached
+            if allclose(t, 6):  #Steady state reached
                 steady_xmom = domain.quantities['xmomentum'].get_integral()
                 steady_ymom = domain.quantities['ymomentum'].get_integral()
                 steady_stage = domain.quantities['stage'].get_integral()
 
-	    if t > 6:
+            if t > 6:
                 #print '%.2f %14.8f %14.8f' %(t, ymom, steady_ymom)
                 assert allclose(xmom, steady_xmom)
@@ -2285,5 +2285,5 @@
 
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
 
@@ -2293,8 +2293,8 @@
     def test_conservation_real(self):
         """Test that momentum is conserved globally
-	
+        
         Stephen finally made a test that revealed the problem.
         This test failed with code prior to 25 July 2005
-	"""
+        """
 
         yieldstep = 0.01
@@ -2352,5 +2352,5 @@
         assert allclose(ref, now), msg 
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
     def test_second_order_flat_bed_onestep(self):
@@ -2425,5 +2425,5 @@
                          -1.22721531e-004, -4.57969873e-005])
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
 
@@ -2457,5 +2457,5 @@
         #print domain.quantities['stage'].centroid_values
 
-        os.remove(domain.filename + '.sww')        
+        os.remove(domain.get_name() + '.sww')        
 
 
@@ -2502,5 +2502,5 @@
 
 
-        os.remove(domain.filename + '.sww')            
+        os.remove(domain.get_name() + '.sww')            
 
     def test_flatbed_second_order(self):
@@ -2549,12 +2549,12 @@
 
         #FIXME: These numbers were from version before 21/3/6 - 
-	#could be recreated by setting maximum_allowed_speed to 0 maybe	
+        #could be recreated by setting maximum_allowed_speed to 0 maybe 
         #assert allclose(domain.quantities['xmomentum'].vertex_values[:4,0],
         #                [ 0.00064835, 0.03685719, 0.00085073, 0.03687313]) 
-	
+        
         assert allclose(domain.quantities['xmomentum'].vertex_values[:4,0],
                         [ 0.00090581, 0.03685719, 0.00088303, 0.03687313])
-			
-			
+                        
+                        
 
         #assert allclose(domain.quantities['xmomentum'].vertex_values[:4,0],
@@ -2565,7 +2565,7 @@
 
 
-        os.remove(domain.filename + '.sww')
-
-	
+        os.remove(domain.get_name() + '.sww')
+
+        
     def test_flatbed_second_order_vmax_0(self):
         from mesh_factory import rectangular
@@ -2605,8 +2605,8 @@
 
         #FIXME: These numbers were from version before 21/3/6 - 
-	#could be recreated by setting maximum_allowed_speed to 0 maybe	
+        #could be recreated by setting maximum_allowed_speed to 0 maybe 
         assert allclose(domain.quantities['xmomentum'].vertex_values[:4,0],
                         [ 0.00064835, 0.03685719, 0.00085073, 0.03687313]) 
-	
+        
 
         assert allclose(domain.quantities['ymomentum'].vertex_values[:4,0],
@@ -2614,7 +2614,7 @@
 
 
-        os.remove(domain.filename + '.sww')
-
-	
+        os.remove(domain.get_name() + '.sww')
+
+        
 
     def test_flatbed_second_order_distribute(self):
@@ -2724,8 +2724,8 @@
             if not V:
                 #FIXME: These numbers were from version before 21/3/6 - 
-	        #could be recreated by setting maximum_allowed_speed to 0 maybe		  
-		
-                #assert allclose(domain.quantities['xmomentum'].centroid_values[17], 0.0)		 
-                assert allclose(domain.quantities['xmomentum'].centroid_values[17], 0.000286060839592)    	 		
+                #could be recreated by setting maximum_allowed_speed to 0 maybe           
+                
+                #assert allclose(domain.quantities['xmomentum'].centroid_values[17], 0.0)                
+                assert allclose(domain.quantities['xmomentum'].centroid_values[17], 0.000286060839592)                          
 
             else:
@@ -2742,5 +2742,5 @@
             #assert allclose(domain.quantities['xmomentum'].centroid_values[17],
             #                0.0)
-            assert allclose(domain.quantities['xmomentum'].centroid_values[17], 0.000286060839592)    	 					    
+            assert allclose(domain.quantities['xmomentum'].centroid_values[17], 0.000286060839592)                                                  
 
 
@@ -2768,5 +2768,5 @@
             #                [0.00090581,0.03685719,0.00088303,0.03687313])
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
 
@@ -2807,5 +2807,5 @@
 
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
         
     def test_bedslope_problem_first_order_moresteps(self):
@@ -2870,5 +2870,5 @@
                         -0.14439383, -0.13924047, -0.14829043])
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
         
     def test_bedslope_problem_second_order_one_step(self):
@@ -2943,24 +2943,24 @@
 
         #print domain.quantities['stage'].centroid_values
-	assert allclose(domain.quantities['stage'].centroid_values,
-		 [0.01290985, 0.02356019, 0.01619096, 0.02356019, 0.01619096,
-		  0.02356019, 0.01619096, 0.02356019, 0.01619096, 0.02356019,
-		  0.01619096, 0.0268413, -0.04411074, -0.0248011, -0.04186556,
-		  -0.0248011, -0.04186556, -0.0248011, -0.04186556, -0.0248011,
-		  -0.04186556, -0.0248011, -0.04186556, -0.02255593,
-		  -0.09966629, -0.08035666, -0.09742112, -0.08035666,
-		  -0.09742112, -0.08035666, -0.09742112, -0.08035666,
-		  -0.09742112, -0.08035666, -0.09742112, -0.07811149,
-		  -0.15522185, -0.13591222, -0.15297667, -0.13591222,
-		  -0.15297667, -0.13591222, -0.15297667, -0.13591222,
-		  -0.15297667, -0.13591222, -0.15297667, -0.13366704,
-		  -0.2107774, -0.19146777, -0.20853223, -0.19146777,
-		  -0.20853223, -0.19146777, -0.20853223, -0.19146777,
-		  -0.20853223, -0.19146777, -0.20853223, -0.1892226,
-		  -0.26120669, -0.24776246, -0.25865535, -0.24776246,
-		  -0.25865535, -0.24776246, -0.25865535, -0.24776246,
-		  -0.25865535, -0.24776246, -0.25865535, -0.24521113])
-
-        os.remove(domain.filename + '.sww')
+        assert allclose(domain.quantities['stage'].centroid_values,
+                 [0.01290985, 0.02356019, 0.01619096, 0.02356019, 0.01619096,
+                  0.02356019, 0.01619096, 0.02356019, 0.01619096, 0.02356019,
+                  0.01619096, 0.0268413, -0.04411074, -0.0248011, -0.04186556,
+                  -0.0248011, -0.04186556, -0.0248011, -0.04186556, -0.0248011,
+                  -0.04186556, -0.0248011, -0.04186556, -0.02255593,
+                  -0.09966629, -0.08035666, -0.09742112, -0.08035666,
+                  -0.09742112, -0.08035666, -0.09742112, -0.08035666,
+                  -0.09742112, -0.08035666, -0.09742112, -0.07811149,
+                  -0.15522185, -0.13591222, -0.15297667, -0.13591222,
+                  -0.15297667, -0.13591222, -0.15297667, -0.13591222,
+                  -0.15297667, -0.13591222, -0.15297667, -0.13366704,
+                  -0.2107774, -0.19146777, -0.20853223, -0.19146777,
+                  -0.20853223, -0.19146777, -0.20853223, -0.19146777,
+                  -0.20853223, -0.19146777, -0.20853223, -0.1892226,
+                  -0.26120669, -0.24776246, -0.25865535, -0.24776246,
+                  -0.25865535, -0.24776246, -0.25865535, -0.24776246,
+                  -0.25865535, -0.24776246, -0.25865535, -0.24521113])
+
+        os.remove(domain.get_name() + '.sww')
 
     def test_bedslope_problem_second_order_two_steps(self):
@@ -3060,5 +3060,5 @@
 
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
     def test_bedslope_problem_second_order_two_yieldsteps(self):
@@ -3134,25 +3134,25 @@
 
 
-	assert allclose(domain.quantities['stage'].centroid_values,
-		 [0.00855788, 0.01575204, 0.00994606, 0.01717072, 0.01005985,
-		  0.01716362, 0.01005985, 0.01716299, 0.01007098, 0.01736248,
-		  0.01216452, 0.02026776, -0.04462374, -0.02479045, -0.04199789,
-		  -0.0229465, -0.04184033, -0.02295693, -0.04184013,
-		  -0.02295675, -0.04184486, -0.0228168, -0.04028876,
-		  -0.02036486, -0.10029444, -0.08170809, -0.09772846,
-		  -0.08021704, -0.09760006, -0.08022143, -0.09759984,
-		  -0.08022124, -0.09760261, -0.08008893, -0.09603914,
-		  -0.07758209, -0.15584152, -0.13723138, -0.15327266,
-		  -0.13572906, -0.15314427, -0.13573349, -0.15314405,
-		  -0.13573331, -0.15314679, -0.13560104, -0.15158523,
-		  -0.13310701, -0.21208605, -0.19283913, -0.20955631,
-		  -0.19134189, -0.20942821, -0.19134598, -0.20942799,
-		  -0.1913458, -0.20943005, -0.19120952, -0.20781177,
-		  -0.18869401, -0.25384082, -0.2463294, -0.25047649,
-		  -0.24464654, -0.25031159, -0.24464253, -0.25031112,
-		  -0.24464253, -0.25031463, -0.24454764, -0.24885323,
-		  -0.24286438])
-
-        os.remove(domain.filename + '.sww')
+        assert allclose(domain.quantities['stage'].centroid_values,
+                 [0.00855788, 0.01575204, 0.00994606, 0.01717072, 0.01005985,
+                  0.01716362, 0.01005985, 0.01716299, 0.01007098, 0.01736248,
+                  0.01216452, 0.02026776, -0.04462374, -0.02479045, -0.04199789,
+                  -0.0229465, -0.04184033, -0.02295693, -0.04184013,
+                  -0.02295675, -0.04184486, -0.0228168, -0.04028876,
+                  -0.02036486, -0.10029444, -0.08170809, -0.09772846,
+                  -0.08021704, -0.09760006, -0.08022143, -0.09759984,
+                  -0.08022124, -0.09760261, -0.08008893, -0.09603914,
+                  -0.07758209, -0.15584152, -0.13723138, -0.15327266,
+                  -0.13572906, -0.15314427, -0.13573349, -0.15314405,
+                  -0.13573331, -0.15314679, -0.13560104, -0.15158523,
+                  -0.13310701, -0.21208605, -0.19283913, -0.20955631,
+                  -0.19134189, -0.20942821, -0.19134598, -0.20942799,
+                  -0.1913458, -0.20943005, -0.19120952, -0.20781177,
+                  -0.18869401, -0.25384082, -0.2463294, -0.25047649,
+                  -0.24464654, -0.25031159, -0.24464253, -0.25031112,
+                  -0.24464253, -0.25031463, -0.24454764, -0.24885323,
+                  -0.24286438])
+
+        os.remove(domain.get_name() + '.sww')
 
     def test_bedslope_problem_second_order_more_steps(self):
@@ -3275,5 +3275,5 @@
       -4.50964850e-003, -3.06319963e-003,  6.08950810e-004, -4.79537921e-004])
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
 
@@ -3316,14 +3316,14 @@
             pass
 
-	assert allclose(domain.quantities['stage'].centroid_values[:4],
-			[0.00206836, 0.01296714, 0.00363415, 0.01438924])
+        assert allclose(domain.quantities['stage'].centroid_values[:4],
+                        [0.00206836, 0.01296714, 0.00363415, 0.01438924])
         #print domain.quantities['xmomentum'].centroid_values[:4]
-	assert allclose(domain.quantities['xmomentum'].centroid_values[:4],
-			[0.01360154, 0.00671133, 0.01264578, 0.00648503])
-	assert allclose(domain.quantities['ymomentum'].centroid_values[:4],
-			[-1.19201077e-003, -7.23647546e-004,
-			-6.39083123e-005, 6.29815168e-005])
-
-        os.remove(domain.filename + '.sww')
+        assert allclose(domain.quantities['xmomentum'].centroid_values[:4],
+                        [0.01360154, 0.00671133, 0.01264578, 0.00648503])
+        assert allclose(domain.quantities['ymomentum'].centroid_values[:4],
+                        [-1.19201077e-003, -7.23647546e-004,
+                        -6.39083123e-005, 6.29815168e-005])
+
+        os.remove(domain.get_name() + '.sww')
 
     def test_complex_bed(self):
@@ -3399,5 +3399,5 @@
 # -5.48333333e-001, -5.31666667e-001, -5.48333333e-001, -5.31666667e-001])
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
     def test_spatio_temporal_boundary_1(self):
@@ -3472,6 +3472,6 @@
 
         boundary = { (0,1):'bottom', (1,1):'bottom', (4,1): 'bottom',
-	             (4,2):'right', (6,2):'right', (8,2):'right',
-		     (0,0):'diagonal', (3,0):'diagonal', (8,0):'diagonal'}
+                     (4,2):'right', (6,2):'right', (8,2):'right',
+                     (0,0):'diagonal', (3,0):'diagonal', (8,0):'diagonal'}
 
         domain2 = Domain(points, vertices, boundary)
@@ -3488,6 +3488,6 @@
         # Boundary conditions
         Br = Reflective_boundary(domain2)
-        Bf = Spatio_temporal_boundary(domain1.filename + '.' + domain1.format,
-				      domain2)
+        Bf = Spatio_temporal_boundary(domain1.get_name() + '.' +\
+                                      domain1.format, domain2)
         domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
         domain2.check_integrity()
@@ -3517,6 +3517,6 @@
 
         #Cleanup
-        os.remove(domain1.filename + '.' + domain1.format)
-        os.remove(domain2.filename + '.' + domain2.format)        
+        os.remove(domain1.get_name() + '.' + domain1.format)
+        os.remove(domain2.get_name() + '.' + domain2.format)        
 
 
@@ -3582,14 +3582,14 @@
 
         points = [ [0,0], [1.0/3,0], [1.0/3,1.0/3],
-	           [2.0/3,0], [2.0/3,1.0/3], [2.0/3,2.0/3],
-		   [1,0], [1,1.0/3], [1,2.0/3], [1,1]]
+                   [2.0/3,0], [2.0/3,1.0/3], [2.0/3,2.0/3],
+                   [1,0], [1,1.0/3], [1,2.0/3], [1,1]]
 
         vertices = [ [1,2,0],
-	             [3,4,1], [2,1,4], [4,5,2],
-	             [6,7,3], [4,3,7], [7,8,4], [5,4,8], [8,9,5]]
+                     [3,4,1], [2,1,4], [4,5,2],
+                     [6,7,3], [4,3,7], [7,8,4], [5,4,8], [8,9,5]]
 
         boundary = { (0,1):'bottom', (1,1):'bottom', (4,1): 'bottom',
-	             (4,2):'right', (6,2):'right', (8,2):'right',
-		     (0,0):'diagonal', (3,0):'diagonal', (8,0):'diagonal'}
+                     (4,2):'right', (6,2):'right', (8,2):'right',
+                     (0,0):'diagonal', (3,0):'diagonal', (8,0):'diagonal'}
 
         domain2 = Domain(points, vertices, boundary)
@@ -3607,5 +3607,5 @@
         #Read results for specific timesteps t=1 and t=2
         from Scientific.IO.NetCDF import NetCDFFile
-        fid = NetCDFFile(domain1.filename + '.' + domain1.format)
+        fid = NetCDFFile(domain1.get_name() + '.' + domain1.format)
 
         x = fid.variables['x'][:]
@@ -3622,11 +3622,11 @@
         #print points[0], points[5], points[10], points[15]
         assert allclose( take(points, [0,5,10,15]),
-	                 [[0,0], [1.0/3, 1.0/3], [2.0/3, 2.0/3], [1,1]])
+                         [[0,0], [1.0/3, 1.0/3], [2.0/3, 2.0/3], [1,1]])
 
 
         # Boundary conditions
         Br = Reflective_boundary(domain2)
-        Bf = Spatio_temporal_boundary(domain1.filename + '.' + domain1.format,
-				      domain2)
+        Bf = Spatio_temporal_boundary(domain1.get_name() + '.' + domain1.format,
+                                      domain2)
         domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
         domain2.check_integrity()
@@ -3636,6 +3636,6 @@
 
         boundary_midpoints = [[1.0/6, 0], [1.0/2, 0], [5.0/6,0],
-			      [1.0, 1.0/6], [1.0, 1.0/2], [1.0, 5.0/6],
-			      [1.0/6, 1.0/6], [0.5, 0.5], [5.0/6, 5.0/6]]
+                              [1.0, 1.0/6], [1.0, 1.0/2], [1.0, 5.0/6],
+                              [1.0/6, 1.0/6], [0.5, 0.5], [5.0/6, 5.0/6]]
 
         boundary_midpoints.sort()
@@ -3694,5 +3694,5 @@
 
         #Cleanup
-        os.remove(domain1.filename + '.' + domain1.format)
+        os.remove(domain1.get_name() + '.' + domain1.format)
 
 
Index: /anuga_core/source/anuga/shallow_water/tsh2sww.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/tsh2sww.py	(revision 3845)
+++ /anuga_core/source/anuga/shallow_water/tsh2sww.py	(revision 3846)
@@ -36,5 +36,5 @@
         file_path, filename = path.split(sww_file_name)
         filename, ext = path.splitext(filename)
-    domain.filename = filename
+    domain.set_name(filename)
         
     domain.reduction = mean
@@ -45,5 +45,5 @@
     if verbose == True:
         print "Output written to " + domain.get_datadir() + sep + \
-              domain.filename + "." + domain.format  
+              domain.get_name() + "." + domain.format  
     sww = get_dataobject(domain)
     sww.store_connectivity()
Index: /anuga_core/source/anuga_parallel/run_parallel_sw_merimbula_test.py
===================================================================
--- /anuga_core/source/anuga_parallel/run_parallel_sw_merimbula_test.py	(revision 3845)
+++ /anuga_core/source/anuga_parallel/run_parallel_sw_merimbula_test.py	(revision 3846)
@@ -196,5 +196,4 @@
 
 domain.store = False
-#domain.filename = 'merimbula-%d' %domain.processor
 
 #---------
Index: /anuga_core/source/anuga_parallel/run_sw_lost_mass.py
===================================================================
--- /anuga_core/source/anuga_parallel/run_sw_lost_mass.py	(revision 3845)
+++ /anuga_core/source/anuga_parallel/run_sw_lost_mass.py	(revision 3846)
@@ -94,9 +94,4 @@
 
 
-#domain.set_quantity('stage', quantities['stage'])
-#domain.set_quantity('elevation', quantities['elevation'])
-
-#domain.store = True
-#domain.filename = 'merimbula-%d' %domain.processor
 
 #---------
Index: /anuga_validation/analytical solutions/Analytical solution_oblique_shock.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical solution_oblique_shock.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical solution_oblique_shock.py	(revision 3846)
@@ -61,5 +61,5 @@
 
 # Provide file name for storing output
-domain.filename="oblique"
+domain.set_name('oblique')
 
 # Visualization smoothing
Index: /anuga_validation/analytical solutions/Analytical solution_oblique_shock_01.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical solution_oblique_shock_01.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical solution_oblique_shock_01.py	(revision 3846)
@@ -57,6 +57,6 @@
 
 # Provide file name for storing output
-domain.filename="oblique_cross_%g_%g_%g_%g_%g" % (n,m,theta,h_bc,p_bc)
-print domain.filename
+domain.set_name('oblique_cross_%g_%g_%g_%g_%g' % (n,m,theta,h_bc,p_bc))
+print domain.get_name()
 
 # Output format
Index: /anuga_validation/analytical solutions/Analytical solution_wave_runup.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical solution_wave_runup.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical solution_wave_runup.py	(revision 3846)
@@ -58,5 +58,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'run-up_second_order_again'
+domain.set_name('run-up_second_order_again')
 
 print "Number of triangles = ", len(domain)
Index: /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh.py	(revision 3846)
@@ -45,5 +45,5 @@
 domain.store = True     #Store for visualisation purposes
 domain.format = 'sww'   #Native netcdf visualisation format
-domain.filename = 'MacDonald_77541'
+domain.set_name('MacDonald_77541')
 
 #-------------
Index: /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh_wall.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh_wall.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh_wall.py	(revision 3846)
@@ -45,5 +45,5 @@
 domain.store = True     #Store for visualisation purposes
 domain.format = 'sww'   #Native netcdf visualisation format
-domain.filename = 'MacDonald_first_order_wall'
+domain.set_name('MacDonald_first_order_wall')
 
 #-------------
Index: /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh_wall0.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh_wall0.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_MacDonald_import_mesh_wall0.py	(revision 3846)
@@ -41,5 +41,5 @@
 domain.store = True     #Store for visualisation purposes
 domain.format = 'sww'   #Native netcdf visualisation format
-domain.filename = 'MacDonald_first_order_wall'
+domain.set_name('MacDonald_first_order_wall')
 
 #--------------
Index: /anuga_validation/analytical solutions/Analytical_solution_Sampson_cross_mesh.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_Sampson_cross_mesh.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_Sampson_cross_mesh.py	(revision 3846)
@@ -61,5 +61,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'sampson_first_order_cross'
+domain.set_name('sampson_first_order_cross')
 
 print 'Number of triangles = ', len(domain)
@@ -140,5 +140,5 @@
 tri = [domain.coordinates[t[0]],domain.coordinates[t[1]],domain.coordinates[t[2]]]
 
-filename=domain.filename
+filename=domain.get_name()
 file = open(filename,'w')
 
Index: /anuga_validation/analytical solutions/Analytical_solution_Sampson_import_mesh.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_Sampson_import_mesh.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_Sampson_import_mesh.py	(revision 3846)
@@ -53,5 +53,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'sampson_strang_second_order'
+domain.set_name('sampson_strang_second_order')
 
 print 'Number of triangles = ', len(domain)
Index: /anuga_validation/analytical solutions/Analytical_solution_Yoon_cross_mesh.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_Yoon_cross_mesh.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_Yoon_cross_mesh.py	(revision 3846)
@@ -45,5 +45,5 @@
 domain.store = False
 domain.format = 'sww'
-domain.filename = 'yoon_mesh_second_order_cross'
+domain.set_name('yoon_mesh_second_order_cross')
 print 'Number of triangles = ', len(domain)
 
@@ -120,5 +120,5 @@
 tri = [domain.coordinates[t[0]],domain.coordinates[t[1]],domain.coordinates[t[2]]]
 
-filename=domain.filename
+filename=domain.get_name()
 file = open(filename,'w')
 
Index: /anuga_validation/analytical solutions/Analytical_solution_Yoon_import_mesh.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_Yoon_import_mesh.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_Yoon_import_mesh.py	(revision 3846)
@@ -42,5 +42,5 @@
 domain.store = False
 domain.format = 'sww'
-domain.filename = 'yoon_mesh_second_order.2'
+domain.set_name('yoon_mesh_second_order.2')
 print 'Number of triangles = ', len(domain)
 
@@ -114,5 +114,5 @@
 tri = [domain.coordinates[t[0]],domain.coordinates[t[1]],domain.coordinates[t[2]]]
 
-filename=domain.filename
+filename=domain.get_name()
 file = open(filename,'w')
     
Index: /anuga_validation/analytical solutions/Analytical_solution_circular_hydraulic_jump.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_circular_hydraulic_jump.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_circular_hydraulic_jump.py	(revision 3846)
@@ -59,5 +59,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'circular_second_order'
+domain.set_name('circular_second_order')
 
 #------------------------------------------
Index: /anuga_validation/analytical solutions/Analytical_solution_contracting_channel.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_contracting_channel.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_contracting_channel.py	(revision 3846)
@@ -60,5 +60,5 @@
 domain.store = True     #Store for visualisation purposes
 domain.format = 'sww'   #Native netcdf visualisation format
-domain.filename = 'contracting_channel_second-order'
+domain.set_name('contracting_channel_second-order')
 
 
Index: /anuga_validation/analytical solutions/Analytical_solution_contracting_channel_import_mesh.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_contracting_channel_import_mesh.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_contracting_channel_import_mesh.py	(revision 3846)
@@ -45,5 +45,5 @@
 domain.store = True     #Store for visualisation purposes
 domain.format = 'sww'   #Native netcdf visualisation format
-domain.filename = 'contracting_channel_second-order'
+domain.set_name('contracting_channel_second-order')
 
 #----------------------------------------------------------
Index: /anuga_validation/analytical solutions/Analytical_solution_oblique_shock.py
===================================================================
--- /anuga_validation/analytical solutions/Analytical_solution_oblique_shock.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Analytical_solution_oblique_shock.py	(revision 3846)
@@ -47,5 +47,5 @@
 domain.store = True
 domain.format = "sww" #"sww" for NET.CDF binary format or "dat" for ASCII
-domain.filename = "oblique_first_order"
+domain.set_name('oblique_first_order')
 
 #------------------------
Index: /anuga_validation/analytical solutions/Malpasset_new.py
===================================================================
--- /anuga_validation/analytical solutions/Malpasset_new.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Malpasset_new.py	(revision 3846)
@@ -55,5 +55,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'Malpasset_second_order'
+domain.set_name('Malpasset_second_order')
 
 #----------------------------
Index: /anuga_validation/analytical solutions/Non_symmetrical_dam_break.py
===================================================================
--- /anuga_validation/analytical solutions/Non_symmetrical_dam_break.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Non_symmetrical_dam_break.py	(revision 3846)
@@ -140,5 +140,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'Non_symetrical_Dam_Break_second_order'
+domain.set_name('Non_symetrical_Dam_Break_second_order')
 
 
Index: /anuga_validation/analytical solutions/Sydney.py
===================================================================
--- /anuga_validation/analytical solutions/Sydney.py	(revision 3845)
+++ /anuga_validation/analytical solutions/Sydney.py	(revision 3846)
@@ -34,5 +34,5 @@
 domain.store = True
 domain.format = 'sww'
-domain.filename = 'sydney_ubd_again'
+domain.set_name('sydney_ubd_again')
 
 #Reduction operation for get_vertex_values
Index: /anuga_work/development/LWRU1/lwru1.py
===================================================================
--- /anuga_work/development/LWRU1/lwru1.py	(revision 3845)
+++ /anuga_work/development/LWRU1/lwru1.py	(revision 3846)
@@ -58,6 +58,7 @@
 import sys, os
 base = os.path.basename(sys.argv[0])
-domain.filename, _ = os.path.splitext(base)
-
+
+basename, _ = os.path.splitext(base)
+domain.set_name(basename)
 
 #Set initial values
Index: /anuga_work/development/cairns_2006/run_cairns.py
===================================================================
--- /anuga_work/development/cairns_2006/run_cairns.py	(revision 3845)
+++ /anuga_work/development/cairns_2006/run_cairns.py	(revision 3846)
@@ -108,5 +108,6 @@
 
 base = os.path.basename(sys.argv[0])
-domain.filename, _ = os.path.splitext(base)
+basename, _ = os.path.splitext(base)
+domain.set_name(basename)
 domain.default_order = 2
 domain.store = True    #Store for visualisation purposes
Index: /anuga_work/development/pyvolution-1d/data_manager.py
===================================================================
--- /anuga_work/development/pyvolution-1d/data_manager.py	(revision 3845)
+++ /anuga_work/development/pyvolution-1d/data_manager.py	(revision 3846)
@@ -413,7 +413,7 @@
             #remember the old filename, then give domain a
             #name with the extension
-            old_domain_filename = self.domain.filename
+            old_domain_filename = self.domain.get_name()
             if not self.recursion:
-                self.domain.filename = self.domain.filename+filename_ext
+                self.domain.set_name(old_domain_filename+filename_ext)
 
             #change the domain starttime to the current time
@@ -440,5 +440,5 @@
             #restore the old starttime and filename
             self.domain.starttime = old_domain_starttime
-            self.domain.filename = old_domain_filename
+            self.domain.set_name(old_domain_filename)
         else:
             self.recursion = False
@@ -3388,5 +3388,5 @@
     file_path, filename = path.split(filename)
     filename, ext = path.splitext(filename)
-    domain.filename = filename
+    domain.set_name(filename)
     domain.reduction = mean
     if verbose == True:print "file_path",file_path
@@ -3396,5 +3396,5 @@
     if verbose == True:
         print "Output written to " + domain.get_datadir() + sep + \
-              domain.filename + "." + domain.format
+              domain.get_name() + "." + domain.format
     sww = get_dataobject(domain)
     sww.store_connectivity()
Index: /anuga_work/development/pyvolution-1d/test_shallow_water_1d.py
===================================================================
--- /anuga_work/development/pyvolution-1d/test_shallow_water_1d.py	(revision 3845)
+++ /anuga_work/development/pyvolution-1d/test_shallow_water_1d.py	(revision 3846)
@@ -632,5 +632,5 @@
                 assert not allclose(stage, initial_stage)
 
-        os.remove(domain.filename + '.sww')
+        os.remove(domain.get_name() + '.sww')
 
     #####################################################
Index: /anuga_work/development/stochastic_study/run_model.py
===================================================================
--- /anuga_work/development/stochastic_study/run_model.py	(revision 3845)
+++ /anuga_work/development/stochastic_study/run_model.py	(revision 3846)
@@ -148,6 +148,8 @@
 
                 print 'P%d: Extracting time series for realisation %d from file %s'\
-                      %(myid, realisation, project.working_dir + domain.filename + '.sww')
-                f = file_function(project.working_dir + domain.filename + '.sww',
+                      %(myid, realisation, project.working_dir +\
+                        domain.get_name() + '.sww')
+                f = file_function(project.working_dir +\
+                                  domain.get_name() + '.sww',
                                   quantities='stage',
                                   interpolation_points=project.gauges,
Index: /anuga_work/development/stochastic_study/run_simple_model.py
===================================================================
--- /anuga_work/development/stochastic_study/run_simple_model.py	(revision 3845)
+++ /anuga_work/development/stochastic_study/run_simple_model.py	(revision 3846)
@@ -150,6 +150,8 @@
 
         print 'P%d: Extracting time series for realisation %d from file %s'\
-              %(myid, realisation, project.working_dir + domain.filename + '.sww')
-        f = file_function(project.working_dir + domain.filename + '.sww',
+              %(myid, realisation, project.working_dir +\
+                domain.get_name() + '.sww')
+        f = file_function(project.working_dir +\
+                          domain.get_name() + '.sww',
                           quantities='stage',
                           interpolation_points=project.gauges,
