# Diff of /trunk/doc/examples/geotutorial/myfirstscript.py

revision 5287 by jfenwick, Wed Apr 9 05:41:57 2014 UTC revision 5288 by sshaw, Tue Dec 2 23:18:40 2014 UTC
# Line 1  Line 1
1  from __future__ import division  from __future__ import division, print_function
from __future__ import print_function
2  ##############################################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2014 by University of Queensland  # Copyright (c) 2003-2014 by University of Queensland
23
24    import sys
25
26  # get the tools we want to use  # get the tools we want to use
27  from esys.escript import *  from esys.escript import *
from esys.dudley import Rectangle
28  from esys.weipa import saveVTK  from esys.weipa import saveVTK
29  # some parameters  try:
30  L0=1.      from esys.dudley import Rectangle
31  L1=1.      # some parameters
32  T_bot=100      L0=1.
33  # generate n0 x n1 elements over [0,l0] x [0,l1]      L1=1.
34  mydomain=Rectangle(l0=L0,l1=L1,n0=20,n1=20)      T_bot=100
35  # print spatial dimension:      # generate n0 x n1 elements over [0,l0] x [0,l1]
36  print("dimension = ",mydomain.getDim())      mydomain=Rectangle(l0=L0,l1=L1,n0=20,n1=20)
37  # get coordinates of points in domain:      # print spatial dimension:
38  x=mydomain.getX()      print("dimension = ",mydomain.getDim())
39  print(x)      # get coordinates of points in domain:
40  # set a function      x=mydomain.getX()
41  T_D=T_bot/L1*(L1-x[1])      print(x)
42  # save T_D for visualisation      # set a function
43  saveVTK("u.vtu",T=T_D)      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

Legend:
 Removed from v.5287 changed lines Added in v.5288