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

Revision 2534 - (show annotations)
Thu Jul 16 06:49:19 2009 UTC (12 years ago) by caltinay
File MIME type: text/x-python
File size: 1212 byte(s)
```Changed examples, tests and tutorials to save VTK files as .vtu instead .xml.
Visit doesn't know what to do with xml's and vtu is the proper extension
anyway.

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