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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 606 - (hide annotations)
Mon Mar 20 23:34:00 2006 UTC (14 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 953 byte(s)
documentation on pyvisi added
1 cochrane 417 #!/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 gross 605 import esys.finley as fe
8 cochrane 417
9     import numarray
10    
11 gross 606 # from esys.pyvisi import *
12 gross 605 from esys.pyvisi.renderers.vtk import *
13 cochrane 417
14 gross 605 online=True
15    
16     tensorDomain = fe.Rectangle(9,9)
17 cochrane 417 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 gross 605 if online: scene.render(pause=True)
27 cochrane 417
28     scene.save(fname="escript_scalarData2D_contourPlot.png", format="png")
29    
30     scene = Scene()
31     plot = SurfacePlot(scene)
32 gross 606 plot.setData(-scalarData2D)
33 gross 605 if online: scene.render(pause=True)
34 gross 606 plot.setData(-scalarData2D)
35     if online: scene.render(pause=True)
36 cochrane 417
37 gross 606 # scene.save(fname="escript_scalarData2D_surfacePlot.png", format="png")
38 cochrane 417
39     # add SurfacePlot, MeshPlot etc here
40    
41     # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26