Index: /inundation/config.py
===================================================================
--- /inundation/config.py	(revision 2766)
+++ /inundation/config.py	(revision 2766)
@@ -0,0 +1,108 @@
+"""Module where global pyvolution model parameters are set
+"""
+
+
+#FIXME (Ole): Temporary access to global config file
+from anuga_config import epsilon, default_boundary_tag
+
+
+
+#FIXME (Ole): More of these may need to be moved to anuga_config.py
+time_format = '%d/%m/%y %H:%M:%S'
+
+min_timestep = 1.0e-6 #Should be computed based on geometry
+max_timestep = 1.0e+3
+#This is how:
+#Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?)
+#Then work out minimal internal distance in mesh r_min and set
+#min_timestep = r_min/v_max
+#
+#Max speeds are calculated in the flux function as
+#
+#lambda = v +/- sqrt(gh)
+#
+# so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the
+# shallow water wave equation
+#
+#The actual soundspeed can be as high as 1530m/s
+#(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html),
+#but that would only happen with h>225000m in this equation. Why ?
+#The maximal speed we specify is really related to the max speed
+#of surface pertubation
+#
+
+
+#v_max = 100 #For use in domain_ext.c
+sound_speed = 500
+
+
+max_smallsteps = 50  #Max number of degenerate steps allowed b4 trying first order
+
+manning = 0.3  #Manning's friction coefficient
+g = 9.8       #Gravity
+#g(phi) = 9780313 * (1 + 0.0053024 sin(phi)**2 - 0.000 0059 sin(2*phi)**2) micro m/s**2, where phi is the latitude
+#The 'official' average is 9.80665
+
+
+
+
+eta_w = 3.0e-3 #Wind stress coefficient
+rho_a = 1.2e-3 #Atmospheric density
+rho_w = 1023   #Fluid density [kg/m^3] (rho_w = 1023 for salt water)
+
+
+#Betas [0;1] control the allowed steepness of gradient for second order
+#extrapolations. Values of 1 allow the steepes gradients while
+#lower values are more conservative. Values of 0 correspond to
+#1'st order extrapolations.
+#
+# Large values of beta_h may cause simulations to require more timesteps
+# as surface will 'hug' closer to the bed.
+# Small values of beta_h will make code faster, but one may experience
+# artificial momenta caused by discontinuities in water depths in
+# the presence of steep slopes. One example of this would be
+# stationary water 'lapping' upwards to a higher point on the coast.
+#
+#
+#
+#There are separate betas for the w-limiter and the h-limiter
+#
+#
+#
+#
+#Good values are:
+#beta_w = 0.9
+#beta_h = 0.2
+
+
+
+beta_w = 0.9
+beta_h = 0.2
+CFL = 1.0  #FIXME (ole): Is this in use yet??
+           #(Steve) yes, change domain.CFL to
+           #make changes
+
+
+pmesh_filename = '.\\pmesh'
+
+
+import os, sys
+
+if sys.platform == 'win32':
+    default_datadir = '.'
+else:
+    default_datadir = '.'
+
+
+use_extensions = True    #Try to use C-extensions
+#use_extensions = False   #Do not use C-extensions
+
+use_psyco = True  #Use psyco optimisations
+#use_psyco = False  #Do not use psyco optimisations
+
+
+optimised_gradient_limiter = True #Use hardwired gradient limiter
+
+#Specific to shallow water W.E.
+minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0
+maximum_allowed_speed = 100.0 #Maximal particle speed of water
Index: /inundation/fit_interpolate/test_all.py
===================================================================
--- /inundation/fit_interpolate/test_all.py	(revision 2766)
+++ /inundation/fit_interpolate/test_all.py	(revision 2766)
@@ -0,0 +1,102 @@
+"""Regression testing framework
+This module will search for scripts in the same directory named
+test_*.py.  Each such script should be a test suite that tests a
+module through PyUnit. This script will aggregate all
+found test suites into one big test suite and run them all at once.
+"""
+
+# Author: Mark Pilgrim
+# Modified by Ole Nielsen
+
+import unittest
+import os
+
+
+#List files that should be excluded from the testing process.
+#E.g. if they are known to fail and under development
+#exclude = ['test_interpolate_sww.py'] 
+
+
+def get_test_files(path):
+
+    import sys
+
+    files = os.listdir(path)
+
+    #Check sub directories
+    test_files = []
+    for file in files:
+        if os.path.isdir(file):
+            sys.path.append(file)
+            #print 'Recursing into', file
+            test_files += get_test_files(path + os.sep + file)
+        elif file[:5] == 'test_' and file[-2:] == 'py':
+            #print 'Appending', file
+            test_files.append(file)
+        else:
+            pass
+    return test_files
+
+
+
+def regressionTest():
+    import sys, os, re, unittest
+    path = os.path.split(sys.argv[0])[0] or os.getcwd()
+
+
+    files = get_test_files(path)
+
+
+
+    #test = re.compile('^test_[\w]*.py$', re.IGNORECASE)
+    #files = filter(test.search, files)
+
+
+    try:
+        files.remove(__file__)  #Remove self from list (Ver 2.3. or later)
+    except:
+        files.remove('test_all.py')
+
+    print 'Testing:'
+    for file in files:
+        print '  ' + file
+
+    if globals().has_key('exclude'):
+        for file in exclude:
+            files.remove(file)
+            print 'WARNING: File '+ file + ' excluded from testing'
+
+
+    filenameToModuleName = lambda f: os.path.splitext(f)[0]
+    #print "files",files 
+    moduleNames = map(filenameToModuleName, files)
+    #print "moduleNames",moduleNames
+    modules = map(__import__, moduleNames)
+    load = unittest.defaultTestLoader.loadTestsFromModule
+    return unittest.TestSuite(map(load, modules))
+
+if __name__ == '__main__':
+
+    from os import sep
+
+    #Attempt to compile all extensions
+    #execfile('..' + sep + 'utilities' + sep + 'compile.py')
+
+    #FIXME: Temporary measure
+    #os.chdir('..' + sep + 'utilities')
+    #execfile('compile.py')
+    #os.chdir('..' + sep + 'pyvolution')    
+    
+    #FIXME: Temporary measure
+    #os.chdir('..' + sep + 'triangle')
+    #execfile('compile.py')
+    #os.chdir('..' + sep + 'pyvolution')   
+    
+    #os.system('python compile.py') 
+
+    #print regressionTest()
+    #unittest.main(defaultTest='regressionTest')
+    
+    suite = regressionTest()
+    runner = unittest.TextTestRunner() #(verbosity=2)
+    runner.run(suite)
Index: undation/pyvolution/config.py
===================================================================
--- /inundation/pyvolution/config.py	(revision 2765)
+++ 	(revision )
@@ -1,108 +1,0 @@
-"""Module where global pyvolution model parameters are set
-"""
-
-
-#FIXME (Ole): Temporary access to global config file
-from anuga_config import epsilon, default_boundary_tag
-
-
-
-#FIXME (Ole): More of these may need to be moved to anuga_config.py
-time_format = '%d/%m/%y %H:%M:%S'
-
-min_timestep = 1.0e-6 #Should be computed based on geometry
-max_timestep = 1.0e+3
-#This is how:
-#Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?)
-#Then work out minimal internal distance in mesh r_min and set
-#min_timestep = r_min/v_max
-#
-#Max speeds are calculated in the flux function as
-#
-#lambda = v +/- sqrt(gh)
-#
-# so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the
-# shallow water wave equation
-#
-#The actual soundspeed can be as high as 1530m/s
-#(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html),
-#but that would only happen with h>225000m in this equation. Why ?
-#The maximal speed we specify is really related to the max speed
-#of surface pertubation
-#
-
-
-#v_max = 100 #For use in domain_ext.c
-sound_speed = 500
-
-
-max_smallsteps = 50  #Max number of degenerate steps allowed b4 trying first order
-
-manning = 0.3  #Manning's friction coefficient
-g = 9.8       #Gravity
-#g(phi) = 9780313 * (1 + 0.0053024 sin(phi)**2 - 0.000 0059 sin(2*phi)**2) micro m/s**2, where phi is the latitude
-#The 'official' average is 9.80665
-
-
-
-
-eta_w = 3.0e-3 #Wind stress coefficient
-rho_a = 1.2e-3 #Atmospheric density
-rho_w = 1023   #Fluid density [kg/m^3] (rho_w = 1023 for salt water)
-
-
-#Betas [0;1] control the allowed steepness of gradient for second order
-#extrapolations. Values of 1 allow the steepes gradients while
-#lower values are more conservative. Values of 0 correspond to
-#1'st order extrapolations.
-#
-# Large values of beta_h may cause simulations to require more timesteps
-# as surface will 'hug' closer to the bed.
-# Small values of beta_h will make code faster, but one may experience
-# artificial momenta caused by discontinuities in water depths in
-# the presence of steep slopes. One example of this would be
-# stationary water 'lapping' upwards to a higher point on the coast.
-#
-#
-#
-#There are separate betas for the w-limiter and the h-limiter
-#
-#
-#
-#
-#Good values are:
-#beta_w = 0.9
-#beta_h = 0.2
-
-
-
-beta_w = 0.9
-beta_h = 0.2
-CFL = 1.0  #FIXME (ole): Is this in use yet??
-           #(Steve) yes, change domain.CFL to
-           #make changes
-
-
-pmesh_filename = '.\\pmesh'
-
-
-import os, sys
-
-if sys.platform == 'win32':
-    default_datadir = '.'
-else:
-    default_datadir = '.'
-
-
-use_extensions = True    #Try to use C-extensions
-#use_extensions = False   #Do not use C-extensions
-
-use_psyco = True  #Use psyco optimisations
-#use_psyco = False  #Do not use psyco optimisations
-
-
-optimised_gradient_limiter = True #Use hardwired gradient limiter
-
-#Specific to shallow water W.E.
-minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0
-maximum_allowed_speed = 100.0 #Maximal particle speed of water
Index: /inundation/utilities/test_all.py
===================================================================
--- /inundation/utilities/test_all.py	(revision 2766)
+++ /inundation/utilities/test_all.py	(revision 2766)
@@ -0,0 +1,102 @@
+"""Regression testing framework
+This module will search for scripts in the same directory named
+test_*.py.  Each such script should be a test suite that tests a
+module through PyUnit. This script will aggregate all
+found test suites into one big test suite and run them all at once.
+"""
+
+# Author: Mark Pilgrim
+# Modified by Ole Nielsen
+
+import unittest
+import os
+
+
+#List files that should be excluded from the testing process.
+#E.g. if they are known to fail and under development
+#exclude = ['test_interpolate_sww.py'] 
+
+
+def get_test_files(path):
+
+    import sys
+
+    files = os.listdir(path)
+
+    #Check sub directories
+    test_files = []
+    for file in files:
+        if os.path.isdir(file):
+            sys.path.append(file)
+            #print 'Recursing into', file
+            test_files += get_test_files(path + os.sep + file)
+        elif file[:5] == 'test_' and file[-2:] == 'py':
+            #print 'Appending', file
+            test_files.append(file)
+        else:
+            pass
+    return test_files
+
+
+
+def regressionTest():
+    import sys, os, re, unittest
+    path = os.path.split(sys.argv[0])[0] or os.getcwd()
+
+
+    files = get_test_files(path)
+
+
+
+    #test = re.compile('^test_[\w]*.py$', re.IGNORECASE)
+    #files = filter(test.search, files)
+
+
+    try:
+        files.remove(__file__)  #Remove self from list (Ver 2.3. or later)
+    except:
+        files.remove('test_all.py')
+
+    print 'Testing:'
+    for file in files:
+        print '  ' + file
+
+    if globals().has_key('exclude'):
+        for file in exclude:
+            files.remove(file)
+            print 'WARNING: File '+ file + ' excluded from testing'
+
+
+    filenameToModuleName = lambda f: os.path.splitext(f)[0]
+    #print "files",files 
+    moduleNames = map(filenameToModuleName, files)
+    #print "moduleNames",moduleNames
+    modules = map(__import__, moduleNames)
+    load = unittest.defaultTestLoader.loadTestsFromModule
+    return unittest.TestSuite(map(load, modules))
+
+if __name__ == '__main__':
+
+    from os import sep
+
+    #Attempt to compile all extensions
+    #execfile('..' + sep + 'utilities' + sep + 'compile.py')
+
+    #FIXME: Temporary measure
+    #os.chdir('..' + sep + 'utilities')
+    #execfile('compile.py')
+    #os.chdir('..' + sep + 'pyvolution')    
+    
+    #FIXME: Temporary measure
+    #os.chdir('..' + sep + 'triangle')
+    #execfile('compile.py')
+    #os.chdir('..' + sep + 'pyvolution')   
+    
+    #os.system('python compile.py') 
+
+    #print regressionTest()
+    #unittest.main(defaultTest='regressionTest')
+    
+    suite = regressionTest()
+    runner = unittest.TextTestRunner() #(verbosity=2)
+    runner.run(suite)
