/[escript]/trunk/doc/examples/geotutorial/myfirstscript.py
ViewVC logotype

Contents of /trunk/doc/examples/geotutorial/myfirstscript.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5288 - (show annotations)
Tue Dec 2 23:18:40 2014 UTC (4 years, 9 months ago) by sshaw
File MIME type: text/x-python
File size: 1565 byte(s)
fixing tests for cases where required domains not built
1 from __future__ import division, print_function
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2014 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
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 __copyright__="""Copyright (c) 2003-2014 by 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 import sys
25
26 # get the tools we want to use
27 from esys.escript import *
28 from esys.weipa import saveVTK
29 try:
30 from esys.dudley import Rectangle
31 # some parameters
32 L0=1.
33 L1=1.
34 T_bot=100
35 # generate n0 x n1 elements over [0,l0] x [0,l1]
36 mydomain=Rectangle(l0=L0,l1=L1,n0=20,n1=20)
37 # print spatial dimension:
38 print("dimension = ",mydomain.getDim())
39 # get coordinates of points in domain:
40 x=mydomain.getX()
41 print(x)
42 # set a function
43 T_D=T_bot/L1*(L1-x[1])
44 # save T_D for visualisation
45 saveVTK("u.vtu",T=T_D)
46 except ImportError:
47 print("Dudley module not available")
48
49

  ViewVC Help
Powered by ViewVC 1.1.26