Changeset 6318
- Timestamp:
- Feb 12, 2009, 1:40:21 PM (16 years ago)
- Location:
- anuga_core/source/anuga/abstract_2d_finite_volumes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
r6175 r6318 1577 1577 1578 1578 # point1_answers_array = [[0.0,1.0,-5.0,3.0,4.0], [2.0,10.0,-5.0,3.0,4.0]] 1579 point1_answers_array = [[0.0, 1.0,6.0,-5.0,3.0,4.0], [2.0,10.0,15.0,-5.0,3.0,4.0]]1579 point1_answers_array = [[0.0,0.0,1.0,6.0,-5.0,3.0,4.0], [2.0,2.0/3600.,10.0,15.0,-5.0,3.0,4.0]] 1580 1580 point1_filename = 'gauge_point1.csv' 1581 1581 point1_handle = file(point1_filename) … … 1585 1585 line=[] 1586 1586 for i,row in enumerate(point1_reader): 1587 #print 'i',i,'row',row 1588 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]),float(row[4]),float(row[5])]) 1589 #print 'assert line',line[i],'point1',point1_answers_array[i] 1587 # print 'i',i,'row',row 1588 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]), 1589 float(row[4]),float(row[5]),float(row[6])]) 1590 # print 'assert line',line[i],'point1',point1_answers_array[i] 1590 1591 assert num.allclose(line[i], point1_answers_array[i]) 1591 1592 1592 point2_answers_array = [[0.0, 1.0,1.5,-0.5,3.0,4.0], [2.0,10.0,10.5,-0.5,3.0,4.0]]1593 point2_answers_array = [[0.0,0.0,1.0,1.5,-0.5,3.0,4.0], [2.0,2.0/3600.,10.0,10.5,-0.5,3.0,4.0]] 1593 1594 point2_filename = 'gauge_point2.csv' 1594 1595 point2_handle = file(point2_filename) … … 1598 1599 line=[] 1599 1600 for i,row in enumerate(point2_reader): 1600 #print 'i',i,'row',row 1601 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]),float(row[4]),float(row[5])]) 1602 #print 'assert line',line[i],'point1',point1_answers_array[i] 1601 # print 'i',i,'row',row 1602 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]), 1603 float(row[4]),float(row[5]),float(row[6])]) 1604 # print 'assert line',line[i],'point1',point1_answers_array[i] 1603 1605 assert num.allclose(line[i], point2_answers_array[i]) 1604 1606 … … 1705 1707 for i,row in enumerate(point1_reader): 1706 1708 # print 'i',i,'row',row 1707 line.append([float(row[0]),float(row[1]),float(row[2])]) 1709 # note the 'hole' (element 1) below - skip the new 'hours' field 1710 line.append([float(row[0]),float(row[2]),float(row[3])]) 1708 1711 #print 'line',line[i],'point1',point1_answers_array[i] 1709 1712 assert num.allclose(line[i], point1_answers_array[i]) … … 1718 1721 for i,row in enumerate(point2_reader): 1719 1722 # print 'i',i,'row',row 1720 line.append([float(row[0]),float(row[1]),float(row[2])]) 1723 # note the 'hole' (element 1) below - skip the new 'hours' field 1724 line.append([float(row[0]),float(row[2]),float(row[3])]) 1721 1725 # print 'line',line[i],'point1',point1_answers_array[i] 1722 1726 assert num.allclose(line[i], point2_answers_array[i]) … … 1815 1819 1816 1820 # point1_answers_array = [[0.0,1.0,-5.0,3.0,4.0], [2.0,10.0,-5.0,3.0,4.0]] 1817 point1_answers_array = [[5.0, 1.0,6.0,-5.0,3.0,4.0], [7.0,10.0,15.0,-5.0,3.0,4.0]]1821 point1_answers_array = [[5.0,5.0/3600.,1.0,6.0,-5.0,3.0,4.0], [7.0,7.0/3600.,10.0,15.0,-5.0,3.0,4.0]] 1818 1822 point1_filename = 'gauge_point1.csv' 1819 1823 point1_handle = file(point1_filename) … … 1824 1828 for i,row in enumerate(point1_reader): 1825 1829 #print 'i',i,'row',row 1826 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]),float(row[4]),float(row[5])]) 1830 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]), 1831 float(row[4]), float(row[5]), float(row[6])]) 1827 1832 #print 'assert line',line[i],'point1',point1_answers_array[i] 1828 1833 assert num.allclose(line[i], point1_answers_array[i]) 1829 1834 1830 point2_answers_array = [[5.0, 1.0,1.5,-0.5,3.0,4.0], [7.0,10.0,10.5,-0.5,3.0,4.0]]1835 point2_answers_array = [[5.0,5.0/3600.,1.0,1.5,-0.5,3.0,4.0], [7.0,7.0/3600.,10.0,10.5,-0.5,3.0,4.0]] 1831 1836 point2_filename = 'gauge_point2.csv' 1832 1837 point2_handle = file(point2_filename) … … 1837 1842 for i,row in enumerate(point2_reader): 1838 1843 #print 'i',i,'row',row 1839 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]),float(row[4]),float(row[5])]) 1844 line.append([float(row[0]),float(row[1]),float(row[2]),float(row[3]), 1845 float(row[4]),float(row[5]), float(row[6])]) 1840 1846 #print 'assert line',line[i],'point1',point1_answers_array[i] 1841 1847 assert num.allclose(line[i], point2_answers_array[i]) -
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r6314 r6318 2526 2526 for sww_file in sww_files: 2527 2527 sww_file = join(dir_name, sww_file+'.sww') 2528 print 'sww file = ',sww_file2528 #print 'sww file = ',sww_file 2529 2529 callable_sww = file_function(sww_file, 2530 2530 quantities=core_quantities, … … 2539 2539 print 'time = ', str(time) 2540 2540 for point_i, point in enumerate(points_array): 2541 print 'gauge_file = ', str(point_name[point_i])2542 print 'point_i = ', str(point_i), ' point is = ', str(point)2541 # print 'gauge_file = ', str(point_name[point_i]) 2542 #print 'point_i = ', str(point_i), ' point is = ', str(point) 2543 2543 #add domain starttime to relative time. 2544 2544 quake_time = time + quake_offset_time 2545 2545 points_list = [quake_time, quake_time/3600.]# fudge around SWW time bug 2546 print 'point list = ', str(points_list)2546 #print 'point list = ', str(points_list) 2547 2547 point_quantities = callable_sww(time,point_i) 2548 print 'point quantities = ', str(point_quantities)2548 #print 'point quantities = ', str(point_quantities) 2549 2549 2550 2550 for quantity in quantities:
Note: See TracChangeset
for help on using the changeset viewer.