/[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 637 - (hide annotations)
Thu Mar 23 10:55:31 2006 UTC (14 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 1567 byte(s)
more copyright statements 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 gross 637 """
6     @var __author__: name of author
7     @var __license__: licence agreement
8     @var __copyright__: copyrights
9     @var __url__: url entry point on documentation
10     @var __version__: version
11     @var __date__: date of the version
12     """
13 cochrane 417
14 gross 637 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
15     http://www.access.edu.au
16     Primary Business: Queensland, Australia"""
17     __license__="""Licensed under the Open Software License version 3.0
18     http://www.opensource.org/licenses/osl-3.0.php"""
19     __author__="Paul Cochrane"
20     __url__="http://www.iservo.edu.au/esys"
21     __version__="$Revision$"
22     __date__="$Date$"
23    
24 cochrane 417 from esys.escript import *
25 gross 605 import esys.finley as fe
26 cochrane 417
27     import numarray
28    
29 gross 606 # from esys.pyvisi import *
30 gross 605 from esys.pyvisi.renderers.vtk import *
31 cochrane 417
32 gross 605 online=True
33    
34     tensorDomain = fe.Rectangle(9,9)
35 cochrane 417 tensorFunctionSpace=escript.ContinuousFunction(tensorDomain)
36     domainData = tensorFunctionSpace.getX()
37    
38     # plotting scalar data in a 2D array
39     scalarData2D = sin(domainData[0])
40    
41     scene = Scene()
42     plot = ContourPlot(scene)
43     plot.setData(scalarData2D)
44 gross 605 if online: scene.render(pause=True)
45 cochrane 417
46     scene.save(fname="escript_scalarData2D_contourPlot.png", format="png")
47    
48     scene = Scene()
49     plot = SurfacePlot(scene)
50 gross 606 plot.setData(-scalarData2D)
51 gross 605 if online: scene.render(pause=True)
52 gross 606 plot.setData(-scalarData2D)
53     if online: scene.render(pause=True)
54 cochrane 417
55 gross 606 # scene.save(fname="escript_scalarData2D_surfacePlot.png", format="png")
56 cochrane 417
57     # add SurfacePlot, MeshPlot etc here
58    
59     # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26