From: ageay Date: Fri, 10 Dec 2010 07:45:37 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: MEDPartitioner_first_compilable_version~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19fe1aa89c2cc853bdccda840a45c85a6ea4dd6e;p=tools%2Fmedcoupling.git *** empty log message *** --- diff --git a/src/MEDLoader/MEDFileMeshLL.cxx b/src/MEDLoader/MEDFileMeshLL.cxx index 8fe3256a1..701641e7e 100644 --- a/src/MEDLoader/MEDFileMeshLL.cxx +++ b/src/MEDLoader/MEDFileMeshLL.cxx @@ -381,8 +381,8 @@ DataArrayInt *MEDFileUMeshSplitL1::renumIfNeededArr(DataArrayInt *da) const { if((const DataArrayInt *)_num==0) return da; - da->decrRef(); MEDCouplingAutoRefCountObjectPtr locnum=_num->selectByTupleId(da->getConstPointer(),da->getConstPointer()+da->getNumberOfTuples()); + da->decrRef(); locnum->incrRef(); return locnum; } diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index f7edcf289..59cdce0a5 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -55,16 +55,19 @@ using namespace ParaMEDMEM; %newobject ParaMEDMEM::MEDFileUMesh::getGroups; %newobject ParaMEDMEM::MEDFileUMesh::getFamily; %newobject ParaMEDMEM::MEDFileUMesh::getFamilies; -%newobject ParaMEDMEM::MEDFileUMesh::getMeshAtRank; -%newobject ParaMEDMEM::MEDFileUMesh::getRank0Mesh; -%newobject ParaMEDMEM::MEDFileUMesh::getRankM1Mesh; -%newobject ParaMEDMEM::MEDFileUMesh::getRankM2Mesh; -%newobject ParaMEDMEM::MEDFileUMesh::getRankM3Mesh; +%newobject ParaMEDMEM::MEDFileUMesh::getGroupArr; +%newobject ParaMEDMEM::MEDFileUMesh::getGroupsArr; +%newobject ParaMEDMEM::MEDFileUMesh::getFamilyArr; %newobject ParaMEDMEM::MEDFileUMesh::getFamiliesArr; %newobject ParaMEDMEM::MEDFileUMesh::getNodeGroupArr; %newobject ParaMEDMEM::MEDFileUMesh::getNodeGroupsArr; %newobject ParaMEDMEM::MEDFileUMesh::getNodeFamilyArr; %newobject ParaMEDMEM::MEDFileUMesh::getNodeFamiliesArr; +%newobject ParaMEDMEM::MEDFileUMesh::getMeshAtRank; +%newobject ParaMEDMEM::MEDFileUMesh::getRank0Mesh; +%newobject ParaMEDMEM::MEDFileUMesh::getRankM1Mesh; +%newobject ParaMEDMEM::MEDFileUMesh::getRankM2Mesh; +%newobject ParaMEDMEM::MEDFileUMesh::getRankM3Mesh; class MEDLoader { diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index ead575cc2..36d97f68c 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -39,6 +39,7 @@ class MEDLoaderTest(unittest.TestCase): def testMEDMesh2(self): fileName="Pyfile10.med" mname="3DToto" + outFileName="MEDFileMesh1.med" medmesh=MEDFileUMesh.New(fileName,mname) self.assertEqual((0,),medmesh.getNonEmptyLevels()) m1_0=medmesh.getRank0Mesh() @@ -61,15 +62,12 @@ class MEDLoaderTest(unittest.TestCase): g1_1=MEDLoader.ReadUMeshFromFamilies(fileName,mname,0,["Family_2","Family_4"]); g1_1.setName(g1_0.getName()) self.assertTrue(g1_0.isEqual(g1_1,1e-12)); - ## st=g1_0.advancedRepr() - ## f=file("out1","w") - ## f.write(st) - ## f.close() - ## st=g1_1.advancedRepr() - ## f=file("out2","w") - ## f.write(st) - ## f.close() self.assertTrue(g1_0.isEqual(g1_1,1e-12)); + medmesh.write(outFileName,2); + self.assertEqual([2,3,5,14,16],medmesh.getGroupArr(0,"mesh2").getValues()); + self.assertEqual([2,3,16],medmesh.getFamilyArr(0,"Family_2").getValues()); + self.assertEqual([2,3,5,14,16],medmesh.getFamiliesArr(0,["Family_4","Family_2"]).getValues()); + self.assertEqual([2,3,4,5,14,15,16],medmesh.getGroupsArr(0,["mesh2","mesh3"]).getValues()); pass pass