/[escript]/trunk/doc/examples/cookbook/wavesolver2d001.py
ViewVC logotype

Contents of /trunk/doc/examples/cookbook/wavesolver2d001.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5707 - (show annotations)
Mon Jun 29 03:59:06 2015 UTC (3 years, 6 months ago) by sshaw
File MIME type: text/x-python
File size: 2138 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 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Open Software License version 3.0
8 # http://www.opensource.org/licenses/osl-3.0.php
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 http://www.opensource.org/licenses/osl-3.0.php"""
22 __url__="https://launchpad.net/escript-finley"
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 wavesolver2d
32
33 # Establish a save path.
34 savepath = "data/wavesolver2d001nwtest"
35 mkDir(savepath)
36
37
38 #Geometric and material property related variables.
39 mx = 1000 # model lenght
40 my = 200 # model width
41 ndx = 200 # steps in x direction
42 ndy = 40 # steps in y direction
43 lam=3.462e9 #lames constant
44 mu=3.462e9 #bulk modulus
45 rho=1154. #density
46 # Time related variables.
47 tend=0.5 #end time
48 #calculating )the timestep
49 h=(1./5.)*sqrt(rho/(lam+2*mu))*(mx/ndx)
50 #Check to make sure number of time steps is not too large.
51 print("Time step size= ",h, "Expected number of outputs= ",tend/h)
52
53 #uncomment the following lines to give the user a chance to stop
54 #proceeder = raw_input("Is this ok?(y/n)")
55 #Exit if user thinks too many outputs.
56 #if proceeder == "n":
57 # sys.exit()
58
59 U0=0.01 # amplitude of point source
60 # spherical source at middle of bottom face
61
62 xc=[300,200]
63
64 mydomain=Rectangle(l0=mx,l1=my,n0=ndx, n1=ndy)
65 wavesolver2d(mydomain,h,tend,lam,mu,rho,U0,xc,savepath)
66

  ViewVC Help
Powered by ViewVC 1.1.26