/[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 605 - (hide annotations)
Mon Mar 20 07:16:27 2006 UTC (14 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 884 byte(s)
pyvisi with vtk runs noe on the altix
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 605 from esys.pyvisi import *
12     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     plot.setData(scalarData2D)
33 gross 605 if online: scene.render(pause=True)
34 cochrane 417
35     scene.save(fname="escript_scalarData2D_surfacePlot.png", format="png")
36    
37     # add SurfacePlot, MeshPlot etc here
38    
39     # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26