]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Management of multi levs
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 29 Jun 2017 06:52:26 +0000 (08:52 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 13 Dec 2017 12:37:18 +0000 (13:37 +0100)
src/MEDLoader/Swig/MEDLoaderSplitter.py

index 62319a5715ce0c5a35009fd9f48c09fa5a548bd0..d0332f8c614edea5b6deea3b63ca32ff8b923d83 100644 (file)
@@ -95,19 +95,32 @@ class MEDLoaderSplitter:
         return ret0
 
     def __splitMesh(self,mfm,idsLst):
+<<<<<<< HEAD
         ret0=[MEDFileMeshes() for i in xrange(len(idsLst))]
         m=mfm.getMeshAtLevel(0)
+=======
+        ret0 = [MEDFileMeshes() for i in range(len(idsLst))]
+        m=mfm[0]
+        addlevs=list(mfm.getNonEmptyLevels())[1:]
+        dAddlevs={k:mfm[k] for k in addlevs}
+>>>>>>> 629c9ce... Splitter now manage all levs
         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