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

Diff of /trunk/doc/examples/usersguide/poisson.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/doc/user/examples/mypoisson.py revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC temp_trunk_copy/doc/examples/poisson.py revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    from esys.escript import *
3    from esys.escript.linearPDEs import Poisson
4  from esys.finley import Rectangle  from esys.finley import Rectangle
 from esys.linearPDEs import Poisson  
5  # generate domain:  # generate domain:
6  mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)  mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)
7  # define characteristic function of Gamma^D  # define characteristic function of Gamma^D
8  x = mydomain.getX()  x = mydomain.getX()
9  gammaD = x[0].whereZero()+x[1].whereZero()  gammaD = whereZero(x[0])+whereZero(x[1])
10  # define PDE and get its solution u  # define PDE and get its solution u
11  mypde = Poisson(domain=mydomain,f=1,q=gammaD)  mypde = Poisson(domain=mydomain)
12    mypde.setValue(f=1,q=gammaD)
13  u = mypde.getSolution()  u = mypde.getSolution()
14  # write u to an external file  # write u to an external file
15  u.saveDX("u.dx")  saveVTK("u.xml",sol=u)

Legend:
Removed from v.155  
changed lines
  Added in v.1384

  ViewVC Help
Powered by ViewVC 1.1.26