/[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 3892 - (show annotations)
Tue Apr 10 08:57:23 2012 UTC (6 years, 11 months ago) by jfenwick
File MIME type: text/x-python
File size: 1283 byte(s)
Merged changes across from the attempt2 branch.
This version builds and passes python2 tests.
It also passes most python3 tests.



1
2 from __future__ import print_function
3 ########################################################
4 #
5 # Copyright (c) 2003-2010 by University of Queensland
6 # Earth Systems Science Computational Center (ESSCC)
7 # http://www.uq.edu.au/esscc
8 #
9 # Primary Business: Queensland, Australia
10 # Licensed under the Open Software License version 3.0
11 # http://www.opensource.org/licenses/osl-3.0.php
12 #
13 ########################################################
14
15 __copyright__="""Copyright (c) 2003-2010 by University of Queensland
16 Earth Systems Science Computational Center (ESSCC)
17 http://www.uq.edu.au/esscc
18 Primary Business: Queensland, Australia"""
19 __license__="""Licensed under the Open Software License version 3.0
20 http://www.opensource.org/licenses/osl-3.0.php"""
21 __url__="https://launchpad.net/escript-finley"
22
23 # get the tools we want to use
24 from esys.escript import *
25 from esys.dudley import Rectangle
26 from esys.weipa import saveVTK
27 # some parameters
28 L0=1.
29 L1=1.
30 T_bot=100
31 # generate n0 x n1 elements over [0,l0] x [0,l1]
32 mydomain=Rectangle(l0=L0,l1=L1,n0=20,n1=20)
33 # print spatial dimension:
34 print("dimension = ",mydomain.getDim())
35 # get coordinates of points in domain:
36 x=mydomain.getX()
37 print(x)
38 # set a function
39 T_D=T_bot/L1*(L1-x[1])
40 # save T_D for visualisation
41 saveVTK("u.vtu",T=T_D)
42

  ViewVC Help
Powered by ViewVC 1.1.26