Ignore:
Timestamp:
Nov 5, 2004, 3:35:13 PM (20 years ago)
Author:
ole
Message:

Cleanup

Location:
inundation/ga/storm_surge/pyvolution
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/mesh.py

    r484 r486  
    432432        #    assert self.neighbours[id,edge] < 0
    433433
    434 #FIXME: May get rid of
    435 def rectangular_mesh(m, n, len1=1.0, len2=1.0, origin = (0.0, 0.0)):
    436     from mesh_factory import rectangular
    437     points, triangles, boundary = rectangular(m, n, len1, len2, origin)
    438 
    439     return Mesh(points, triangles, boundary)
    440 
    441 
    442 #FIXME: Get oblique and contracting and circular meshes from Chris
    443 
     434
  • inundation/ga/storm_surge/pyvolution/mesh_factory.py

    r317 r486  
    6262    return points, elements, boundary       
    6363
     64
     65#FIXME: Get oblique and contracting and circular meshes from Chris
    6466
    6567
  • inundation/ga/storm_surge/pyvolution/test_domain.py

    r469 r486  
    66from domain import *
    77from config import epsilon
    8 from Numeric import allclose, array
     8from Numeric import allclose, array, ones, Float
    99
    1010
     
    266266        domain.update_conserved_quantities()
    267267
    268 
    269         #FIXME: Update this test once I understand the semi_implicit scheme   
    270         #x = array([1, 2, 3, 4]) + array( [.4,.3,.2,.1] )
    271         #x /= array( [.9,.9,.9,.9] )
    272         #
    273         #for name in domain.conserved_quantities:
    274         #    assert allclose(domain.quantities[name].centroid_values, x)   
     268        sem = array([1.,1.,1.,1.])/array([1, 2, 3, 4])
     269        denom = ones(4, Float)-domain.timestep*sem
     270
     271        x = array([1, 2, 3, 4]) + array( [.4,.3,.2,.1] )
     272        x /= denom
     273
     274        for name in domain.conserved_quantities:
     275            assert allclose(domain.quantities[name].centroid_values, x)   
    275276
    276277
    277278    def testz_set_region(self):
    278         """Domain implements a default first order gradient limiter
     279        """Set quantities for sub region
    279280        """
    280281       
     
    326327        domain.set_region([add_to_verts])
    327328       
    328         self.failUnless( domain.test == "Mound",
     329        self.failUnless(domain.test == "Mound",
    329330                        'set region failed')
    330331       
    331332#-------------------------------------------------------------
    332333if __name__ == "__main__":
    333     suite = unittest.makeSuite(TestCase,'testz')
     334    suite = unittest.makeSuite(TestCase,'test')
    334335    runner = unittest.TextTestRunner()
    335336    runner.run(suite)
  • inundation/ga/storm_surge/pyvolution/test_mesh.py

    r334 r486  
    77
    88from mesh import *
     9from mesh_factory import rectangular
    910from config import epsilon
    1011from Numeric import allclose, array
     
    343344        M=1
    344345        N=1
    345         mesh = rectangular_mesh(M, N)
     346
     347        points, vertices, boundary = rectangular(M, N)
     348        mesh = Mesh(points, vertices, boundary)
    346349
    347350        #Test that points are arranged in a counter clock wise order       
     
    350353        M=2
    351354        N=2
    352         mesh = rectangular_mesh(M, N)
    353        
     355        points, vertices, boundary = rectangular(M, N)
     356        mesh = Mesh(points, vertices, boundary)
     357       
    354358        #Test that points are arranged in a counter clock wise order       
    355359        mesh.check_integrity()
     
    363367       
    364368
    365         mesh = rectangular_mesh(4, 4)
     369        points, vertices, boundary = rectangular(4, 4)
     370        mesh = Mesh(points, vertices, boundary)
     371       
    366372
    367373        #Test that points are arranged in a counter clock wise order       
     
    389395        len1 = 100.0
    390396        len2 = 17.0
    391         mesh = rectangular_mesh(M, N, len1, len2)
     397       
     398        points, vertices, boundary = rectangular(M, N, len1, len2)
     399        mesh = Mesh(points, vertices, boundary)
    392400
    393401        assert len(mesh) == 2*M*N       
     
    408416        #Check that integers don't cause trouble
    409417        N = 16
    410         mesh = rectangular_mesh(2*N, N, len1=10, len2=10)
     418       
     419        points, vertices, boundary = rectangular(2*N, N, len1=10, len2=10)
     420        mesh = Mesh(points, vertices, boundary)
     421
    411422
    412423
Note: See TracChangeset for help on using the changeset viewer.