Changeset 3705


Ignore:
Timestamp:
Oct 9, 2006, 11:08:10 AM (18 years ago)
Author:
ole
Message:

Implemented runup height detection in okushiri validation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/okushiri_2005/lwru2.py

    r3657 r3705  
    3333    domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
    3434else:
    35     print 'Creating regular mesh'
     35    print 'Creating regular from regular mesh'
    3636    N = 150
    3737    points, vertices, boundary = rectangular_cross(N, N/5*3,
    3838                                                   len1=5.448, len2=3.402)
    39     print 'Creating domain'
    40 
    41     #domain = Domain(points, vertices, boundary)
    42     domain = cache(Domain, (points, vertices, boundary))
    43 
     39    domain = Domain(points, vertices, boundary)
    4440
    4541domain.set_name('lwru2')
    4642domain.set_default_order(2)
    4743domain.set_minimum_storable_height(0.001)
    48 
    49 #domain.check_integrity()
    50 print 'Number of triangles = ', len(domain)
    51 print 'The extent is ', domain.get_extent()
     44domain.check_integrity()
    5245print domain.statistics()
    5346
     
    5952domain.set_quantity('stage', 0.0)
    6053domain.set_quantity('elevation',
    61                     filename = project.bathymetry_filename[:-4] + '.pts',
    62                     alpha = 0.02,                   
    63                     verbose = True,
    64                     use_cache = True)
     54                    filename=project.bathymetry_filename[:-4] + '.pts',
     55                    alpha=0.02,                   
     56                    verbose=True,
     57                    use_cache=True)
    6558
    6659#-------------------------
     
    7164function = file_function(project.boundary_filename[:-4] + '.tms',
    7265                         domain,
    73                          verbose = True)
     66                         verbose=True)
    7467
    7568Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    7669
    77 #Set boundary conditions
    7870if use_variable_mesh is True:
    7971    domain.set_boundary({'wave': Bts, 'wall': Br})
     
    8880t0 = time.time()
    8981
     82w_max = 0
    9083for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
    9184    domain.write_time()
    9285
     86    w = domain.get_maximum_inundation_elevation()
     87    x, y = domain.get_maximum_inundation_location()
     88    print '  Coastline elevation = %.2f at (x,y)=(%.2f, %.2f)' %(w, x, y)
     89    print
     90   
     91    if w > w_max:
     92        w_max = w
     93        x_max = x
     94        y_max = y
     95
     96
     97print '**********************************************'
     98print 'Max coastline elevation = %.2f at (%.2f, %.2f)' %(w_max, x_max, y_max)
     99print '**********************************************'
     100   
     101   
     102
    93103print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.