Annotation of /trunk/doc/examples/wave.py

Revision 327 - (hide annotations)
Wed Dec 7 04:32:28 2005 UTC (15 years, 1 month ago) by gross
Original Path: trunk/doc/user/examples/wave.py
File MIME type: text/x-python
File size: 1643 byte(s)
make them run again
 1 jgs 108 # \$Id\$ 2 from esys.escript import * 3 gross 327 from esys.escript.linearPDEs import LinearPDE 4 jgs 110 from esys.finley import Brick 5 gross 327 ne=5 # number of cells in x_0-direction 6 jgs 110 depth=10000. # length in x_0-direction 7 width=100000. # length in x_1 and x_2 direction 8 lam=3.462e9 9 mu=3.462e9 10 rho=1154. 11 tau=10. 12 umax=2. 13 tend=60 14 h=1./5.*sqrt(rho/(lam+2*mu))*(depth/ne) 15 print "time step size = ",h 16 jgs 108 17 jgs 110 def s_tt(t): return umax/tau**2*(6*t/tau-9*(t/tau)**4)*exp(-(t/tau)**3) 18 19 def wavePropagation(domain,h,tend,lam,mu,rho,s_tt): 20 jgs 108 x=domain.getX() 21 # ... open new PDE ... 22 jgs 110 mypde=LinearPDE(domain) 23 gross 327 mypde.setSolverMethod(mypde.LUMPING) 24 mypde.setValue(D=kronecker(mypde.getDim())*rho, \ 25 q=whereZero(x[0])*kronecker(mypde.getDim())[1,:]) 26 jgs 110 # ... set initial values .... 27 jgs 108 n=0 28 jgs 110 u=Vector(0,ContinuousFunction(domain)) 29 u_last=Vector(0,ContinuousFunction(domain)) 30 t=0 31 jgs 108 while t

Properties

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