Index: /development/dam_2006/create_mesh.py
===================================================================
--- /development/dam_2006/create_mesh.py	(revision 3419)
+++ /development/dam_2006/create_mesh.py	(revision 3420)
@@ -10,9 +10,9 @@
 
 import project
-def generate():
+def generate(gate_position, is_course = False):
     #Basic geometry
     
-    xleft   = -2.25
-    xright  = .75
+    xleft   = - gate_position
+    xright  = 3.0 - gate_position
     ybottom = 0
     ytop    = 0.4
@@ -57,8 +57,12 @@
     m.addVertsSegs(dict)
     
-    dam = m.add_region(0.2,0.2) # this is the location of the region.
+    dam = m.add_region(0.0000001,(ytop - ybottom)/2)
+    # this is the location of the region.
+
     dam.setTag("dam")
-    m.generate_mesh(maximum_triangle_area=0.01)
-    #m.generate_mesh(maximum_triangle_area=0.0001)
+    if is_course:
+        m.generate_mesh(maximum_triangle_area=0.01)
+    else:
+        m.generate_mesh(maximum_triangle_area=0.0001)
 
     m.export_mesh_file(project.mesh_filename)
Index: /development/dam_2006/run_dam.py
===================================================================
--- /development/dam_2006/run_dam.py	(revision 3419)
+++ /development/dam_2006/run_dam.py	(revision 3420)
@@ -32,76 +32,79 @@
 import create_mesh
 
+def main():
+    #-------------------------------------------------------------------------
+    # Setup archiving of simulations
+    #-------------------------------------------------------------------------
 
-#-----------------------------------------------------------------------------
-# Setup archiving of simulations
-#-----------------------------------------------------------------------------
+    copy (project.codedirname, project.outputtimedir + 'project.py')
+    copy (project.codedir + 'run_dam.py', project.outputtimedir + 'run_dam.py')
+    copy (project.codedir + 'create_mesh.py',
+          project.outputtimedir + 'create_mesh.py')
+    print'output dir', project.outputtimedir
 
-copy (project.codedirname, project.outputtimedir + 'project.py')
-copy (project.codedir + 'run_dam.py', project.outputtimedir + 'run_dam.py')
-copy (project.codedir + 'create_mesh.py',
-      project.outputtimedir + 'create_mesh.py')
-print'output dir', project.outputtimedir
+    #normal screen output is stored in 
+    screen_output_name = project.outputtimedir + "screen_output.txt"
+    screen_error_name = project.outputtimedir + "screen_error.txt"
 
-#normal screen output is stored in 
-screen_output_name = project.outputtimedir + "screen_output.txt"
-screen_error_name = project.outputtimedir + "screen_error.txt"
+    #-------------------------------------------------------------------------
+    # Create the triangular mesh
+    #-------------------------------------------------------------------------
 
-#-----------------------------------------------------------------------------
-# Create the triangular mesh
-#-----------------------------------------------------------------------------
+    create_mesh.generate(0.75, is_course=False) # this creates the mesh
 
-create_mesh.generate() # this creates the mesh
-
-head,tail = path.split(project.mesh_filename)
-copy (project.mesh_filename,
-      project.outputtimedir + tail )
-#-----------------------------------------------------------------------------
-# Setup computational domain
-#-----------------------------------------------------------------------------
-domain = Domain(project.mesh_filename, use_cache = False, verbose = True)
+    head,tail = path.split(project.mesh_filename)
+    copy (project.mesh_filename,
+          project.outputtimedir + tail )
+    #-------------------------------------------------------------------------
+    # Setup computational domain
+    #-------------------------------------------------------------------------
+    domain = Domain(project.mesh_filename, use_cache = False, verbose = True)
    
 
-print 'Number of triangles = ', len(domain)
-print 'The extent is ', domain.get_extent()
-print domain.statistics()
+    print 'Number of triangles = ', len(domain)
+    print 'The extent is ', domain.get_extent()
+    print domain.statistics()
 
-domain.set_name(project.basename)
-domain.set_datadir(project.outputtimedir)
-domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
+    domain.set_name(project.basename)
+    domain.set_datadir(project.outputtimedir)
+    domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
 
-#-----------------------------------------------------------------------------
-# Setup initial conditions
-#-----------------------------------------------------------------------------
+    #-------------------------------------------------------------------------
+    # Setup initial conditions
+    #-------------------------------------------------------------------------
 
-tide = 0.0
-slope = -0.05
+    tide = 0.0
+    slope = -0.05
 
-def elevation_tilt(x, y):
-    return x*slope
+    def elevation_tilt(x, y):
+        return x*slope
         
-domain.set_quantity('stage', elevation_tilt)
-domain.set_quantity('friction', 0.03) 
-domain.set_quantity('elevation',elevation_tilt)
+    domain.set_quantity('stage', elevation_tilt)
+    domain.set_quantity('friction', 0.03) 
+    domain.set_quantity('elevation',elevation_tilt)
 
-print 'Available boundary tags', domain.get_boundary_tags()
+    print 'Available boundary tags', domain.get_boundary_tags()
 
-domain.set_region(Set_region('dam','stage',0.2,location = 'unique vertices'))
+    domain.set_region(Set_region('dam','stage',0.2,
+                                 location = 'unique vertices'))
 
-Br = Reflective_boundary(domain)
-Bd = Dirichlet_boundary([tide,0,0])
+    Br = Reflective_boundary(domain)
+    Bd = Dirichlet_boundary([tide,0,0])
 
-#domain.set_boundary( {'wall': Br, 'wave': Bw} )
-domain.set_boundary( {'wall': Br, 'wave': Br} )
+    domain.set_boundary( {'wall': Br, 'wave': Br} )
 
-#-----------------------------------------------------------------------------
-# Evolve system through time
-#-----------------------------------------------------------------------------
-import time
-t0 = time.time()
+    #-------------------------------------------------------------------------
+    # Evolve system through time
+    #-------------------------------------------------------------------------
+    t0 = time.time()
 
-for t in domain.evolve(yieldstep = 0.1, finaltime = 15):
-    domain.write_time()
+    for t in domain.evolve(yieldstep = 0.1, finaltime = 15):
+        domain.write_time()
     
-print 'That took %.2f seconds' %(time.time()-t0)
+        print 'That took %.2f seconds' %(time.time()-t0)
+        print 'finished'
 
-print 'finished'
+#-------------------------------------------------------------
+if __name__ == "__main__":
+    main()
+    
