def create_polygon_function(building_polygons, geo_reference=None): L = [] for i, key in enumerate(building_polygons): if i%100==0: log.critical(i) poly = building_polygons[key] elev = building_heights[key] L.append((poly, elev)) buildings = anuga.Polygon_function(L, default=0.0, geo_reference=geo_reference) return buildings log.critical('Creating %d building polygons' % len(building_polygons)) #buildings = create_polygon_function(building_polygons) buildings = anuga.cache(create_polygon_function, building_polygons, {'geo_reference': domain.geo_reference}, verbose=True) log.critical('Adding buildings') domain.add_quantity('elevation', buildings, use_cache=False, verbose=True) else: domain=None #print 'Hello from Processor ', myid barrier()
L = [] for i, key in enumerate(building_polygons): if i % 100 == 0: log.critical(i) poly = building_polygons[key] elev = building_heights[key] L.append((poly, elev)) buildings = anuga.Polygon_function(L, default=0.0, geo_reference=geo_reference) return buildings log.critical('Creating %d building polygons' % len(building_polygons)) #buildings = create_polygon_function(building_polygons) buildings = anuga.cache(create_polygon_function, building_polygons, {'geo_reference': domain.geo_reference}, verbose=True) log.critical('Adding buildings') domain.add_quantity('elevation', buildings, use_cache=False, verbose=True) else: domain = None #print 'Hello from Processor ', myid barrier() domain = distribute(domain)