Changeset 1710


Ignore:
Timestamp:
Aug 11, 2005, 3:45:58 PM (19 years ago)
Author:
steve
Message:

Analytical solution_wave_runup.py can now run strang file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/analytical solutions/Analytical solution_wave_runup.py

    r1701 r1710  
    55   Christopher Zoppou, Stephen Roberts, Ole Nielsen, Duncan Gray
    66   Geoscience Australia
    7    
     7
    88Specific methods pertaining to the 2D shallow water equation
    99are imported from shallow_water
     
    1515
    1616######################
    17 # Module imports 
     17# Module imports
    1818import sys
    1919from os import sep
     
    3939#points, elements = strang_mesh('Run-up.pt')
    4040points, elements = strang_mesh('strang_7389.pt')
    41 domain = Domain(points, elements) 
     41domain = Domain(points, elements)
    4242
    4343domain.default_order = 2
     
    4949for id, face in domain.boundary:
    5050    domain.boundary[(id,face)] = 'external'
    51    
    52 domain.boundary[(0,0)] = 'left'
     51    if domain.get_vertex_coordinate(id,(face+1)%3)[0] < -200.0+1.0e-10:
     52        domain.boundary[(id,face)] = 'left'
     53
     54
    5355
    5456
     
    6062print "Number of triangles = ", len(domain)
    6163
    62 #Reduction operation for get_vertex_values             
     64#Reduction operation for get_vertex_values
    6365from util import mean
    64 domain.reduction = mean 
     66domain.reduction = mean
    6567#domain.reduction = min  #Looks better near steep slopes
    6668
    67 #Define the boundary condition 
     69#Define the boundary condition
    6870def stage_setup(x,t_star1):
    6971    vh = 0
     
    8486        sigma_prime = sigma0/a
    8587        const = (1.-ii*lambda_prime)**2+sigma_prime**2
    86          
     88
    8789        v1 = 8.*eta/a*imag(1./const**(3./2.) \
    8890            -3./4.*(1.-ii*lambda_prime)/const**(5./2.))
    89            
     91
    9092        x1 = -v1**2/2.-a**2*sigma_prime**2/16.+eta \
    9193            *real(1.-2.*(5./4.-ii*lambda_prime) \
     
    149151            h = 0
    150152            w[i] = z[i]
    151     return w   
     153    return w
    152154
    153155domain.set_quantity('stage', stage)
     
    161163
    162164
     165
     166#domain.visualise = True
     167
    163168######################
    164169#Evolution
     
    168173    domain.write_time()
    169174    print boundary_stage(domain.time)
    170    
     175
    171176print 'That took %.2f seconds' %(time.time()-t0)
    172177
    173    
Note: See TracChangeset for help on using the changeset viewer.