/[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 994 - (show annotations)
Fri Feb 23 07:00:54 2007 UTC (12 years, 1 month ago) by jongui
File MIME type: text/x-python
File size: 2076 byte(s)
Modified the way setActiveScalar, setActiveVector and setActiveTensor are specified. It appears that the attributes have to be set each time a new file is read.
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/results.xml")
10 dc1.setActiveVector("vector")
11 dc1.setActiveScalar("scalar2")
12
13 dc2 = DataCollector(source = Source.XML)
14 dc2.setFileName(file_name =
15 "/home/jongui/results.xml")
16 dc2.setActiveVector("vector")
17 dc2.setActiveScalar("scalar1")
18
19 dc3 = DataCollector(source = Source.XML)
20 dc3.setFileName(file_name =
21 "/home/jongui/results.xml")
22 dc3.setActiveVector("vector2")
23 dc3.setActiveScalar("scalar1")
24
25
26 # Create a velocity instance in the first viewport.
27 v1 = Velocity(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST,
28 arrow = Arrow.THREE_D, color_mode = ColorMode.VECTOR,
29 lut = Lut.COLOR, outline = True)
30 v1.setRepresentationToWireframe()
31 v1.setScaleFactor(scale_factor = 0.3)
32 v1.setScaleModeByScalar()
33 v1.setDimension(x = 2, y = 2, z = 2)
34
35 # Create a velocity instance in the second viewport.
36 v2 = Velocity(scene = s, data_collector = dc2, viewport = Viewport.NORTH_WEST,
37 arrow = Arrow.THREE_D, color_mode = ColorMode.VECTOR,
38 lut = Lut.COLOR, outline = True)
39 #v2.setColor(color = Color.BLUE)
40 v2.setScaleModeByScalar()
41 v2.setScaleFactor(scale_factor = 0.2)
42
43 # Create a velocity instance in the third viewport.
44 v3 = Velocity(scene = s, data_collector = dc2, viewport = Viewport.NORTH_EAST,
45 arrow = Arrow.TWO_D, color_mode = ColorMode.SCALAR,
46 lut = Lut.COLOR, outline = True)
47 v3.setScaleFactor(scale_factor = 0.2)
48 v3.setScaleModeByVector()
49 v3.setDimension(x = 1, y = 1, z = 1)
50
51 # Create a velocity instance in the fourth viewport.
52 v4 = Velocity(scene = s, data_collector = dc3, viewport = Viewport.SOUTH_EAST,
53 arrow = Arrow.TWO_D, color_mode = ColorMode.SCALAR,
54 lut = Lut.COLOR, outline = True)
55 v4.setOpacity(opacity = 0.5)
56 v4.setScaleModeByVector()
57 v4.setScaleFactor(scale_factor = 0.2)
58
59 s.render()

  ViewVC Help
Powered by ViewVC 1.1.26