Changeset 319


Ignore:
Timestamp:
Sep 17, 2004, 5:03:05 PM (20 years ago)
Author:
ole
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/cornell_room.py

    r317 r319  
    1818print 'Creating domain'
    1919points, triangles, values = from_polyfile('cornell_room_medres')
     20
    2021
    2122#Create shallow water domain
     
    6263#
    6364print 'Initial condition'
     65
     66#Define water height as a lump in one corner
     67def height(x, y):
     68    from Numeric import zeros, Float
     69   
     70    N = len(x)
     71    assert N == len(y)   
     72
     73    xmin = min(x); xmax = max(x)
     74    ymin = min(y); ymax = max(y)
     75
     76    xrange = xmax - xmin
     77    yrange = ymax - ymin   
     78
     79    z = zeros(N, Float)
     80    for i in range(N):
     81        if x[i] <= xmin + 0.25*xrange and y[i] <= ymin + 0.25*yrange:
     82            z[i] = 300
     83
     84    return z
     85
     86domain.set_quantity('level', height)
     87
    6488E = domain.quantities['elevation'].vertex_values
    65 print max(E)
    66 L = E.copy()
    67 N = len(L)
    68 L[:N/4] += 100
    69 domain.set_quantity('level', L)
     89L = domain.quantities['level'].vertex_values
     90domain.set_quantity('level', E+L)
    7091
    7192#Evolve
    72 for t in domain.evolve(yieldstep = 0.01, finaltime = 1.0):
     93for t in domain.evolve(yieldstep = 0.05, finaltime = 5.0):
    7394    domain.write_time()
    7495   
Note: See TracChangeset for help on using the changeset viewer.