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

Annotation of /trunk/doc/examples/cookbook/wavesolver2d002.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6651 - (hide annotations)
Wed Feb 7 02:12:08 2018 UTC (2 years, 11 months ago) by jfenwick
File MIME type: text/x-python
File size: 2068 byte(s)
Make everyone sad by touching all the files

Copyright dates update

1 jfenwick 3981 ##############################################################################
2 ahallam 2469 #
3 jfenwick 6651 # Copyright (c) 2009-2018 by The University of Queensland
4 jfenwick 3981 # http://www.uq.edu.au
5 ahallam 2469 #
6     # Primary Business: Queensland, Australia
7 jfenwick 6112 # Licensed under the Apache License, version 2.0
8     # http://www.apache.org/licenses/LICENSE-2.0
9 ahallam 2469 #
10 jfenwick 3981 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 jfenwick 4657 # Development 2012-2013 by School of Earth Sciences
12     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 jfenwick 3981 #
14     ##############################################################################
15 sshaw 5707 from __future__ import division, print_function
16 ahallam 2469
17 jfenwick 6651 __copyright__="""Copyright (c) 2009-2018 by The University of Queensland
18 jfenwick 3981 http://www.uq.edu.au
19 ahallam 2469 Primary Business: Queensland, Australia"""
20 jfenwick 6112 __license__="""Licensed under the Apache License, version 2.0
21     http://www.apache.org/licenses/LICENSE-2.0"""
22 ahallam 2469 __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 jfenwick 2697 from cblib1 import *
32 ahallam 2469
33     # Establish a save path.
34     savepath = "data/wavesolver2d002nwtest"
35 gross 2907 mkDir(savepath)
36 ahallam 2469
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 jfenwick 3892 print("Time step size= ",h, "Expected number of outputs= ",tend/h)
51 ahallam 2469
52 jfenwick 2667 #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 ahallam 2469 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    

  ViewVC Help
Powered by ViewVC 1.1.26