Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / src / MED / MED_test2.py
index 47ce56eb82f4aaedaa284bc0e396248f0279dec4..946583ead612c1335c133270ef85dab5c6690c48 100755 (executable)
@@ -1,23 +1,43 @@
-#==============================================================================
-#  File      : MED_test2.py
-#  Created   :
-#  Author    : 
-#  Project   : SALOME
-#  Copyright : EDF 2002
+#  MED MED : implemetation of MED idl descriptions
+#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+#
+#
+#
+#  File   : MED_test2.py
+#  Author : 
+#  Module : MED
 #  $Header$
-#==============================================================================
 
 import salome
 import SALOME
 import os
 
-filePath=os.getenv("SALOME_BUILD")
-filePath=filePath+"/../SALOME_ROOT/data/"
+filePath=os.environ["MED_ROOT_DIR"]
+filePath=filePath+"/share/salome/resources/"
+medFile=filePath+"mesh.med"
 
 med=salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
 
 try:
-  mesh=med.readMeshInFile(filePath+"/mesh.med", salome.myStudyName,"Mesh 1")
+  mesh=med.readMeshInFile(medFile, salome.myStudyName,"Mesh 1")
 except SALOME.SALOME_Exception, ex:
   print ex.details
   print ex.details.type
@@ -30,8 +50,9 @@ except SALOME.SALOME_Exception, ex:
 print mesh.getName()
 print mesh.getNumberOfNodes()
 
+medFile = filePath+"pointe.med"
 try:
-  field=med.readFieldInFile(filePath+"/pointe.med",salome.myStudyName,"fieldcelldouble",-1,-1)
+  field=med.readFieldInFile(medFile,salome.myStudyName,"fieldcelldouble",-1,-1)
 except SALOME.SALOME_Exception, ex:
   print ex.details
   print ex.details.type