]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
checkConsecutiveCellTypesForMEDFileFrmt
authorageay <ageay>
Fri, 25 Jan 2013 11:48:39 +0000 (11:48 +0000)
committerageay <ageay>
Fri, 25 Jan 2013 11:48:39 +0000 (11:48 +0000)
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingCommon.i

index 327c593c8b47b8eec83ae1e6be8f9c64b5f2406c..2c7936230e729d846af23d584cd5288115885d7b 100644 (file)
@@ -5450,6 +5450,17 @@ bool MEDCouplingUMesh::checkConsecutiveCellTypes() const
   return true;
 }
 
+/*!
+ * This method is a specialization of MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder method that is called here.
+ * The geometric type order is specified by MED file.
+ * 
+ * \sa  MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder
+ */
+bool MEDCouplingUMesh::checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception)
+{
+  return checkConsecutiveCellTypesAndOrder(MEDMEM_ORDER,MEDMEM_ORDER+N_MEDMEM_ORDER);
+}
+
 /*!
  * This method performs the same job as checkConsecutiveCellTypes except that the order of types sequence is analyzed to check
  * that the order is specified in array defined by [orderBg,orderEnd). 
index 534c7c7bc4d47e842876b03c9b9fd1ed0885bd54..703881151e4238f65ec9e8f02d751c21d59f2e21 100644 (file)
@@ -192,6 +192,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingUMesh *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh, DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *&revDesc, DataArrayInt *&revDescIndx, DataArrayInt *& nM1LevMeshIds, DataArrayInt *&meshnM1Old2New) const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT bool checkConsecutiveCellTypes() const;
+    MEDCOUPLING_EXPORT bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT bool checkConsecutiveCellTypesAndOrder(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const;
     MEDCOUPLING_EXPORT DataArrayInt *getLevArrPerCellTypes(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd, DataArrayInt *&nbPerType) const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const throw(INTERP_KERNEL::Exception);
index cdae0a4cb67ac4756cce3e3d9c99c55fa0cb3f43..7653ffa9049e92156f76f4178e35c7943172a2be 100644 (file)
@@ -10840,6 +10840,19 @@ class MEDCouplingBasicsTest(unittest.TestCase):
             pass
         pass
 
+    def testSwigCheckConsecutiveCellTypesForMEDFileFrmt1(self):
+        m1=MEDCouplingUMesh("",2) ; m1.allocateCells(0)
+        m1.insertNextCell(NORM_QUAD4,[0,1,2,3])
+        m1.insertNextCell(NORM_TRI3,[0,1,2])
+        d=DataArrayDouble(4,3) ; d[:]=0.
+        m1.setCoords(d)
+        self.assertTrue(m1.checkConsecutiveCellTypes())
+        self.assertTrue(not m1.checkConsecutiveCellTypesForMEDFileFrmt())
+        m1.renumberCells([1,0])
+        self.assertTrue(m1.checkConsecutiveCellTypes())
+        self.assertTrue(m1.checkConsecutiveCellTypesForMEDFileFrmt())
+        pass
+
     def setUp(self):
         pass
     pass
index 41c1e107e083a7d708dfbbb6d3f64c21f75c2727..ecd13e55558eb6cbfecd42edee54350b8bdfa4b0 100644 (file)
@@ -1389,6 +1389,7 @@ namespace ParaMEDMEM
     DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
     MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
     bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
+    bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
     DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
     DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
     DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);