/[escript]/trunk/doc/examples/poisson_with_pyvisi.py
ViewVC logotype

Annotation of /trunk/doc/examples/poisson_with_pyvisi.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1097 - (hide annotations)
Mon Apr 16 23:03:55 2007 UTC (14 years, 6 months ago) by jongui
File MIME type: text/x-python
File size: 887 byte(s)
Added more examples reading directly from escript objects.
1 jongui 1097 # $Id: poisson.py 567 2006-02-28 03:58:05Z gross $
2     from esys.escript import *
3     from esys.escript.linearPDEs import Poisson
4     from esys.finley import Rectangle
5     from esys.pyvisi import Scene, DataCollector, Map
6     from esys.pyvisi.constant import *
7    
8     # generate domain:
9     mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)
10     # define characteristic function of Gamma^D
11     x = mydomain.getX()
12     gammaD = whereZero(x[0])+whereZero(x[1])
13     # define PDE and get its solution u
14     mypde = Poisson(domain=mydomain)
15     mypde.setValue(f=1,q=gammaD)
16     u = mypde.getSolution()
17     # write u to an external file
18     #saveVTK("u.xml",sol=u)
19    
20     s = Scene(renderer = Renderer.ONLINE, x_size = 500, y_size = 500)
21    
22     dc = DataCollector(source = Source.ESCRIPT)
23     dc.setData(sol = u)
24    
25     Map(scene = s, data_collector = dc, viewport = Viewport.SOUTH_WEST,
26     lut = Lut.COLOR, cell_to_point = True, outline = True)
27    
28     s.render(image_name = "poisson.jpg")

  ViewVC Help
Powered by ViewVC 1.1.26