/[escript]/trunk/pyvisi/py_src/examples/velocity.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/examples/velocity.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 988 - (show annotations)
Tue Feb 20 07:21:12 2007 UTC (12 years, 6 months ago) by jongui
File MIME type: text/x-python
File size: 1730 byte(s)
Both point and cell data should now work properly with Pyvisi. Some testing have been done but a more extensive test will be done at a later stage.
1 from esys.pyvisi import DataCollector, Velocity, Scene
2 from esys.pyvisi.constant import *
3
4 s = Scene(renderer = Renderer.ONLINE, num_viewport = 4, x_size = 1000,
5 y_size = 800)
6
7 dc1 = DataCollector(source = Source.XML)
8 dc1.setFileName(file_name =
9 "/home/jongui/trunk/pyvisi/test/python/data_data/interior_3D.xml")
10 #"/home/jongui/data/matt/heat_velocity/source/temp-000649.vtu")
11
12 # Create a velocity instance in the first viewport.
13 v1 = Velocity(scene = s, data_collector = dc1, scalar = None, vector= "velocity_cell",
14 viewport = Viewport.SOUTH_WEST, arrow = Arrow.THREE_D,
15 color_mode = ColorMode.VECTOR, lut = Lut.COLOR, outline = True)
16 v1.setRepresentationToWireframe()
17 v1.setScaleFactor(0.2)
18 v1.setScaleModeByScalar()
19 v1.setDimension(2,2,2)
20
21 # Create a velocity instance in the second viewport.
22 v2 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
23 viewport = Viewport.NORTH_WEST, arrow = Arrow.THREE_D,
24 color_mode = ColorMode.SCALAR, lut = Lut.COLOR, outline = True)
25 v2.setColor(Color.BLUE)
26 v2.setScaleFactor(0.2)
27
28 # Create a velocity instance in the third viewport.
29 v3 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
30 viewport = Viewport.NORTH_EAST, arrow = Arrow.TWO_D,
31 color_mode = ColorMode.VECTOR, lut = Lut.GREY_SCALE, outline = True)
32 v3.setScaleFactor(0.2)
33 v3.setDimension(4,4,4)
34
35 # Create a velocity instance in the fourth viewport.
36 v4 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
37 viewport = Viewport.SOUTH_EAST, arrow = Arrow.TWO_D,
38 color_mode = ColorMode.SCALAR, lut = Lut.COLOR, outline = True)
39 v4.setOpacity(0.5)
40 v4.setScaleFactor(0.2)
41
42 s.render()

  ViewVC Help
Powered by ViewVC 1.1.26