Contents of /trunk/doc/examples/usersguide/wave.py

Revision 155 - (show annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 8 months ago) by jgs
Original Path: trunk/doc/user/examples/wave.py
File MIME type: text/x-python
File size: 1646 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

 1 # \$Id\$ 2 from esys.escript import * 3 from esys.linearPDEs import LinearPDE 4 from esys.finley import Brick 5 from numarray import identity 6 ne=10 # number of cells in x_0-direction 7 depth=10000. # length in x_0-direction 8 width=100000. # length in x_1 and x_2 direction 9 lam=3.462e9 10 mu=3.462e9 11 rho=1154. 12 tau=10. 13 umax=2. 14 tend=60 15 h=1./5.*sqrt(rho/(lam+2*mu))*(depth/ne) 16 print "time step size = ",h 17 18 def s_tt(t): return umax/tau**2*(6*t/tau-9*(t/tau)**4)*exp(-(t/tau)**3) 19 20 def wavePropagation(domain,h,tend,lam,mu,rho,s_tt): 21 x=domain.getX() 22 # ... open new PDE ... 23 mypde=LinearPDE(domain) 24 mypde.setLumpingOn() 25 kronecker=identity(mypde.getDim()) 26 mypde.setValue(D=kronecker*rho, \ 27 q=x[0].whereZero()*kronecker[1,:]) 28 # ... set initial values .... 29 n=0 30 u=Vector(0,ContinuousFunction(domain)) 31 u_last=Vector(0,ContinuousFunction(domain)) 32 t=0 33 while t

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision