]> SALOME platform Git repositories - tools/medcoupling.git/blobdiff - doc/MEDMEM/MESHconnectivities.py
Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[tools/medcoupling.git] / doc / MEDMEM / MESHconnectivities.py
index 623a348d73962f667cecc2623a1935f14829c3af..19bf5c4a4f93458fcaa53830bd6cd3fdb8b58c42 100644 (file)
@@ -1,9 +1,16 @@
+# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
+#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
+# 
 from libMEDMEM_Swig import *
 
 MedFile = "pointe.med"
 #MedFile = "carre_quad4_3.med"
+#MedFile = "polyedres.med"
+#MedFile = "polygones.med"
 meshName = "maa1"
 #meshName = "CARRE_EN_QUAD4"
+#meshName = "Erreur orientation"
+#meshName = "Bord"
 
 myMesh = MESH(MED_DRIVER,MedFile,meshName)
 myMesh.read()
@@ -120,3 +127,35 @@ else:
 
         print constituent," : ",(i+1)," : ",constituentConnectivity[
             (indexBegin-1):(indexEnd-1)]
+        pass
+    pass
+
+nbPolygons = myMesh.getNumberOfPolygons()
+if nbPolygons > 0 :
+    print ""
+    print "     Show Connectivity (Nodal) of POLYGONS:"
+    print ""
+    connectivity = myMesh.getPolygonsConnectivity(MED_NODAL,MED_CELL)
+    index = myMesh.getPolygonsConnectivityIndex(MED_NODAL,MED_CELL)
+    for j in range(nbPolygons):
+        print "       Polygon",(j+1)," ",connectivity[ index[j]-1 : index[j+1]-1 ]
+        pass
+    pass
+
+nbPolyhedrons = myMesh.getNumberOfPolyhedron()
+if nbPolyhedrons > 0 :
+    print ""
+    print "     Show Connectivity (Nodal) of POLYHEDRONS:"
+    print ""
+    connectivity = myMesh.getPolyhedronConnectivity(MED_NODAL)
+    fIndex = myMesh.getPolyhedronFacesIndex()
+    index = myMesh.getPolyhedronIndex(MED_NODAL)
+    for j in range(nbPolyhedrons):
+        print     "       Polyhedra",(j+1)
+        iF1, iF2 = index[ j ]-1, index[ j+1 ]-1
+        for f in range( iF2 - iF1 ):
+            iN1, iN2 = fIndex[ iF1+f ]-1, fIndex[ iF1+f+1 ]-1
+            print "         Face",f+1," ",connectivity[ iN1 : iN2 ]
+            pass
+        pass
+    pass