]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Splitter now manage all levs
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 29 Jun 2017 06:52:26 +0000 (08:52 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 29 Jun 2017 06:52:26 +0000 (08:52 +0200)
src/MEDLoader/Swig/MEDLoaderSplitter.py

index 99afdd3f4e0e41e19443e8772002b3b0b6c1e2e3..6acbc1f18fd11d3bade41cdd153b9f20a61f1e14 100644 (file)
@@ -96,18 +96,26 @@ class MEDLoaderSplitter:
 
     def __splitMesh(self,mfm,idsLst):
         ret0 = [MEDFileMeshes() for i in range(len(idsLst))]
-        m=mfm.getMeshAtLevel(0)
+        m=mfm[0]
+        addlevs=list(mfm.getNonEmptyLevels())[1:]
+        dAddlevs={k:mfm[k] for k in addlevs}
         for ret,ids in zip(ret0,idsLst):
             mlPart=mfm.createNewEmpty()
-            mPart=m[ids] ; trad=mPart.zipCoordsTraducer()
-            trad=trad.invertArrayO2N2N2O(mPart.getNumberOfNodes())
-            mlPart.setMeshAtLevel(0,mPart)
+            mPart=m[ids] ; trado2n=mPart.zipCoordsTraducer()
+            trad=trado2n.invertArrayO2N2N2O(mPart.getNumberOfNodes())
+            mlPart[0]=mPart
             if 0 in mfm.getFamArrNonEmptyLevelsExt():
                 mlPart.setFamilyFieldArr(0,mfm.getFamilyFieldAtLevel(0)[ids])
                 pass
             if 1 in mfm.getFamArrNonEmptyLevelsExt():
                 mlPart.setFamilyFieldArr(1,mfm.getFamilyFieldAtLevel(1)[trad])
                 pass
+            for k,v in dAddlevs.iteritems():
+                part=v.getCellIdsFullyIncludedInNodeIds(trad)
+                mSubPart=v[part] ; mSubPart.renumberNodesInConn(trado2n) ; mSubPart.setCoords(mPart.getCoords())
+                mlPart[k]=mSubPart
+                mlPart.setFamilyFieldArr(k,mfm.getFamilyFieldAtLevel(k)[part])
+                pass
             mlPart.copyFamGrpMapsFrom(mfm)
             ret.pushMesh(mlPart)
             pass