# Contents of /trunk/doc/examples/cookbook/wavesolver2d002.py

Revision 5707 - (show annotations)
Mon Jun 29 03:59:06 2015 UTC (3 years, 8 months ago) by sshaw
File MIME type: text/x-python
File size: 2088 byte(s)
```adding copyright headers to files without copyright info, moved header to top of file in some cases where it wasn't
```
 1 ############################################################################## 2 # 3 # Copyright (c) 2009-2015 by The University of Queensland 4 5 # 6 # Primary Business: Queensland, Australia 7 # Licensed under the Open Software License version 3.0 8 9 # 10 # Development until 2012 by Earth Systems Science Computational Center (ESSCC) 11 # Development 2012-2013 by School of Earth Sciences 12 # Development from 2014 by Centre for Geoscience Computing (GeoComp) 13 # 14 ############################################################################## 15 from __future__ import division, print_function 16 17 __copyright__="""Copyright (c) 2009-2015 by The University of Queensland 18 http://www.uq.edu.au 19 Primary Business: Queensland, Australia""" 20 __license__="""Licensed under the Open Software License version 3.0 21 22 __url__= 23 24 # You can shorten the execution time by reducing variable tend from 60 to 0.5 25 26 # Importing all the necessary modules required. 27 from esys.escript import * 28 from esys.finley import Rectangle 29 import sys 30 import os 31 from cblib1 import * 32 33 # Establish a save path. 34 savepath = "data/wavesolver2d002nwtest" 35 mkDir(savepath) 36 37 #Geometric and material property related variables. 38 mx = 1000 # model lenght 39 my = 200 # model width 40 ndx = 200 # steps in x direction 41 ndy = 40 # steps in y direction 42 lam=3.462e9 #lames constant 43 mu=3.462e9 #bulk modulus 44 rho=1154. #density 45 # Time related variables. 46 tend=0.1 #end time 47 #calculating )the timestep 48 h=(1./5.)*sqrt(rho/(lam+2*mu))*(mx/ndx) 49 #Check to make sure number of time steps is not too large. 50 print("Time step size= ",h, "Expected number of outputs= ",tend/h) 51 52 #uncomment the following lines to give the user a chance to stop 53 #proceeder = raw_input("Is this ok?(y/n)") 54 #if proceeder == "n": 55 # sys.exit() 56 57 U0=0.01 # amplitude of point source 58 # spherical source at middle of bottom face 59 60 xc=[300,200] 61 62 mydomain=Rectangle(l0=mx,l1=my,n0=ndx, n1=ndy) 63 wavesolver2df(mydomain,h,tend,lam,mu,rho,U0,xc,savepath) 64