# Diff of /trunk/doc/examples/usersguide/wave.py

revision 1161 by jongui, Wed May 23 04:17:52 2007 UTC revision 2420 by gross, Thu May 14 02:28:58 2009 UTC
# Line 1  Line 1
1
2    ########################################################
3    #
4    # Copyright (c) 2003-2008 by University of Queensland
5    # Earth Systems Science Computational Center (ESSCC)
6    # http://www.uq.edu.au/esscc
7    #
8    # Primary Business: Queensland, Australia
11    #
12    ########################################################
13
15    Earth Systems Science Computational Center (ESSCC)
16    http://www.uq.edu.au/esscc
21
22    # You can shorten the execution time by reducing variable tend from 60 to 0.5
23
24  from esys.escript import *  from esys.escript import *
25  from esys.escript.pdetools import Locator  from esys.escript.pdetools import Locator
26  from esys.escript.linearPDEs import LinearPDE  from esys.escript.linearPDEs import LinearPDE
27  from esys.finley import Brick  from esys.finley import Brick
28  from numarray import identity,zeros,ones  from numarray import identity,zeros,ones
29
30    if not os.path.isdir("data"):
31       print "\nCreating subdirectory 'data'\n"
32       os.mkdir("data")
33
34  ne=32          # number of cells in x_0 and x_1 directions  ne=32          # number of cells in x_0 and x_1 directions
35  width=10000.  # length in x_0 and x_1 directions  width=10000.  # length in x_0 and x_1 directions
36  lam=3.462e9  lam=3.462e9
# Line 52  def wavePropagation(domain,h,tend,lam,mu Line 79  def wavePropagation(domain,h,tend,lam,mu
79     u_pc_z = u_pc[2]     u_pc_z = u_pc[2]
80
81     # open file to save displacement at point source     # open file to save displacement at point source
82     u_pc_data=open('./data/U_pc.out','w')     u_pc_data=FileWriter('./data/U_pc.out')
83     u_pc_data.write("%f %f %f %f\n"%(t,u_pc_x,u_pc_y,u_pc_z))     u_pc_data.write("%f %f %f %f\n"%(t,u_pc_x,u_pc_y,u_pc_z))
84
85     while t<tend:     while t<tend:

Legend:
 Removed from v.1161 changed lines Added in v.2420