Ignore:
Timestamp:
Jan 5, 2007, 4:03:44 PM (18 years ago)
Author:
duncan
Message:

added handling of attributes to blocking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/fit_interpolate/test_fit.py

    r4130 r4135  
    240240        assert allclose(f, answer)
    241241
    242     def test_fit_2_mesh(self):
     242    def test_fit_to_mesh(self):
    243243
    244244        a = [-1.0, 0.0]
     
    272272        f = fit_to_mesh(vertices, triangles,fileName,
    273273                                alpha=0.0, max_read_lines=2)
     274        answer = linear_function(vertices)
     275        #print "f\n",f
     276        #print "answer\n",answer
     277        assert allclose(f, answer)
     278       
     279    def test_fit_to_mesh_2_atts(self):
     280
     281        a = [-1.0, 0.0]
     282        b = [3.0, 4.0]
     283        c = [4.0,1.0]
     284        d = [-3.0, 2.0] #3
     285        e = [-1.0,-2.0]
     286        f = [1.0, -2.0] #5
     287
     288        vertices = [a, b, c, d,e,f]
     289        triangles = [[0,1,3], [1,0,2], [0,4,5], [0,5,2]] #abd bac aef afc
     290
     291
     292        fileName = tempfile.mktemp(".ddd")
     293        file = open(fileName,"w")
     294        # the 2nd att name is wacky so it's the first key off a hash table
     295        file.write(" x,y, elevation, afriqction \n\
     296-2.0, 2.0, 0., 0.\n\
     297-1.0, 1.0, 0., 0.\n\
     2980.0, 2.0 , 2., 20.\n\
     2991.0, 1.0 , 2., 20.\n\
     300 2.0,  1.0 ,3., 30. \n\
     301 0.0,  0.0 , 0., 0.\n\
     302 1.0,  0.0 , 1., 10.\n\
     303 0.0,  -1.0, -1., -10.\n\
     304 -0.2, -0.5, -0.7, -7.\n\
     305 -0.9, -1.5, -2.4, -24. \n\
     306 0.5,  -1.9, -1.4, -14. \n\
     307 3.0,  1.0 , 4., 40. \n")
     308        file.close()
     309       
     310        f = fit_to_mesh(vertices, triangles,fileName,
     311                        alpha=0.0,
     312                        attribute_name='elevation', max_read_lines=2)
    274313        answer = linear_function(vertices)
    275314        #print "f\n",f
Note: See TracChangeset for help on using the changeset viewer.