]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
More general method API MEDCouplingUMesh::convertToPolyTypes
authorageay <ageay>
Wed, 29 Feb 2012 09:21:05 +0000 (09:21 +0000)
committerageay <ageay>
Wed, 29 Feb 2012 09:21:05 +0000 (09:21 +0000)
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTestInterp.cxx

index af2004fae9186126398e9d4520e1167c6d90f467..c2d6d1d7820656cf715718c4bbbf12056eebaa61 100644 (file)
@@ -685,30 +685,43 @@ struct MEDCouplingAccVisit
 
 
 /*!
- * This method convert this into dynamic types without changing geometry.
+ * This method convert cell with ids in ['cellIdsToConvertBg','cellIdsToConvertEnd') into 'this' into dynamic types without changing geometry.
  * That is to say if 'this' is a 2D, mesh after the invocation of this method it will contain only polygons.
  * If 'this' is a 3D mesh after the invocation of this method it will contain only polyhedra.
  * If mesh dimension is not in [2,3] an exception is thrown.
  * Of course pay attention that the resulting mesh is slower than previous one.
+ * If in ['cellIdsToConvertBg','cellIdsToConvertEnd') there is a cell id not in [0,'this->getNumberOfCells()') an exception will be thrown.
+ * In this case if meshDim==2 the mesh is still valid and only cells treated before throw will be converted into polygon.
+ * If mesh==3, after throw the mesh is \b unconsistent !
  * This method is above all designed to test more extensively algorithms able to deal with polygons/polyhedra.
  */
-void MEDCouplingUMesh::convertToPolyTypes(const std::vector<int>& cellIdsToConvert)
+void MEDCouplingUMesh::convertToPolyTypes(const int *cellIdsToConvertBg, const int *cellIdsToConvertEnd)
 {
   checkFullyDefined();
   int dim=getMeshDimension();
   if(dim<2 || dim>3)
     throw INTERP_KERNEL::Exception("Invalid mesh dimension : must be 2 or 3 !");
+  int nbOfCells=getNumberOfCells();
   if(dim==2)
     {
       const int *connIndex=_nodal_connec_index->getConstPointer();
       int *conn=_nodal_connec->getPointer();
-      for(std::vector<int>::const_iterator iter=cellIdsToConvert.begin();iter!=cellIdsToConvert.end();iter++)
+      for(const int *iter=cellIdsToConvertBg;iter!=cellIdsToConvertEnd;iter++)
         {
-          const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*iter]]);
-          if(!cm.isDynamic())
-            conn[connIndex[*iter]]=INTERP_KERNEL::NORM_POLYGON;
+          if(*iter>=0 && *iter<nbOfCells)
+            {
+              const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*iter]]);
+              if(!cm.isDynamic())
+                conn[connIndex[*iter]]=INTERP_KERNEL::NORM_POLYGON;
+              else
+                conn[connIndex[*iter]]=INTERP_KERNEL::NORM_QPOLYG;
+            }
           else
-            conn[connIndex[*iter]]=INTERP_KERNEL::NORM_QPOLYG;
+            {
+              std::ostringstream oss; oss << "MEDCouplingUMesh::convertToPolyTypes : On rank #" << std::distance(cellIdsToConvertBg,iter) << " value is " << *iter << " which is not";
+              oss << " in range [0," << nbOfCells << ") !";
+              throw INTERP_KERNEL::Exception(oss.str().c_str());
+            }
         }
     }
   else
@@ -718,29 +731,38 @@ void MEDCouplingUMesh::convertToPolyTypes(const std::vector<int>& cellIdsToConve
       const int *connOld=_nodal_connec->getConstPointer();
       int connOldLgth=_nodal_connec->getNbOfElems();
       std::vector<int> connNew(connOld,connOld+connOldLgth);
-      for(std::vector<int>::const_iterator iter=cellIdsToConvert.begin();iter!=cellIdsToConvert.end();iter++)
+      for(const int *iter=cellIdsToConvertBg;iter!=cellIdsToConvertEnd;iter++)
         {
-          int pos=connIndex[*iter];
-          int posP1=connIndex[(*iter)+1];
-          int lgthOld=posP1-pos-1;
-          const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)connNew[pos]);
-          connNew[pos]=INTERP_KERNEL::NORM_POLYHED;
-          unsigned nbOfFaces=cm.getNumberOfSons2(&connNew[pos+1],lgthOld);
-          int *tmp=new int[nbOfFaces*lgthOld];
-          int *work=tmp;
-          for(int j=0;j<(int)nbOfFaces;j++)
+          if(*iter>=0 && *iter<nbOfCells)
             {
-              INTERP_KERNEL::NormalizedCellType type;
-              unsigned offset=cm.fillSonCellNodalConnectivity2(j,&connNew[pos+1],lgthOld,work,type);
-              work+=offset;
-              *work++=-1;
+              int pos=connIndex[*iter];
+              int posP1=connIndex[(*iter)+1];
+              int lgthOld=posP1-pos-1;
+              const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)connNew[pos]);
+              connNew[pos]=INTERP_KERNEL::NORM_POLYHED;
+              unsigned nbOfFaces=cm.getNumberOfSons2(&connNew[pos+1],lgthOld);
+              int *tmp=new int[nbOfFaces*lgthOld];
+              int *work=tmp;
+              for(int j=0;j<(int)nbOfFaces;j++)
+                {
+                  INTERP_KERNEL::NormalizedCellType type;
+                  unsigned offset=cm.fillSonCellNodalConnectivity2(j,&connNew[pos+1],lgthOld,work,type);
+                  work+=offset;
+                  *work++=-1;
+                }
+              std::size_t newLgth=std::distance(tmp,work)-1;
+              std::size_t delta=newLgth-lgthOld;
+              std::transform(connIndex+(*iter)+1,connIndex+connIndexLgth,connIndex+(*iter)+1,std::bind2nd(std::plus<int>(),delta));
+              connNew.insert(connNew.begin()+posP1,tmp+lgthOld,tmp+newLgth);
+              std::copy(tmp,tmp+lgthOld,connNew.begin()+pos+1);
+              delete [] tmp;
+            }
+          else
+            {
+              std::ostringstream oss; oss << "MEDCouplingUMesh::convertToPolyTypes : On rank #" << std::distance(cellIdsToConvertBg,iter) << " value is " << *iter << " which is not";
+              oss << " in range [0," << nbOfCells << ") !";
+              throw INTERP_KERNEL::Exception(oss.str().c_str());
             }
-          std::size_t newLgth=std::distance(tmp,work)-1;
-          std::size_t delta=newLgth-lgthOld;
-          std::transform(connIndex+(*iter)+1,connIndex+connIndexLgth,connIndex+(*iter)+1,std::bind2nd(std::plus<int>(),delta));
-          connNew.insert(connNew.begin()+posP1,tmp+lgthOld,tmp+newLgth);
-          std::copy(tmp,tmp+lgthOld,connNew.begin()+pos+1);
-          delete [] tmp;
         }
       _nodal_connec->alloc((int)connNew.size(),1);
       int *newConnPtr=_nodal_connec->getPointer();
@@ -760,7 +782,7 @@ void MEDCouplingUMesh::convertAllToPoly()
   std::vector<int> cellIds(nbOfCells);
   for(int i=0;i<nbOfCells;i++)
     cellIds[i]=i;
-  convertToPolyTypes(cellIds);
+  convertToPolyTypes(&cellIds[0],&cellIds[0]+cellIds.size());
 }
 
 /*!
index 4a124842e44254fc85f5d10e2b2072b0dcfaccfe..b6a9982c0635faab0e1f145682fa748a4b81e46a 100644 (file)
@@ -94,7 +94,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT bool areCellsEqual1(int cell1, int cell2) const;
     MEDCOUPLING_EXPORT bool areCellsEqual2(int cell1, int cell2) const;
     MEDCOUPLING_EXPORT bool areCellsFrom2MeshEqual(const MEDCouplingUMesh *other, int cellId, double prec) const;
-    MEDCOUPLING_EXPORT void convertToPolyTypes(const std::vector<int>& cellIdsToConvert);
+    MEDCOUPLING_EXPORT void convertToPolyTypes(const int *cellIdsToConvertBg, const int *cellIdsToConvertEnd);
     MEDCOUPLING_EXPORT void convertAllToPoly();
     MEDCOUPLING_EXPORT void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT void unPolyze();
index 6c68a4e4b63dc3d29482a8fc47822583ef6c7965..00e68c5b0d182b3bf9c8557c90d84f83c1dbb50e 100644 (file)
@@ -373,7 +373,7 @@ void MEDCouplingBasicsTest1::testConvertToPolyTypes()
   //
   const int elts[2]={1,3};
   std::vector<int> eltsV(elts,elts+2);
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->checkCoherency();
   CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(23,mesh->getNodalConnectivity()->getNumberOfTuples());
@@ -384,11 +384,11 @@ void MEDCouplingBasicsTest1::testConvertToPolyTypes()
   mesh->decrRef();
   ////// 3D
   mesh=build3DTargetMesh_1();
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->checkCoherency();
   CPPUNIT_ASSERT_EQUAL(8,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(114,mesh->getNodalConnectivity()->getNumberOfTuples());
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->checkCoherency();
   CPPUNIT_ASSERT_EQUAL(8,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(114,mesh->getNodalConnectivity()->getNumberOfTuples());
@@ -435,7 +435,7 @@ void MEDCouplingBasicsTest1::testDescConn2D()
   //
   const int elts[2]={1,3};
   std::vector<int> eltsV(elts,elts+2);
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->checkCoherency();
   //
   desc=DataArrayInt::New();
@@ -513,7 +513,7 @@ void MEDCouplingBasicsTest1::testDescConn3D()
   //
   const int elts[2]={1,3};
   std::vector<int> eltsV(elts,elts+2);
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->checkCoherency();
   desc=DataArrayInt::New();
   descIndx=DataArrayInt::New();
@@ -1086,7 +1086,7 @@ void MEDCouplingBasicsTest1::testExtrudedMesh3()
   m3->decrRef();
   //play with polygons and polyedrons
   std::vector<int> cells(2); cells[0]=2; cells[1]=3;
-  m1->convertToPolyTypes(cells);
+  m1->convertToPolyTypes(&cells[0],&cells[0]+cells.size());
   m3=m1->buildExtrudedMesh(m2,0);
   CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_HEXA8,(int)m3->getTypeOfCell(0));
   CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_PENTA6,(int)m3->getTypeOfCell(1));
@@ -1116,7 +1116,7 @@ void MEDCouplingBasicsTest1::testExtrudedMesh4()
 {
   MEDCouplingUMesh *m1=build2DTargetMesh_1();
   std::vector<int> cells(2); cells[0]=2; cells[1]=4;
-  m1->convertToPolyTypes(cells);
+  m1->convertToPolyTypes(&cells[0],&cells[0]+cells.size());
   m1->changeSpaceDimension(3);
   MEDCouplingUMesh *m2=buildCU1DMesh_U();
   m2->changeSpaceDimension(3);
@@ -1317,7 +1317,7 @@ void MEDCouplingBasicsTest1::testMergeMeshOnSameCoords1()
   std::vector<int> cells(5);
   for(int i=0;i<5;i++)
     cells[i]=i;
-  m2->convertToPolyTypes(cells);
+  m2->convertToPolyTypes(&cells[0],&cells[0]+cells.size());
   m1->tryToShareSameCoords(*m2,1e-12);
   MEDCouplingUMesh *m3=build2DTargetMesh_1();
   m3->tryToShareSameCoords(*m2,1e-12);
index 9c0e8fcbc4e1b39fe5c5991527d3bb0fab71af0f..c3a10c5ee165a82a076834ba36567bca71828c7d 100644 (file)
@@ -199,7 +199,7 @@ void MEDCouplingBasicsTest2::testCellOrientation2()
   CPPUNIT_ASSERT_EQUAL(18,m2->getNumberOfCells());
   int cellIds[3]={0,6,12};
   std::vector<int> cellIds2(cellIds,cellIds+3);
-  m2->convertToPolyTypes(cellIds2);
+  m2->convertToPolyTypes(&cellIds2[0],&cellIds2[0]+cellIds2.size());
   m2->orientCorrectlyPolyhedrons();
   res1.clear();
   m2->arePolyhedronsNotCorrectlyOriented(res1);
@@ -211,7 +211,7 @@ void MEDCouplingBasicsTest2::testCellOrientation2()
   m3->changeSpaceDimension(3);
   const int ids1[5]={0,1,2,3,4};
   std::vector<int> ids2(ids1,ids1+5);
-  m3->convertToPolyTypes(ids2);
+  m3->convertToPolyTypes(&ids2[0],&ids2[0]+ids2.size());
   m3->orientCorrectly2DCells(vec,false);
   MEDCouplingUMesh *m4=buildCU1DMesh_U();
   m4->changeSpaceDimension(3);
index 19cc8c9ebff4fe9fdac8e146e1103539c2e9965e..b0ed88eedf0fe0f216b9a32c2a884f0088b27b1b 100644 (file)
@@ -1169,12 +1169,12 @@ void MEDCouplingBasicsTest3::testUnPolyze1()
   const int elts[8]={0,1,2,3,4,5,6,7};
   std::vector<int> eltsV(elts,elts+8);
   MEDCouplingUMesh *mesh=build3DTargetMesh_1();
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->unPolyze();
   MEDCouplingUMesh *mesh2=build3DTargetMesh_1();
   mesh->checkCoherency();
   CPPUNIT_ASSERT(mesh->isEqual(mesh2,1e-12));
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   CPPUNIT_ASSERT(!mesh->isEqual(mesh2,1e-12));
   mesh->getNodalConnectivity()->setIJ(0,6,10);
   mesh->getNodalConnectivity()->setIJ(0,7,9);
@@ -1182,14 +1182,14 @@ void MEDCouplingBasicsTest3::testUnPolyze1()
   mesh->getNodalConnectivity()->setIJ(0,9,13);
   mesh->unPolyze();
   CPPUNIT_ASSERT(mesh->isEqual(mesh2,1e-12));
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->getNodalConnectivity()->setIJ(0,6,12);
   mesh->getNodalConnectivity()->setIJ(0,7,13);
   mesh->getNodalConnectivity()->setIJ(0,8,10);
   mesh->getNodalConnectivity()->setIJ(0,9,9);
   mesh->unPolyze();
   CPPUNIT_ASSERT(mesh->isEqual(mesh2,1e-12));
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   mesh->getNodalConnectivity()->setIJ(0,6,12);
   mesh->getNodalConnectivity()->setIJ(0,7,10);
   mesh->getNodalConnectivity()->setIJ(0,8,13);
@@ -1202,7 +1202,7 @@ void MEDCouplingBasicsTest3::testUnPolyze1()
   mesh=build2DTargetMesh_1();
   mesh2=build2DTargetMesh_1();
   eltsV.resize(5);
-  mesh->convertToPolyTypes(eltsV);
+  mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   CPPUNIT_ASSERT(!mesh->isEqual(mesh2,1e-12));
   mesh->unPolyze();
   CPPUNIT_ASSERT(mesh->isEqual(mesh2,1e-12));
@@ -1550,7 +1550,7 @@ void MEDCouplingBasicsTest3::testSimplexize1()
   MEDCouplingUMesh *m=build3DSurfTargetMesh_1();
   std::vector<int> v(1);
   v[0]=3;
-  m->convertToPolyTypes(v);
+  m->convertToPolyTypes(&v[0],&v[0]+v.size());
   DataArrayInt *da=m->simplexize(0);
   CPPUNIT_ASSERT_EQUAL(7,da->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfComponents());
@@ -1580,7 +1580,7 @@ void MEDCouplingBasicsTest3::testSimplexize1()
   //
   m=build3DSurfTargetMesh_1();
   v[0]=3;
-  m->convertToPolyTypes(v);
+  m->convertToPolyTypes(&v[0],&v[0]+v.size());
   da=m->simplexize(1);
   CPPUNIT_ASSERT_EQUAL(7,da->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfComponents());
@@ -1612,7 +1612,7 @@ void MEDCouplingBasicsTest3::testSimplexize2()
   MEDCouplingUMesh *m=build3DSurfTargetMesh_1();
   std::vector<int> v(1);
   v[0]=3;
-  m->convertToPolyTypes(v);
+  m->convertToPolyTypes(&v[0],&v[0]+v.size());
   MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
   f1->setMesh(m);
   DataArrayDouble *arr=DataArrayDouble::New();
index ad4c6097e9cdac028ffb845fa7710a9bdc493a31..1075bcb9f874b88636c0d937bad6282ebf2f1ae6 100644 (file)
@@ -906,7 +906,7 @@ void MEDCouplingBasicsTest4::testCheckCoherencyDeeper1()
   m->checkCoherency1();
   const int elts[2]={1,5};
   std::vector<int> eltsV(elts,elts+2);
-  m->convertToPolyTypes(eltsV);
+  m->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
   m->checkCoherency();
   m->checkCoherency1();
   m->getNodalConnectivity()->setIJ(2,0,9);//9>=NbOfNodes
@@ -948,7 +948,7 @@ void MEDCouplingBasicsTest4::testUnPolyze2()
   std::vector<const MEDCouplingUMesh *> ms(4,m);
   MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(ms);
   std::vector<int> temp(1,2);
-  m2->convertToPolyTypes(temp);
+  m2->convertToPolyTypes(&temp[0],&temp[0]+temp.size());
   m2->unPolyze();
   CPPUNIT_ASSERT(INTERP_KERNEL::NORM_TETRA4==m2->getTypeOfCell(2));
   CPPUNIT_ASSERT_EQUAL(40,m2->getMeshLength());
index e37858cc18e0abd451073e72f398ac93257a9dcf..3194bf28cb14f6391b66e09d2113bc9496754ddf 100644 (file)
@@ -107,7 +107,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_2()
   std::vector<int> cellsIds(targetMesh->getNumberOfCells());
   for(int i=0;i<targetMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  targetMesh->convertToPolyTypes(cellsIds);
+  targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
@@ -138,7 +138,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_3()
   std::vector<int> cellsIds(sourceMesh->getNumberOfCells());
   for(int i=0;i<sourceMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  sourceMesh->convertToPolyTypes(cellsIds);
+  sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
@@ -169,11 +169,11 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_4()
   std::vector<int> cellsIds(sourceMesh->getNumberOfCells());
   for(int i=0;i<sourceMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  sourceMesh->convertToPolyTypes(cellsIds);
+  sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   cellsIds.resize(targetMesh->getNumberOfCells());
   for(int i=0;i<targetMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  targetMesh->convertToPolyTypes(cellsIds);
+  targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
@@ -272,12 +272,12 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P1PL_2()
   std::vector<int> cellsIds(sourceMesh->getNumberOfCells());
   for(int i=0;i<sourceMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  sourceMesh->convertToPolyTypes(cellsIds);
+  sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   cellsIds.resize(targetMesh->getNumberOfCells());
   for(int i=0;i<targetMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  targetMesh->convertToPolyTypes(cellsIds);
+  targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
@@ -384,7 +384,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P0PL_2()
   std::vector<int >cellsIds(targetMesh->getNumberOfCells());
   for(int i=0;i<targetMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  targetMesh->convertToPolyTypes(cellsIds);
+  targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
@@ -1039,7 +1039,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_2()
   std::vector<int> cellsIds(targetMesh->getNumberOfCells());
   for(int i=0;i<targetMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  targetMesh->convertToPolyTypes(cellsIds);
+  targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
@@ -1089,7 +1089,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_3()
   std::vector<int> cellsIds(sourceMesh->getNumberOfCells());
   for(int i=0;i<sourceMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  sourceMesh->convertToPolyTypes(cellsIds);
+  sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
@@ -1139,11 +1139,11 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_4()
   std::vector<int> cellsIds(sourceMesh->getNumberOfCells());
   for(int i=0;i<sourceMesh->getNumberOfCells();i++)
     cellsIds[i]=i;
-  sourceMesh->convertToPolyTypes(cellsIds);
+  sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   cellsIds.resize(targetMesh->getNumberOfCells());
   for(int j=0;j<targetMesh->getNumberOfCells();j++)
     cellsIds[j]=j;
-  targetMesh->convertToPolyTypes(cellsIds);
+  targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size());
   //
   MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
   MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);