Back to index

salome-paravis  6.5.0
demo12.py
Go to the documentation of this file.
00001 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 #
00003 # This library is free software; you can redistribute it and/or
00004 # modify it under the terms of the GNU Lesser General Public
00005 # License as published by the Free Software Foundation; either
00006 # version 2.1 of the License.
00007 #
00008 # This library is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 # Lesser General Public License for more details.
00012 #
00013 # You should have received a copy of the GNU Lesser General Public
00014 # License along with this library; if not, write to the Free Software
00015 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 #
00017 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 #
00019 
00020 
00021 if not ('servermanager' in dir()):
00022   from pvsimple import *
00023 
00024 import os
00025 
00026 def demo12(fname, impth):
00027     """This method demonstrates the Stream Tracer."""
00028 
00029     reader = ExodusIIReader(FileName=fname)
00030     v=GetActiveView()
00031     streamTracer = StreamTracer(reader)
00032     streamTracer.Vectors  = 'V'
00033     streamTracer.SeedType.NumberOfPoints = 100
00034     streamTracer.SeedType.Radius = 1.15
00035     streamTracer.MaximumStreamlineLength = 25.
00036 
00037     Show(streamTracer)
00038     camera = GetActiveCamera()
00039     camera.Elevation(-45)
00040     camera.Dolly(0.4)
00041     dp1 = GetDisplayProperties(streamTracer)
00042     streamTracer.PointData[:]
00043     ##[Array: Temp, Array: V, Array: Pres, Array: AsH3, Array: GaMe3, Array: CH4, Array: H2, Array: IntegrationTime, Array: Vorticity, Array: Rotation,     ##Array: AngularVelocity, Array: Normals]
00044     
00045     pres = streamTracer.PointData[2]
00046     dp1.LookupTable = MakeBlueToRedLT(pres.GetRange()[0],pres.GetRange()[1])
00047     dp1.ColorAttributeType = 'POINT_DATA'
00048     dp1.ColorArrayName = 'Pres'
00049     Render()
00050     WriteImage(filename = (impth + "streamTracer_1.png"), view=v, Magnification=2)
00051 
00052 testdir = os.getenv("TESTDIR")
00053 pvdata = os.getenv("PVDATA")
00054 
00055 if __name__ == "__main__":
00056  demo12(fname=pvdata+"/Data/disk_out_ref.ex2", impth=testdir+"/Pic/")