]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Feedback from Patrick : lack of geo types in new MEDReader
authorgeay <anthony.geay@cea.fr>
Mon, 17 Feb 2014 09:24:17 +0000 (10:24 +0100)
committergeay <anthony.geay@cea.fr>
Mon, 17 Feb 2014 09:24:17 +0000 (10:24 +0100)
src/MEDLoader/MEDFileFieldOverView.cxx
src/MEDLoader/MEDFileFieldOverView.hxx
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/MEDLoaderTest4.py

index 0412026a30b06b42ed3d6ef654690f1679a2d8c4..4358d7305bc055f4c7c231cc3ca1e0f2e2d2b8ee 100644 (file)
@@ -340,6 +340,11 @@ void MEDMeshMultiLev::retrieveNumberIdsOnNodes(DataArrayInt *& numIds, bool& isW
     }
 }
 
+std::vector< INTERP_KERNEL::NormalizedCellType > MEDMeshMultiLev::getGeoTypes() const
+{
+  return _geo_types;
+}
+
 void MEDMeshMultiLev::setFamilyIdsOnCells(DataArrayInt *famIds, bool isNoCopy)
 {
   _cell_fam_ids=famIds;
index 4e5167da983224695e76d64c610dbe3026a43cd5..ff683a84e371489efadd081e15ebb6e271bce7ed 100644 (file)
@@ -85,6 +85,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT void retrieveNumberIdsOnCells(DataArrayInt *& numIds, bool& isWithoutCopy) const;
     MEDLOADER_EXPORT void retrieveFamilyIdsOnNodes(DataArrayInt *& famIds, bool& isWithoutCopy) const;
     MEDLOADER_EXPORT void retrieveNumberIdsOnNodes(DataArrayInt *& numIds, bool& isWithoutCopy) const;
+    MEDLOADER_EXPORT std::vector< INTERP_KERNEL::NormalizedCellType > getGeoTypes() const;
     void setFamilyIdsOnCells(DataArrayInt *famIds, bool isNoCopy);
     void setNumberIdsOnCells(DataArrayInt *numIds, bool isNoCopy);
     void setFamilyIdsOnNodes(DataArrayInt *famIds, bool isNoCopy);
index a4a75934465161be7ea6b5f3bdd65c9d8a13729c..78b8243a0d6652a05665ceb816d6a781df84ae7f 100644 (file)
@@ -2925,6 +2925,16 @@ namespace ParaMEDMEM
         PyTuple_SetItem(ret,1,ret1Py);
         return ret;
       }
+
+      PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
+      {
+        std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
+        std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
+        PyObject *res(PyList_New(result.size()));
+        for(int i=0;iL!=result.end(); i++, iL++)
+          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+        return res;
+      }
     }
   };
 
index 88d57ede576479897e3b13e42d454d48bf9b6736..dd5975fb8f5b445f86386cbc1d47321924415995 100644 (file)
@@ -3787,6 +3787,7 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        self.assertEqual([3,4,0],mml2.getGeoTypes())
         ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
         self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(DataArrayDouble([0.,1.,0.,1.,1.,0.,2.,1.,0.,0.,2.,0.,1.,2.,0.,0.,3.,0.],6,3),1e-12))