1 |
|
2 |
######################################################## |
3 |
# |
4 |
# Copyright (c) 2003-2009 by University of Queensland |
5 |
# Earth Systems Science Computational Center (ESSCC) |
6 |
# http://www.uq.edu.au/esscc |
7 |
# |
8 |
# Primary Business: Queensland, Australia |
9 |
# Licensed under the Open Software License version 3.0 |
10 |
# http://www.opensource.org/licenses/osl-3.0.php |
11 |
# |
12 |
######################################################## |
13 |
|
14 |
__copyright__="""Copyright (c) 2003-2008 by University of Queensland |
15 |
Earth Systems Science Computational Center (ESSCC) |
16 |
http://www.uq.edu.au/esscc |
17 |
Primary Business: Queensland, Australia""" |
18 |
__license__="""Licensed under the Open Software License version 3.0 |
19 |
http://www.opensource.org/licenses/osl-3.0.php""" |
20 |
__url__="https://launchpad.net/escript-finley" |
21 |
|
22 |
# $Id$ |
23 |
from esys.escript import * |
24 |
from esys.escript.linearPDEs import LinearPDE |
25 |
from esys.finley import Rectangle |
26 |
#... set some parameters ... |
27 |
kappa=1. |
28 |
omega=0.1 |
29 |
eta=10. |
30 |
#... generate domain ... |
31 |
mydomain = Rectangle(l0=5.,l1=1.,n0=50, n1=10) |
32 |
#... open PDE and set coefficients ... |
33 |
mypde=LinearPDE(mydomain) |
34 |
mypde.setSymmetryOn() |
35 |
n=mydomain.getNormal() |
36 |
x=mydomain.getX() |
37 |
mypde.setValue(A=kappa*kronecker(mydomain),D=omega,Y=omega*x[0], \ |
38 |
d=eta,y=kappa*n[0]+eta*x[0]) |
39 |
#... calculate error of the PDE solution ... |
40 |
u=mypde.getSolution() |
41 |
print "error is ",Lsup(u-x[0]) |
42 |
# output should be similar to "error is 1.e-7" |
43 |
saveVTK("x0.vtu",sol=u) |
44 |
|