Back to index

salome-paravis  6.5.0
demo_15_med.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 # ATTENTION. This script is prepared for the future not for current moment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
00022 
00023 if not ('servermanager' in dir()):
00024   from pvsimple import *
00025 
00026 import os
00027 
00028 def LoadMultipleFiles_med(FilePath, FilePrefix):
00029 
00030   TETRA_dom_fl = MEDReader( FileName = [FilePath + FilePrefix + '1' + '.med',
00031                                                                                FilePath + FilePrefix + '2' + '.med', 
00032                                                                                FilePath + FilePrefix + '3' + '.med',
00033                                                                                FilePath + FilePrefix + '4' + '.med',
00034                                                                                FilePath + FilePrefix + '5' + '.med',
00035                                                                                FilePath + FilePrefix + '6' + '.med'])
00036   TETRA_dom_fl.CellArrays = ['Pression', 'Temp.C', 'VitesseX']
00037   TETRA_dom_fl.GlobalFamilyStatus = ['1 1 1', '1 2 1', '1 3 1', '1 4 1', '1 5 1']
00038   TETRA_dom_fl.GlobalEntityStatus = ['0 203', '0 304']
00039 
00040   rv = GetRenderView()
00041   a1_Temp_C_PVLookupTable = CreateLookupTable( RGBPoints=[-1.3, 0.23, 0.3, 0.75, 200., 0.70, 0.016, 0.15],
00042                                                                                             VectorMode='Magnitude',
00043                                                                                             ColorSpace='Diverging',
00044                                                                                             ScalarRangeInitialized=1.0 )
00045 
00046   dr = Show()
00047   dr.EdgeColor = [0.0, 0.0, 0.50]
00048   dr.SelectionCellLabelColor = [0.0, 1.0, 0.0]
00049   dr.SelectionPointLabelJustification = 'Center'
00050   dr.SelectionCellLabelJustification = 'Center'
00051   dr.ScalarOpacityFunction = []
00052   dr.ColorArrayName = 'Temp.C'
00053   dr.SelectionLineWidth = 2.0
00054   dr.ScalarOpacityUnitDistance = 2.6738860338205099
00055   dr.SelectionCellLabelFontSize = 24
00056   dr.SelectionColor = [1.0, 0.0, 1.0]
00057   dr.SelectionRepresentation = 'Wireframe'
00058   dr.LookupTable = a1_Temp_C_PVLookupTable
00059 
00060   rv.CameraPosition = [50.0, -29.75, 267.55447959748415]
00061   rv.CameraFocalPoint = [50.0, -29.75, 0.0]
00062   rv.CameraClippingRange = [248.95893480150932, 291.60779679144639]
00063   rv.CenterOfRotation = [50.0, -29.75, 0.0]
00064   rv.CameraParallelScale = 69.24819492232271
00065 
00066   Render()
00067 
00068 testdir = os.getenv("TESTDIR")
00069 pvdata = os.getenv("PVDATA")
00070 
00071 if __name__ == "__main__":
00072   LoadMultipleFiles_med(FilePath=testdir+"/TETRA_domaine_fluide/", FilePrefix="TETRA_domaine_fluide")