/[escript]/trunk/finley/test/python/axisymm-movie.py
ViewVC logotype

Annotation of /trunk/finley/test/python/axisymm-movie.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1393 - (hide annotations)
Mon Jan 21 06:21:14 2008 UTC (11 years, 7 months ago) by gross
File MIME type: text/x-python
File size: 1305 byte(s)
axissymmetric collaps added.
1 gross 1393 from esys.pyvisi import Scene, DataCollector, Map, Camera, Velocity, Legend
2     from esys.pyvisi import Movie, LocalPosition
3     from esys.pyvisi.constant import *
4     import os
5    
6     X_SIZE = 800
7     Y_SIZE = 600
8    
9    
10     JPG_RENDERER = Renderer.ONLINE_JPG
11     s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE, y_size = Y_SIZE)
12    
13     # Create a DataCollector reading from a XML file.
14     dc1 = DataCollector(source = Source.XML)
15     dc1.setActiveScalar(scalar = "p")
16     dc1.setActiveVector(vector = "U")
17    
18     # Create a Map.
19     m1 = Map(scene = s, data_collector = dc1, lut = Lut.COLOR, cell_to_point = False, outline = True)
20    
21     vopc1 = Velocity(scene = s, data_collector = dc1,
22     color_mode = ColorMode.VECTOR,
23     arrow = Arrow.THREE_D, lut = Lut.COLOR, cell_to_point = False,
24     outline = False)
25     vopc1.setScaleFactor(scale_factor = 0.04)
26    
27    
28     # Create a Camera.
29     cam1 = Camera(scene = s, viewport = Viewport.SOUTH_WEST)
30    
31     # Create a movie.
32     mov = Movie()
33     #lst = []
34    
35     # Read in one file one after another and render the object.
36     images=[]
37     for i in range(0,50):
38     dc1.setFileName("u.%d.xml"%i)
39     image="frame.%06d.jpg"%i
40     s.render(image_name = os.path.join(".",image))
41     images.append(image)
42    
43     mov.imageList(input_directory = ".", image_list = images)
44    
45     # Generate the movie.
46     mov.makeMovie(os.path.join(".", "movie.mpg"))
47    

  ViewVC Help
Powered by ViewVC 1.1.26