Changeset 2077


Ignore:
Timestamp:
Nov 25, 2005, 3:39:56 PM (19 years ago)
Author:
duncan
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/gippsland_2005/run_gippsland.py

    r2076 r2077  
    1010import project
    1111from create_mesh import create_mesh
    12 
     12from pyvolution.shallow_water import Domain, Reflective_boundary,\
     13     File_boundary, Dirichlet_boundary, Time_boundary, Transmissive_boundary
     14from pyvolution.least_squares import fit_to_mesh_file, DEFAULT_ALPHA
    1315
    1416#Data preparation
     
    2022#      #evaluate = True)
    2123
    22 cache(dem2pts, project.demname, {'verbose': True},
    23       dependencies = [project.demname + '.dem']     
     24cache(dem2pts, project.demname[:-4], {'verbose': True},
     25      dependencies = [project.demname]     
    2426      ,verbose = False
    2527      )
     
    3436       project.ucur_dir,
    3537       project.vcur_dir,
    36        project.boundaryname + '.sww'),
     38       project.boundaryname),
    3739       {'verbose': True,
    3840       'minlat': -38.25,
     
    5456#fit_to_mesh_file(mesh_file, point_file, mesh_output_file, DEFAULT_ALPHA,
    5557#                 verbose=True, expand_search=True, precrop=True)     
    56 cache(fit_to_mesh_file,(project.mesh_file,
    57                  point_file,
    58                  mesh_output_file,
     58cache(fit_to_mesh_file,(project.meshname,
     59                 project.pointname,
     60                 project.mesh_elevname,
    5961                 DEFAULT_ALPHA),
    6062      {'verbose': True,
    6163       'expand_search': True,
    6264       'precrop': True}
    63       ,dependencies = [project.mesh_file, point_file]
    64       #,verbose = True
     65      ,dependencies = [project.meshname, project.pointname]
     66      ,verbose = False
    6567      )
    6668   
     69
     70#Setup domain
     71domain = cache(pmesh_to_domain_instance, (project.mesh_elevname, Domain),
     72               dependencies = [project.mesh_elevname]                   
     73               ,verbose = False
     74               )               
     75
     76
     77domain.set_name(project.basename) # + '_%d' %resolution)
     78domain.set_datadir(project.outputdir)
     79domain.store = True
     80domain.quantities_to_be_stored = ['stage']
     81
     82print 'Number of triangles = ', len(domain)
     83print 'The extent is ', domain.get_extent()
     84
     85#Setup Initial Conditions
     86domain.set_quantity('friction', 0)
     87domain.set_quantity('stage', project.tide)
     88
     89
     90#Setup Boundary Conditions
     91print domain.get_boundary_tags()
     92
     93print "****** run  ****"
     94print "project.boundaryname",project.boundaryname
     95print "**********"
     96
     97Bf = File_boundary(project.boundaryname, domain, verbose = True)
     98#domain.starttime = 3000  #Obtained from MOST
     99domain.starttime = 0  #Obtained from MOST
     100
     101Br = Reflective_boundary(domain)
     102Bt = Transmissive_boundary(domain)
     103Bd = Dirichlet_boundary([project.tide,0,0])
     104Bw = Time_boundary(domain=domain,
     105                   f=lambda t: [(60<t<660)*4, 0, 0])
     106
     107domain.set_boundary( {'back': Br,'side': Bd, 'ocean': Bf} ) #CSIRO storm surge
     108
     109#Evolve
     110import time
     111t0 = time.time()
     112
     113for t in domain.evolve(yieldstep = 60, finaltime = 1200):
     114#                       skip_initial_step = True):
     115    domain.write_time()
     116    domain.write_boundary_statistics(tags = 'ocean') #quantities = 'stage')       
     117
     118print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.