Changeset 6194
- Timestamp:
- Jan 19, 2009, 8:47:26 AM (16 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r6192 r6194 490 490 491 491 if verbose: 492 print 'Call interpolation function' 492 print 'Calling interpolation function' 493 493 494 # Return Interpolation_function instance as well as 494 495 # starttime for use to possible modify that of domain -
anuga_core/source/anuga/fit_interpolate/interpolate.py
r6189 r6194 759 759 import types 760 760 761 if verbose is True: 762 print 'Interpolation_function: input checks' 763 761 764 # Check temporal info 762 time = ensure_numeric(time) 763 msg = 'Time must be a monotonuosly increasing sequence %s' % time 764 assert num.alltrue(time[1:] - time[:-1] >= 0), msg 765 time = ensure_numeric(time) 766 if not num.alltrue(time[1:] - time[:-1] >= 0): 767 # This message is time consuming to form due to the conversion of 768 msg = 'Time must be a monotonuosly increasing sequence %s' % time 769 raise Exception, msg 765 770 766 771 # Check if quantities is a single array only … … 788 793 self.spatial = True 789 794 795 if verbose is True: 796 print 'Interpolation_function: thinning' 797 798 790 799 # Thin timesteps if needed 791 800 # Note array() is used to make the thinned arrays contiguous in memory … … 794 803 if len(quantities[name].shape) == 2: 795 804 quantities[name] = num.array(quantities[name][::time_thinning,:]) 796 805 806 if verbose is True: 807 print 'Interpolation_function: precomputing' 808 797 809 # Save for use with statistics 798 810 self.quantities_range = {} … … 915 927 print msg 916 928 929 # FIXME(Ole): This one is no longer needed for STS files 917 930 interpol = Interpolate(vertex_coordinates, 918 931 triangles, -
anuga_work/production/patong/project.py
r6193 r6194 48 48 finaltime=15000 # final time for simulation 15000 49 49 50 setup=' trial' # Final can be replaced with trial or basic.50 setup='final' # Final can be replaced with trial or basic. 51 51 # Either will result in a coarser mesh that will allow a 52 52 # faster, but less accurate, simulation. … … 191 191 building_main_south = read_polygon(polygons_dir+'building_main_south.csv') 192 192 building_saddle = read_polygon(polygons_dir+'building_saddle.csv') 193 bld_res = 100*res_factor193 bld_res = 50*res_factor 194 194 195 195 -
anuga_work/production/patong/run_patong.py
r6193 r6194 35 35 from anuga.interface import csv2building_polygons 36 36 37 from anuga.caching import cache 37 38 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters 38 39 from anuga.fit_interpolate.benchmark_least_squares import mem_usage … … 124 125 building_polygons, building_heights = csv2building_polygons(project.building_polygon_file) 125 126 126 print 'Creating building polygons' 127 L = [] 128 for key in building_polygons: 129 poly = building_polygons[key] 130 elev = building_heights[key] 131 L.append((poly, elev)) 127 print 'Creating building polygons' 128 def create_polygon_function(building_polygons): 129 L = [] 130 for key in building_polygons: 131 poly = building_polygons[key] 132 elev = building_heights[key] 133 L.append((poly, elev))# 132 134 133 buildings = Polygon_function(L, default=0.0) 135 buildings = Polygon_function(L, default=0.0) 136 return buildings 137 138 buildings = cache(create_polygon_function, 139 building_polygons, 140 verbose=True) 141 134 142 domain.add_quantity('elevation', buildings) 135 143
Note: See TracChangeset
for help on using the changeset viewer.