From 629c9ce6e709aaf8508ee72631ff5ee66d7314dd Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 29 Jun 2017 08:52:26 +0200 Subject: [PATCH] Splitter now manage all levs --- src/MEDLoader/Swig/MEDLoaderSplitter.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/MEDLoader/Swig/MEDLoaderSplitter.py b/src/MEDLoader/Swig/MEDLoaderSplitter.py index 99afdd3f4..6acbc1f18 100644 --- a/src/MEDLoader/Swig/MEDLoaderSplitter.py +++ b/src/MEDLoader/Swig/MEDLoaderSplitter.py @@ -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 -- 2.39.2