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