1 |
#!/usr/bin/env python |
2 |
|
3 |
|
4 |
# $Id: escript_threeByThreeTensorData3D.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 |
brickDomain = bruce.Brick(9,9,9,10,10,10) |
15 |
brickFunctionSpace=escript.ContinuousFunction(brickDomain) |
16 |
|
17 |
tensorData3x3 = numarray.array([[1.0,2.0,3.0],[3.0,4.0,5.0],[5.0,6.0,7.0]]) |
18 |
|
19 |
# plotting 3x3 tensors in a 3D array |
20 |
threeByThreeTensorData3D = Data(tensorData3x3, brickFunctionSpace, True) |
21 |
scene = Scene() |
22 |
plot = EllipsoidPlot(scene) |
23 |
plot.setData(threeByThreeTensorData3D) |
24 |
scene.render(pause=True) |
25 |
|
26 |
scene.save(fname="escript_threeByThreeTensorData3D_ellipsoidPlot.png", |
27 |
format="png") |
28 |
|
29 |
# vim: expandtab shiftwidth=4: |