]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Fri, 10 Dec 2010 07:45:37 +0000 (07:45 +0000)
committerageay <ageay>
Fri, 10 Dec 2010 07:45:37 +0000 (07:45 +0000)
src/MEDLoader/MEDFileMeshLL.cxx
src/MEDLoader/Swig/MEDLoader.i
src/MEDLoader/Swig/MEDLoaderTest3.py

index 8fe3256a1b1baf31c42bc564310bc32fc692277e..701641e7e850caa1ca4248b41ad5456059b63243 100644 (file)
@@ -381,8 +381,8 @@ DataArrayInt *MEDFileUMeshSplitL1::renumIfNeededArr(DataArrayInt *da) const
 {
   if((const DataArrayInt *)_num==0)
     return da;
-  da->decrRef();
   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> locnum=_num->selectByTupleId(da->getConstPointer(),da->getConstPointer()+da->getNumberOfTuples());
+  da->decrRef();
   locnum->incrRef();
   return locnum;
 }
index f7edcf28972db4998b9298519e04c2d2eb13b0af..59cdce0a5d873275b34b1080cabffa78cbaed3e7 100644 (file)
@@ -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
 {
index ead575cc25375a6173c271e567ce796c39f653f6..36d97f68cdde4fb06b37031a7f7e07a10bca06a0 100644 (file)
@@ -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