Changeset 590 for inundation/ga/storm_surge/pyvolution/test_quantity.py
- Timestamp:
- Nov 18, 2004, 4:57:29 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/test_quantity.py
r546 r590 184 184 185 185 quantity.set_values(f, location = 'vertices') 186 #print "quantity.vertex_values",quantity.vertex_values 186 187 assert allclose(quantity.vertex_values, 187 188 [[2,0,2], [2,2,4], [4,2,4], [4,2,4]]) … … 677 678 assert allclose(quantity.vertex_values[1], value[0]) 678 679 680 # FIXMEDSG this seems wrong -DSG 681 # It's right. The values is an array, indexed by the element id's 682 # given in indexes. It sets values per triangle. 679 683 values = [10,100,50] 680 quantity.set_values(values, indexes = [0,1,5]) 684 quantity.set_values(values, indexes = [0,1,5]) # , location = 'centroids' 681 685 #print "2 quantity.vertex_values",quantity.vertex_values 682 686 assert allclose(quantity.vertex_values[0], [10,10,10]) 683 687 assert allclose(quantity.vertex_values[5], [50,50,50]) 684 quantity.interpolate()688 #quantity.interpolate() 685 689 #print "quantity.centroid_values",quantity.centroid_values 686 690 assert allclose(quantity.centroid_values, [10,100,3,4,5,50]) 687 691 688 692 values = [[31,30,29],[400,400,400],[1000,999,998]] 689 693 quantity.set_values(values, indexes = [3,3,5]) … … 691 695 assert allclose(quantity.centroid_values, [10,100,3,400,5,999]) 692 696 697 values = [[1,1,1],[2,2,2],[3,3,3], 698 [4,4,4],[5,5,5],[6,6,6]] 699 quantity.set_values(values) 700 701 # testing the standard set values by vertex 702 # indexed by vertex_id in general_mesh.coordinates 703 values = [0,1,2,3,4,5,6,7] 704 705 quantity.set_values(values) 706 #print "1 quantity.vertex_values",quantity.vertex_values 707 assert allclose(quantity.vertex_values,[[ 4., 5., 0.], 708 [ 1., 0., 5.], 709 [ 5., 6., 1.], 710 [ 2., 1., 6.], 711 [ 6., 7., 2.], 712 [ 3., 2., 7.]]) 693 713 694 714 def test_getting_some_vertex_values(self):
Note: See TracChangeset
for help on using the changeset viewer.