Changeset 3600


Ignore:
Timestamp:
Sep 15, 2006, 12:28:31 PM (19 years ago)
Author:
duncan
Message:

comitting onslow work, before switching over to pt hedland

Location:
anuga_work/production/MOST_example
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/MOST_example/project.py

    r3554 r3600  
    5050    user = getenv('LOGNAME')
    5151    print 'USER:', user
    52 
     52home = '.'
    5353#Derive subdirectories and filenames
    5454#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
  • anuga_work/production/MOST_example/run_onslow.py

    r3562 r3600  
    2727from anuga.fit_interpolate.fit import fit_to_mesh_file
    2828
     29from anuga.caching import cache
     30
    2931# Application specific imports
    3032import project                 # Definition of file names and polygons
     
    5153offshore_points = project.offshore_dem_name
    5254
    53 meshname = project.meshname+'.msh'
     55meshname = project.meshname+'.tsh'
    5456
    5557source_dir = project.boundarydir
     
    6264
    6365
    64 '''
    65 # coarse data
    66 convert_dem_from_ascii2netcdf(coarsedemname, use_cache=True, verbose=True)
    67 dem2pts(coarsedemname, use_cache=True, verbose=True)
    68 
    69 
    70 # fine data (clipping the points file to smaller area)
    71 convert_dem_from_ascii2netcdf(onshore_dem_name, use_cache=True, verbose=True)
    72 dem2pts(onshore_dem_name,
    73         easting_min=project.eastingmin,
    74         easting_max=project.eastingmax,
    75         northing_min=project.northingmin,
    76         northing_max= project.northingmax,
    77         use_cache=True,
    78         verbose=True)
    79 
    80         '''
    81 print'create G1'
    82 G1 = Geospatial_data(file_name = project.offshore_dem_name + '.xya')
    83 
    84 print'create G2'
    85 G2 = Geospatial_data(file_name = project.onshore_dem_name + '.pts')
    86 
    87 print'add G1+G2'
    88 G = G1 + G2
    89 
    90 print'export G'
    91 G.export_points_file(project.combined_dem_name + '.pts')
    92 
    93 
    94 #-------------------------------------------------------------------------------                                 
    95 # Create the triangular mesh based on overall clipping polygon with a tagged
    96 # boundary and interior regions defined in project.py along with
    97 # resolutions (maximal area of per triangle) for each polygon
    98 #-------------------------------------------------------------------------------
    99 
    100 from anuga.pmesh.mesh_interface import create_mesh_from_regions
    101 
    102 # original
    103 interior_res = 1000000
    104 
    105 from caching import cache
    106 _ = cache(create_mesh_from_regions,
    107           project.polyAll,
    108           {'boundary_tags': {'top': [0], 'topleft': [1],
    109                              'left': [2], 'bottom': [3],
    110                              'bottomright': [4], 'topright': [5]},
    111            'maximum_triangle_area': 10000000,
    112            'filename': meshname},
    113           verbose = True)
    114 
    115 mesh_elevname = meshname[:-4] + '_elv' + meshname[-4:]
    116 
    117 cache(fit_to_mesh_file,(meshname,
    118                  project.combined_dem_name + '.pts',
    119                  mesh_elevname),
    120       {'verbose': True}
    121       #,evaluate = True     
    122       ,verbose = False
    123       )
    12466
    12567#-------------------------------------------------------------------------------                                 
    12668# Setup computational domain
    12769#-------------------------------------------------------------------------------                                 
    128 
     70mesh_elevname = 'mesh_source_elv.msh'
    12971domain = pmesh_to_domain_instance(mesh_elevname, Domain,
    13072                                  use_cache = True,
     
    14890domain.set_quantity('stage', tide)
    14991domain.set_quantity('friction', 0.0)
    150 print 'hi and file',project.combined_dem_name + '.pts'
    151 #domain.set_quantity('elevation',
    152 #                    0.
    153 #                    filename = project.onshore_dem_name + '.pts',
    154 #                    filename = project.combined_dem_name + '.pts',
    155 #                    filename = project.offshore_dem_name + '.pts',
    156  #                   use_cache = False,
    157   #                  verbose = True,
    158    #                 alpha = 0.1
    159     #                )
    16092print 'hi1'
    16193
     
    172104
    173105cache(ferret2sww,
    174       (source_dir + project.boundary_basename,
    175        source_dir + project.boundary_basename),
     106      (project.boundary_basename,
     107       project.boundary_basename),
    176108      {'verbose': True,
    177109       'minlat': south,
     
    190122print 'Available boundary tags', domain.get_boundary_tags()
    191123
    192 Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
     124Bf = File_boundary(project.boundary_basename + '.sww',
    193125                    domain, verbose = True)
    194126Br = Reflective_boundary(domain)
     
    202134domain.set_boundary( {'top': Bf, 'topleft': Bf,
    203135                             'left': Br, 'bottom': Br,
    204                              'bottomright': Br, 'topright': Bf} )
     136                             'bottomright': Br, 'topright': Bf,
     137                      'exterior':Bf} )
    205138
    206139
     
    211144t0 = time.time()
    212145
    213 for t in domain.evolve(yieldstep = 50, finaltime = 100):
     146for t in domain.evolve(yieldstep = 50, finaltime = 1000):
    214147    domain.write_time()
    215148    domain.write_boundary_statistics(tags = 'top')     
Note: See TracChangeset for help on using the changeset viewer.