/[escript]/trunk/doc/examples/pyvisi/heatedblock_with_pyvisi.py
ViewVC logotype

Diff of /trunk/doc/examples/pyvisi/heatedblock_with_pyvisi.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1147 by ksteube, Wed May 16 06:39:11 2007 UTC revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC
# Line 4  from esys.escript.linearPDEs import Line Line 4  from esys.escript.linearPDEs import Line
4  from esys.finley import Brick  from esys.finley import Brick
5  from esys.pyvisi import Scene, DataCollector, Velocity, Camera  from esys.pyvisi import Scene, DataCollector, Velocity, Camera
6  from esys.pyvisi.constant import *  from esys.pyvisi.constant import *
7    import os
8    
9  PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images/"  PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images"
10  X_SIZE = 400  X_SIZE = 400
11  Y_SIZE = 400  Y_SIZE = 400
12  JPG_RENDERER = Renderer.ONLINE_JPG  JPG_RENDERER = Renderer.ONLINE_JPG
# Line 52  s = Scene(renderer = JPG_RENDERER, x_siz Line 53  s = Scene(renderer = JPG_RENDERER, x_siz
53    
54  # Create a DataCollector reading directly from an escript object.  # Create a DataCollector reading directly from an escript object.
55  dc = DataCollector(source = Source.ESCRIPT)  dc = DataCollector(source = Source.ESCRIPT)
56  dc.setData(disp = u,stress = sigma_mises)  dc.setData(disp = u, stress = sigma_mises)
57    
58  # Create a Velocity.  # Create a Velocity.
59  v = Velocity(scene = s, data_collector = dc, viewport = Viewport.SOUTH_WEST,  v = Velocity(scene = s, data_collector = dc, viewport = Viewport.SOUTH_WEST,
# Line 61  v = Velocity(scene = s, data_collector = Line 62  v = Velocity(scene = s, data_collector =
62  v.setScaleFactor(scale_factor = 0.3)  v.setScaleFactor(scale_factor = 0.3)
63    
64  # Create a Camera.  # Create a Camera.
65  c = Camera(scene = s, data_collector = dc, viewport = Viewport.SOUTH_WEST)  c = Camera(scene = s, viewport = Viewport.SOUTH_WEST)
66  c.isometricView()  c.isometricView()
67    
 # Render the object.  
 s.render(image_name = PYVISI_EXAMPLE_IMAGES_PATH + "heatedblock.jpg")  
68    
69    # Render the object.
70    s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH,\
71            "heatedblock.jpg"))

Legend:
Removed from v.1147  
changed lines
  Added in v.1148

  ViewVC Help
Powered by ViewVC 1.1.26