Changeset 6194


Ignore:
Timestamp:
Jan 19, 2009, 8:47:26 AM (16 years ago)
Author:
ole
Message:

Work on Patong, diagnostics and one optimisation

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/util.py

    r6192 r6194  
    490490
    491491    if verbose:
    492         print 'Call interpolation function'
     492        print 'Calling interpolation function'
     493       
    493494    # Return Interpolation_function instance as well as
    494495    # starttime for use to possible modify that of domain
  • anuga_core/source/anuga/fit_interpolate/interpolate.py

    r6189 r6194  
    759759        import types
    760760
     761        if verbose is True:
     762            print 'Interpolation_function: input checks'
     763
    761764        # 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
    765770
    766771        # Check if quantities is a single array only
     
    788793            self.spatial = True         
    789794
     795        if verbose is True:
     796            print 'Interpolation_function: thinning'
     797
     798           
    790799        # Thin timesteps if needed
    791800        # Note array() is used to make the thinned arrays contiguous in memory
     
    794803            if len(quantities[name].shape) == 2:
    795804                quantities[name] = num.array(quantities[name][::time_thinning,:])
    796              
     805
     806        if verbose is True:
     807            print 'Interpolation_function: precomputing'
     808           
    797809        # Save for use with statistics
    798810        self.quantities_range = {}
     
    915927                print msg
    916928
     929            # FIXME(Ole): This one is no longer needed for STS files
    917930            interpol = Interpolate(vertex_coordinates,
    918931                                   triangles,
  • anuga_work/production/patong/project.py

    r6193 r6194  
    4848finaltime=15000         # final time for simulation 15000
    4949
    50 setup='trial'  # Final can be replaced with trial or basic.
     50setup='final'  # Final can be replaced with trial or basic.
    5151               # Either will result in a coarser mesh that will allow a
    5252               # faster, but less accurate, simulation.
     
    191191building_main_south = read_polygon(polygons_dir+'building_main_south.csv')
    192192building_saddle = read_polygon(polygons_dir+'building_saddle.csv')
    193 bld_res = 100*res_factor
     193bld_res = 50*res_factor
    194194
    195195
  • anuga_work/production/patong/run_patong.py

    r6193 r6194  
    3535from anuga.interface import csv2building_polygons
    3636
     37from anuga.caching import cache
    3738from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters
    3839from anuga.fit_interpolate.benchmark_least_squares import mem_usage
     
    124125building_polygons, building_heights = csv2building_polygons(project.building_polygon_file)
    125126
    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))
     127print 'Creating building polygons'
     128def 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))#
    132134
    133 buildings = Polygon_function(L, default=0.0)
     135        buildings = Polygon_function(L, default=0.0)
     136    return buildings
     137
     138buildings = cache(create_polygon_function,
     139                  building_polygons,
     140                  verbose=True)
     141       
    134142domain.add_quantity('elevation', buildings)
    135143
Note: See TracChangeset for help on using the changeset viewer.