Ignore:
Timestamp:
Aug 5, 2008, 1:17:37 PM (16 years ago)
Author:
kristy
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/perth/run_perth.py

    r5578 r5607  
    4141from anuga.fit_interpolate.benchmark_least_squares import mem_usage
    4242from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
     43from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter
    4344
    4445# Application specific imports
     
    113114                             verbose=True)
    114115   # barrier()
    115    
     116
     117        covariance_value,alpha = find_optimal_smoothing_parameter (data_file= kwargs['elevation_file'],
     118                                alpha_list=[0.001, 0.01, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5],
     119                                mesh_file = project.meshes_dir_name+'.msh')
     120        print 'optimal alpha', covariance_value,alpha       
     121
    116122
    117123    #-------------------------------------------------------------------------
     
    154160    #barrier()
    155161
     162##    #------------------------------------------------------
     163##    # Create x,y,z file of mesh vertex!!!
     164##    #------------------------------------------------------
     165##        coord = domain.get_vertex_coordinates()
     166##        depth = domain.get_quantity('elevation')
     167##       
     168##        # Write vertex coordinates to file
     169##        filename=project.vertex_filename
     170##        fid=open(filename,'w')
     171##        fid.write('x (m), y (m), z(m)\n')
     172##        for i in range(len(coord)):
     173##            pt=coord[i]
     174##            x=pt[0]
     175##            y=pt[1]
     176##            z=depth[i]
     177##            fid.write('%.6f,%.6f,%.6f\n' %(x, y, z))
     178##
    156179
    157180    #------------------------------------------------------
     
    186209   
    187210    print 'Available boundary tags', domain.get_boundary_tags()
    188     Bf = File_boundary(boundary_urs_out+'.sts',
    189                    domain, time_thinning=1,
     211    Bf = Field_boundary(boundary_urs_out+'.sts',  # Change from file_boundary
     212                   domain, mean_stage= project.tide,
     213                   time_thinning=1,
    190214                   use_cache=True,
    191                    verbose = True,
    192                   boundary_polygon=bounding_polygon)
     215                   verbose = True)
     216                  # boundary_polygon=bounding_polygon)
    193217
    194218    Br = Reflective_boundary(domain)
    195219    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    196220
     221    print dir(Bf)
    197222    print 'start reading boundary file'
     223   
    198224
    199225##    Bf = Field_boundary(kwargs['boundary_file'],
     
    214240    t0 = time.time()
    215241
     242    using_sts_boundary = True
     243   
    216244    for t in domain.evolve(yieldstep = project.yieldstep, finaltime = kwargs['finaltime']
    217245                       ,skip_initial_step = False):
    218246        domain.write_time()
    219         domain.write_boundary_statistics(tags = 'ocean')   
     247        domain.write_boundary_statistics(tags = 'ocean')
     248        if using_sts_boundary is True:
     249            if Bf.values >= 99:
     250                domain.set_boundary({'ocean': Bd})
     251                using_sts_boundary = False
    220252
    221253    x, y = domain.get_maximum_inundation_location()
Note: See TracChangeset for help on using the changeset viewer.