1 |
#!/usr/bin/env python |
2 |
|
3 |
|
4 |
# $Id: escript_twoDVectorData1D.py,v 1.4 2006/01/05 05:06:36 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 |
vectorData2D = numarray.array([1.0,2.0]) |
18 |
|
19 |
# plotting 2D vectors in a 1D array |
20 |
twoDVectorData1D = Data(vectorData2D, vectorFunctionSpace, True) |
21 |
|
22 |
scene = Scene() |
23 |
plot = ArrowPlot(scene) |
24 |
plot.setData(twoDVectorData1D) |
25 |
scene.render(pause=True) |
26 |
|
27 |
scene.save(fname="escript_twoDVectorData1D_arrowPlot.png", format="png") |
28 |
|
29 |
# vim: expandtab shiftwidth=4: |