Ignore:
Timestamp:
Sep 1, 2011, 7:28:58 PM (13 years ago)
Author:
steve
Message:

Getting the 1d tsunami model working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_flow_2_padarn.py

    r7884 r8204  
    11import os
    22from math import sqrt, pow, pi
    3 from channel_domain import *
    4 from Numeric import allclose, array, zeros, ones, Float, take, sqrt
    5 from config import g, epsilon
     3
     4import numpy as np
     5
     6from anuga_1d.channel.channel_domain import *
     7from anuga_1d.config import g, epsilon
     8from anuga_1d.base.generic_mesh import uniform_mesh
    69
    710
     
    1922
    2023def bed(x):
    21     y = zeros(len(x),Float)
     24    y = np.zeros(len(x),np.float)
    2225    for i in range(len(x)):
    2326        if x[i]<525 and x[i]>475:
     
    4649print "Evaluating domain with %d cells" %N
    4750cell_len = L/N # Origin = 0.0
    48 points = zeros(N+1,Float)
     51points = np.zeros(N+1,np.float)
    4952
    5053# Define the centroid points
     
    6265
    6366# Set boundry type, order, timestepping method and limiter
    64 domain.set_boundary({'exterior': Dirichlet_boundary([14,20,0,1.4,20/14,9])})
     67#domain.set_boundary({'exterior': Dirichlet_boundary([14,20,0,1.4,20/14,9])})
     68domain.set_boundary({'exterior': Reflective_boundary(domain)})
    6569domain.order = 2
    6670domain.set_timestepping_method('rk2')
     
    7276t0 = time.time()
    7377
     78finaltime= 0.0
     79
     80#===================================================================
     81# Time loop
     82#===================================================================
    7483for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    7584    domain.write_time()
     
    8493VelocityQ = domain.quantities['velocity'].vertex_values
    8594x = X.flat
    86 z = domain.quantities['elevation'].vertex_values.flat
    87 stage=HeightQ.flat+z
     95z = domain.quantities['elevation'].vertex_values
     96stage=HeightQ+z
     97stage = stage.flat
     98z = z.flat
    8899
    89100from pylab import plot,title,xlabel,ylabel,legend,savefig,show,hold,subplot
Note: See TracChangeset for help on using the changeset viewer.