/[escript]/trunk/doc/examples/usersguide/heatedblock.py
ViewVC logotype

Annotation of /trunk/doc/examples/usersguide/heatedblock.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 578 - (hide annotations)
Mon Mar 6 06:12:04 2006 UTC (13 years, 4 months ago) by gross
Original Path: trunk/doc/user/examples/heatedblock.py
File MIME type: text/x-python
File size: 700 byte(s)
new section in the tutorial
1 gross 578 # $Id: helmholtz.py 575 2006-03-03 03:33:07Z lkettle $
2     from esys.escript import *
3     from esys.escript.linearPDEs import LinearPDE
4     from esys.finley import Rectangle
5     #... set some parameters ...
6     kappa=1.
7     omega=0.1
8     eta=10.
9     #... generate domain ...
10     mydomain = Rectangle(l0=5.,l1=1.,n0=50, n1=10)
11     #... open PDE and set coefficients ...
12     mypde=LinearPDE(mydomain)
13     mypde.setSymmetryOn()
14     n=mydomain.getNormal()
15     x=mydomain.getX()
16     mypde.setValue(A=kappa*kronecker(mydomain),D=omega,Y=omega*x[0], \
17     d=eta,y=kappa*n[0]+eta*x[0])
18     #... calculate error of the PDE solution ...
19     u=mypde.getSolution()
20     print "error is ",Lsup(u-x[0])
21     # output should be similar to "error is 1.e-7"
22     saveVTK("x0.xml",sol=u)
23    

  ViewVC Help
Powered by ViewVC 1.1.26