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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2648 - (show annotations)
Mon Sep 7 00:06:15 2009 UTC (11 years, 2 months ago) by jfenwick
File MIME type: text/x-python
File size: 1876 byte(s)
ecording some changes related to Anthony's cookbook.
These tests still do not run.

test_heatref.py is the current problem.
Current problems include:
undefined symbols
a dependence on X somehow.

I've already addressed the matplotlib X thing somewhere else.
Find and apply.


1
2 ########################################################
3 #
4 # Copyright (c) 2003-2009 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au/esscc
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="https://launchpad.net/escript-finley"
21
22 # You can shorten the execution time by reducing variable tend from 60 to 0.5
23
24 # Importing all the necessary modules required.
25 from esys.escript import *
26 from esys.finley import Rectangle
27 import sys
28 import os
29 from cblib import *
30
31 # Establish a save path.
32 savepath = "data/wavesolver2d002nwtest"
33 needdirs([savepath])
34
35 #Geometric and material property related variables.
36 mx = 1000 # model lenght
37 my = 200 # model width
38 ndx = 200 # steps in x direction
39 ndy = 40 # steps in y direction
40 lam=3.462e9 #lames constant
41 mu=3.462e9 #bulk modulus
42 rho=1154. #density
43 # Time related variables.
44 tend=0.1 #end time
45 #calculating )the timestep
46 h=(1./5.)*sqrt(rho/(lam+2*mu))*(mx/ndx)
47 #Check to make sure number of time steps is not too large.
48 print "Time step size= ",h, "Expected number of outputs= ",tend/h
49 proceeder = raw_input("Is this ok?(y/n)")
50 #Exit if user thinks too many outputs.
51 if proceeder == "n":
52 sys.exit()
53
54 U0=0.01 # amplitude of point source
55 # spherical source at middle of bottom face
56
57 xc=[300,200]
58
59 mydomain=Rectangle(l0=mx,l1=my,n0=ndx, n1=ndy)
60 wavesolver2df(mydomain,h,tend,lam,mu,rho,U0,xc,savepath)
61

  ViewVC Help
Powered by ViewVC 1.1.26