/[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 417 - (show annotations)
Fri Jan 6 01:54:48 2006 UTC (14 years, 6 months ago) by cochrane
File MIME type: text/x-python
File size: 846 byte(s)
Initial import to repository.  These are the example scripts specific for
escript Data object testing.

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 from esys import bruce
8
9 import numarray
10
11 from pyvisi import *
12 from pyvisi.renderers.vtk import *
13
14 tensorDomain = bruce.Rectangle(9,9,10,10)
15 tensorFunctionSpace=escript.ContinuousFunction(tensorDomain)
16 domainData = tensorFunctionSpace.getX()
17
18 # plotting scalar data in a 2D array
19 scalarData2D = sin(domainData[0])
20
21 scene = Scene()
22 plot = ContourPlot(scene)
23 plot.setData(scalarData2D)
24 scene.render(pause=True)
25
26 scene.save(fname="escript_scalarData2D_contourPlot.png", format="png")
27
28 scene = Scene()
29 plot = SurfacePlot(scene)
30 plot.setData(scalarData2D)
31 scene.render(pause=True)
32
33 scene.save(fname="escript_scalarData2D_surfacePlot.png", format="png")
34
35 # add SurfacePlot, MeshPlot etc here
36
37 # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26