/[escript]/trunk/pyvisi/examples/escript_scalarData2D.py
ViewVC logotype

Contents of /trunk/pyvisi/examples/escript_scalarData2D.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 606 - (show annotations)
Mon Mar 20 23:34:00 2006 UTC (13 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 953 byte(s)
documentation on pyvisi added
1 #!/usr/bin/env python
2
3
4 # $Id: escript_scalarData2D.py,v 1.3 2006/01/03 08:46:20 paultcochrane Exp $
5
6 from esys.escript import *
7 import esys.finley as fe
8
9 import numarray
10
11 # from esys.pyvisi import *
12 from esys.pyvisi.renderers.vtk import *
13
14 online=True
15
16 tensorDomain = fe.Rectangle(9,9)
17 tensorFunctionSpace=escript.ContinuousFunction(tensorDomain)
18 domainData = tensorFunctionSpace.getX()
19
20 # plotting scalar data in a 2D array
21 scalarData2D = sin(domainData[0])
22
23 scene = Scene()
24 plot = ContourPlot(scene)
25 plot.setData(scalarData2D)
26 if online: scene.render(pause=True)
27
28 scene.save(fname="escript_scalarData2D_contourPlot.png", format="png")
29
30 scene = Scene()
31 plot = SurfacePlot(scene)
32 plot.setData(-scalarData2D)
33 if online: scene.render(pause=True)
34 plot.setData(-scalarData2D)
35 if online: scene.render(pause=True)
36
37 # scene.save(fname="escript_scalarData2D_surfacePlot.png", format="png")
38
39 # add SurfacePlot, MeshPlot etc here
40
41 # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26