From fba3dcb4ec90dcc8d3e86bd67e5dfc5dc288e238 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 29 Jun 2017 08:52:26 +0200 Subject: [PATCH] Management of multi levs --- src/MEDLoader/Swig/MEDLoaderSplitter.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/MEDLoader/Swig/MEDLoaderSplitter.py b/src/MEDLoader/Swig/MEDLoaderSplitter.py index 62319a571..d0332f8c6 100644 --- a/src/MEDLoader/Swig/MEDLoaderSplitter.py +++ b/src/MEDLoader/Swig/MEDLoaderSplitter.py @@ -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 -- 2.39.2