/[escript]/trunk/modellib/py_src/visualization.py
ViewVC logotype

Diff of /trunk/modellib/py_src/visualization.py

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

revision 910 by gross, Thu Nov 23 06:39:39 2006 UTC revision 911 by gross, Tue Dec 5 23:39:39 2006 UTC
# Line 7  __license__="""Licensed under the Open S Line 7  __license__="""Licensed under the Open S
7               http://www.opensource.org/licenses/osl-3.0.php"""               http://www.opensource.org/licenses/osl-3.0.php"""
8    
9  from esys.escript.modelframe import Model  from esys.escript.modelframe import Model
10  from esys.escript import saveVTK  from esys.escript import saveVTK, Data
11  import os  import os
12    
13  class Visualization(Model):  class Visualization(Model):
# Line 81  class Visualization(Model): Line 81  class Visualization(Model):
81          if self.writeFrame():          if self.writeFrame():
82              if self.debug():              if self.debug():
83                 self.trace("%s-th frame at time %s"%(self.getFrameCounter(),self.t))                 self.trace("%s-th frame at time %s"%(self.getFrameCounter(),self.t))
84                 if not self.scalar==None:                 if isinstance(self.scalar,Data):
85                    self.trace("scalar data: (min,max) =(%s,%s)"%(inf(self.scalar),sup(self.scalar)))                    self.trace("scalar data: (min,max) =(%s,%s)"%(inf(self.scalar),sup(self.scalar)))
86                 if not self.vector==None:                 if isinstance(self.vector,Data):
87                    self.trace("vector data: (min,max) =(%s,%s)"%(inf(self.vector),sup(self.vector)))                    self.trace("vector data: (min,max) =(%s,%s)"%(inf(self.vector),sup(self.vector)))
88                 if not self.tensor==None:                 if isinstance(self.tensor,Data):
89                    self.trace("tensor data: (min,max) =(%s,%s)"%(inf(self.tensor),sup(self.tensor)))                    self.trace("tensor data: (min,max) =(%s,%s)"%(inf(self.tensor),sup(self.tensor)))
90    
91  class WriteVTK(Visualization):  class WriteVTK(Visualization):
# Line 122  class WriteVTK(Visualization): Line 122  class WriteVTK(Visualization):
122                
123      def doInitialPostprocessing(self):      def doInitialPostprocessing(self):
124          kwargs={}          kwargs={}
125          if not self.scalar==None: kwargs["scalar"] = self.scalar          if isinstance(self.scalar,Data): kwargs["scalar"] = self.scalar
126          if not self.vector==None: kwargs["vector"] = self.vector          if isinstance(self.vector,Data): kwargs["vector"] = self.vector
127          if not self.tensor==None: kwargs["tensor"] = self.tensor          if isinstance(self.tensor,Data): kwargs["tensor"] = self.tensor
128          saveVTK(self.__filename%self.getFrameCounter(),**kwargs)          saveVTK(self.__filename%self.getFrameCounter(),**kwargs)
129          self.trace("%s-th frame at time %s is writen to %s"%(self.getFrameCounter(),self.t,self.__filename%self.getFrameCounter()))          self.trace("%s-th frame at time %s is writen to %s"%(self.getFrameCounter(),self.t,self.__filename%self.getFrameCounter()))
130    
# Line 138  class WriteVTK(Visualization): Line 138  class WriteVTK(Visualization):
138          """          """
139          if self.writeFrame():          if self.writeFrame():
140              kwargs={}              kwargs={}
141              if not self.scalar==None: kwargs["scalar"] = self.scalar              if isinstance(self.scalar,Data): kwargs["scalar"] = self.scalar
142              if not self.vector==None: kwargs["vector"] = self.vector              if isinstance(self.vector,Data): kwargs["vector"] = self.vector
143              if not self.tensor==None: kwargs["tensor"] = self.tensor              if isinstance(self.tensor,Data): kwargs["tensor"] = self.tensor
144              saveVTK(self.__filename%self.getFrameCounter(),**kwargs)              saveVTK(self.__filename%self.getFrameCounter(),**kwargs)
145              self.trace("%s-th frame at time %s is writen to %s"%(self.getFrameCounter(),self.t,self.__filename%self.getFrameCounter()))              self.trace("%s-th frame at time %s is writen to %s"%(self.getFrameCounter(),self.t,self.__filename%self.getFrameCounter()))
146    

Legend:
Removed from v.910  
changed lines
  Added in v.911

  ViewVC Help
Powered by ViewVC 1.1.26