/[escript]/trunk/pyvisi/py_src/streamlinemodule.py
ViewVC logotype

Diff of /trunk/pyvisi/py_src/streamlinemodule.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 1197 by jongui, Mon Jun 18 02:08:34 2007 UTC
# Line 1  Line 1 
1  """  """
2  @author: John NGUI  @var __author__: name of author
3    @var __copyright__: copyrights
4    @var __license__: licence agreement
5    @var __url__: url entry point on documentation
6    @var __version__: version
7    @var __date__: date of the version
8  """  """
9    
10    __author__="John Ngui, john.ngui@uq.edu.au"
11    __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
12                        http://www.access.edu.au
13                    Primary Business: Queensland, Australia"""
14    __license__="""Licensed under the Open Software License version 3.0
15                 http://www.opensource.org/licenses/osl-3.0.php"""
16    __url__="http://www.iservo.edu.au/esys"
17    __version__="$Revision$"
18    __date__="$Date$"
19    
20    
21  import vtk  import vtk
22    
23  class StreamLineModule:  class StreamLineModule:
# Line 9  class StreamLineModule: Line 25  class StreamLineModule:
25      Class that defines the streamline module.      Class that defines the streamline module.
26      """      """
27    
28      def __init__(self, object, source):      def __init__(self):
29          """          """
30          Initialise the streamline module.          Initialise the streamline module.
31            """
32    
33            self.__vtk_stream_line = vtk.vtkStreamLine()
34    
35        def _setupStreamLineModule(self, object, source):
36            """
37            Setup the streamline.
38    
39          @type object: vtkUnstructuredGrid, etc          @type object: vtkUnstructuredGrid, etc
40          @param object: Input for the streamline          @param object: Input for the streamline
# Line 21  class StreamLineModule: Line 44  class StreamLineModule:
44    
45          self.__object = object          self.__object = object
46          self.__source = source          self.__source = source
         self.__vtk_stream_line = vtk.vtkStreamLine()  
   
         self.__setupStreamLineModule()  
   
     def __setupStreamLineModule(self):  
         """  
         Setup the streamline.  
         """  
47    
48          self.__setInput()          self.__setInput()
49          self.__setSource()          self.__setSource()
# Line 42  class StreamLineModule: Line 57  class StreamLineModule:
57          self.setIntegrationToBothDirections()          self.setIntegrationToBothDirections()
58          # Default integrator is set to vtkRungeKutta4          # Default integrator is set to vtkRungeKutta4
59          self.setIntegrator(vtk.vtkRungeKutta4())              self.setIntegrator(vtk.vtkRungeKutta4())    
         self.__vtk_stream_line.Update()  
60    
61      def __setInput(self):      def __setInput(self):
62          """          """
# Line 80  class StreamLineModule: Line 94  class StreamLineModule:
94    
95          @type length: Number          @type length: Number
96          @param length: Length of the streamline segment expressed in          @param length: Length of the streamline segment expressed in
97          elapsed time                  elapsed time
98          """          """
99    
100          self.__vtk_stream_line.SetStepLength(length)              self.__vtk_stream_line.SetStepLength(length)    
# Line 93  class StreamLineModule: Line 107  class StreamLineModule:
107    
108          @type length: Number          @type length: Number
109          @param length: Length of the integration step expressed as a fraction          @param length: Length of the integration step expressed as a fraction
110          of the size of each cell                  of the size of each cell
111          """          """
112    
113          self.__vtk_stream_line.SetIntegrationStepLength(length)          self.__vtk_stream_line.SetIntegrationStepLength(length)
# Line 104  class StreamLineModule: Line 118  class StreamLineModule:
118          goes) and backward (where the streamline came from).          goes) and backward (where the streamline came from).
119          """          """
120    
121          self.__vtk_stream_line.SetIntegrationDirectionToIntegrateBothDirections()          self.__vtk_stream_line.\
122                    SetIntegrationDirectionToIntegrateBothDirections()
123    
124      def setIntegrator(self, integrator):      def setIntegrator(self, integrator):
125          """          """
# Line 131  class StreamLineModule: Line 146  class StreamLineModule:
146    
147          self.__vtk_stream_line.SpeedScalarsOff()          self.__vtk_stream_line.SpeedScalarsOff()
148    
149      def _getOutput(self):      def _getStreamLineModuleOutput(self):
150          """          """
151          Return the output of the streamline.          Return the output of the streamline.
152    

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

  ViewVC Help
Powered by ViewVC 1.1.26