1 |
#!/usr/bin/env python |
2 |
|
3 |
|
4 |
# $Id: escript_threeDVectorData1D.py,v 1.3 2006/01/05 00:13:50 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 |
vectorDomain = bruce.Rectangle(9,1,10,1) |
15 |
vectorFunctionSpace=escript.ContinuousFunction(vectorDomain) |
16 |
|
17 |
vectorData3D = numarray.array([1.0,2.0,3.0]) |
18 |
|
19 |
# plotting 3D vectors in a 1D array |
20 |
threeDVectorData1D = Data(vectorData3D, vectorFunctionSpace, True) |
21 |
scene = Scene() |
22 |
plot = ArrowPlot3D(scene) |
23 |
plot.setData(threeDVectorData1D) |
24 |
scene.render(pause=True) |
25 |
|
26 |
scene.save(fname="escript_threeDVectorData1D_arrowPlot3D.png", format="png") |
27 |
|
28 |
# vim: expandtab shiftwidth=4: |