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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Copyright dates update

1
2 ##############################################################################
3 #
4 # Copyright (c) 2009-2018 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Apache License, version 2.0
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 from __future__ import division, print_function
18
19 __copyright__="""Copyright (c) 2009-2018 by The University of Queensland
20 http://www.uq.edu.au
21 Primary Business: Queensland, Australia"""
22 __license__="""Licensed under the Apache License, version 2.0
23 http://www.apache.org/licenses/LICENSE-2.0"""
24 __url__="https://launchpad.net/escript-finley"
25
26 # Antony Hallam
27 # Acoustic Wave Equation Simulation
28
29 # Importing all the necessary modules required.
30 import matplotlib
31 matplotlib.use('agg') #It's just here for automated testing
32
33 import numpy as np
34 import pylab as pl
35
36 #Geometric and material property related variables.
37 mx = 1000. # model lenght
38
39 ndx = np.arange(0.,20.,.1)
40 mtim= np.zeros(len(ndx),'float')
41 nvel= np.arange(500.,5000.,500.)
42
43 for vel in nvel:
44 mtim=ndx/vel
45 pl.plot(ndx,mtim,label='%d m/s'%vel)
46
47 pl.title('Maximum time steps calculations by velocity')
48 pl.xlabel('Minimum grid spacing (m)')
49 pl.ylabel('Maximum stable time step (s)')
50 pl.legend()
51 pl.show()
52
53
54
55

  ViewVC Help
Powered by ViewVC 1.1.26