Salome HOME
Tools for partitioning and neighbor computation
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingUMesh.cxx
index 0bfd7174deca5bf4233ac4a80dab461701738372..39bf67ac565405d821fb4e09e7328e1ed2d3c369 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,6 @@
 
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCoupling1GTUMesh.hxx"
-#include "MEDCouplingMemArray.txx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingSkyLineArray.hxx"
 #include "CellModel.hxx"
@@ -55,6 +54,7 @@ double MEDCouplingUMesh::EPS_FOR_POLYH_ORIENTATION=1.e-14;
 
 /// @cond INTERNAL
 const INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::MEDMEM_ORDER[N_MEDMEM_ORDER] = { INTERP_KERNEL::NORM_POINT1, INTERP_KERNEL::NORM_SEG2, INTERP_KERNEL::NORM_SEG3, INTERP_KERNEL::NORM_SEG4, INTERP_KERNEL::NORM_POLYL, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_TRI7, INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_QUAD9, INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_QPOLYG, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_PYRA5, INTERP_KERNEL::NORM_PENTA6, INTERP_KERNEL::NORM_HEXA8, INTERP_KERNEL::NORM_HEXGP12, INTERP_KERNEL::NORM_TETRA10, INTERP_KERNEL::NORM_PYRA13, INTERP_KERNEL::NORM_PENTA15, INTERP_KERNEL::NORM_HEXA20, INTERP_KERNEL::NORM_HEXA27, INTERP_KERNEL::NORM_POLYHED };
+const int MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,36,4};
 /// @endcond
 
 MEDCouplingUMesh *MEDCouplingUMesh::New()
@@ -235,7 +235,7 @@ void MEDCouplingUMesh::checkConsistency(double eps) const
         {
           std::ostringstream oss;
           oss << "MEDCouplingUMesh::checkConsistency : cell << #" << i<< " with type Type " << cm.getRepr() << " in 'this' whereas meshdim == " << meshDim << " !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
       int nbOfNodesInCell=ptrI[i+1]-ptrI[i]-1;
       if(!cm.isDynamic())
@@ -244,7 +244,7 @@ void MEDCouplingUMesh::checkConsistency(double eps) const
             std::ostringstream oss;
             oss << "MEDCouplingUMesh::checkConsistency : cell #" << i << " with static Type '" << cm.getRepr() << "' has " <<  cm.getNumberOfNodes();
             oss << " nodes whereas in connectivity there is " << nbOfNodesInCell << " nodes ! Looks very bad !";
-            throw INTERP_KERNEL::Exception(oss.str().c_str());
+            throw INTERP_KERNEL::Exception(oss.str());
           }
       if(cm.isQuadratic() && cm.isDynamic() && meshDim == 2)
         if (nbOfNodesInCell % 2 || nbOfNodesInCell < 4)
@@ -252,7 +252,7 @@ void MEDCouplingUMesh::checkConsistency(double eps) const
             std::ostringstream oss;
             oss << "MEDCouplingUMesh::checkConsistency : cell #" << i << " with quadratic type '" << cm.getRepr() << "' has " <<  nbOfNodesInCell;
             oss << " nodes. This should be even, and greater or equal than 4!! Looks very bad!";
-            throw INTERP_KERNEL::Exception(oss.str().c_str());
+            throw INTERP_KERNEL::Exception(oss.str());
           }
       for(const int *w=ptr+ptrI[i]+1;w!=ptr+ptrI[i+1];w++)
         {
@@ -262,20 +262,20 @@ void MEDCouplingUMesh::checkConsistency(double eps) const
               if(nodeId>=nbOfNodes)
                 {
                   std::ostringstream oss; oss << "Cell #" << i << " is built with node #" << nodeId << " whereas there are only " << nbOfNodes << " nodes in the mesh !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  throw INTERP_KERNEL::Exception(oss.str());
                 }
             }
           else if(nodeId<-1)
             {
               std::ostringstream oss; oss << "Cell #" << i << " is built with node #" << nodeId << " in connectivity ! sounds bad !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
           else
             {
               if((INTERP_KERNEL::NormalizedCellType)(ptr[ptrI[i]])!=INTERP_KERNEL::NORM_POLYHED)
                 {
                   std::ostringstream oss; oss << "Cell #" << i << " is built with node #-1 in connectivity ! sounds bad !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  throw INTERP_KERNEL::Exception(oss.str());
                 }
             }
         }
@@ -354,7 +354,7 @@ void MEDCouplingUMesh::insertNextCell(INTERP_KERNEL::NormalizedCellType type, in
           {
             std::ostringstream oss; oss << "MEDCouplingUMesh::insertNextCell : Trying to push a " << cm.getRepr() << " cell with a size of " << size;
             oss << " ! Expecting " << cm.getNumberOfNodes() << " !";
-            throw INTERP_KERNEL::Exception(oss.str().c_str());
+            throw INTERP_KERNEL::Exception(oss.str());
           }
       int idx=_nodal_connec_index->back();
       int val=idx+size+1;
@@ -367,7 +367,7 @@ void MEDCouplingUMesh::insertNextCell(INTERP_KERNEL::NormalizedCellType type, in
       std::ostringstream oss; oss << "MEDCouplingUMesh::insertNextCell : cell type " << cm.getRepr() << " has a dimension " << cm.getDimension();
       oss << " whereas Mesh Dimension of current UMesh instance is set to " << _mesh_dim << " ! Please invoke \"setMeshDimension\" method before or invoke ";
       oss << "\"MEDCouplingUMesh::New\" static method with 2 parameters name and meshDimension !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
 }
 
@@ -673,6 +673,28 @@ private:
   const INTERP_KERNEL::CellModel& _cm;
 };
 
+class MicroEdgesGenerator2D
+{
+public:
+  MicroEdgesGenerator2D(const INTERP_KERNEL::CellModel& cm):_cm(cm) { }
+  unsigned getNumberOfSons2(const int *conn, int lgth) const { return _cm.getNumberOfMicroEdges(); }
+  unsigned fillSonCellNodalConnectivity2(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, INTERP_KERNEL::NormalizedCellType& typeOfSon) const { return _cm.fillMicroEdgeNodalConnectivity(sonId,nodalConn,sonNodalConn,typeOfSon); }
+  static const int DELTA=1;
+private:
+  const INTERP_KERNEL::CellModel& _cm;
+};
+
+class MicroEdgesGenerator3D
+{
+public:
+  MicroEdgesGenerator3D(const INTERP_KERNEL::CellModel& cm):_cm(cm) { }
+  unsigned getNumberOfSons2(const int *conn, int lgth) const { return _cm.getNumberOfMicroEdges(); }
+  unsigned fillSonCellNodalConnectivity2(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, INTERP_KERNEL::NormalizedCellType& typeOfSon) const { return _cm.fillMicroEdgeNodalConnectivity(sonId,nodalConn,sonNodalConn,typeOfSon); }
+  static const int DELTA=2;
+private:
+  const INTERP_KERNEL::CellModel& _cm;
+};
+
 /// @endcond
 
 /*!
@@ -739,6 +761,26 @@ MEDCouplingUMesh *MEDCouplingUMesh::explode3DMeshTo1D(DataArrayInt *desc, DataAr
   return buildDescendingConnectivityGen<MinusTwoSonsGenerator>(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
 }
 
+/*!
+ * This method computes the micro edges constituting each cell in \a this. Micro edge is an edge for non quadratic cells. Micro edge is an half edge for quadratic cells.
+ * This method works for both meshes with mesh dimenstion equal to 2 or 3. Dynamical cells are not supported (polygons, polyhedrons...)
+ * 
+ * \sa explode3DMeshTo1D, buildDescendingConnectiviy
+ */
+MEDCouplingUMesh *MEDCouplingUMesh::explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const
+{
+   checkFullyDefined();
+   switch(getMeshDimension())
+     {
+     case 2:
+       return buildDescendingConnectivityGen<MicroEdgesGenerator2D>(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
+     case 3:
+       return buildDescendingConnectivityGen<MicroEdgesGenerator2D>(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
+     default:
+       throw INTERP_KERNEL::Exception("MEDCouplingUMesh::explodeMeshIntoMicroEdges : Only 2D and 3D supported !");
+     }
+}
+
 /*!
  * Creates a new MEDCouplingUMesh containing cells, of dimension one less than \a
  * this->getMeshDimension(), that bound cells of \a this mesh. In
@@ -822,6 +864,30 @@ void MEDCouplingUMesh::computeNeighborsOfCells(DataArrayInt *&neighbors, DataArr
   ComputeNeighborsOfCellsAdv(desc,descIndx,revDesc,revDescIndx,neighbors,neighborsIndx);
 }
 
+void MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI, MCAuto<DataArrayInt>& cellNeigh, MCAuto<DataArrayInt>& cellNeighIndex) const
+{
+  if(!nodeNeigh || !nodeNeighI)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : null pointer !");
+  checkConsistencyLight();
+  nodeNeigh->checkAllocated(); nodeNeighI->checkAllocated();
+  nodeNeigh->checkNbOfComps(1,"MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : node neigh");
+  nodeNeighI->checkNbOfComps(1,"MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : node neigh index");
+  nodeNeighI->checkNbOfTuples(1+getNumberOfNodes(),"MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne : invalid length");
+  int nbCells(getNumberOfCells());
+  const int *c(_nodal_connec->begin()),*ci(_nodal_connec_index->begin()),*ne(nodeNeigh->begin()),*nei(nodeNeighI->begin());
+  cellNeigh=DataArrayInt::New(); cellNeigh->alloc(0,1); cellNeighIndex=DataArrayInt::New(); cellNeighIndex->alloc(1,1); cellNeighIndex->setIJ(0,0,0);
+  for(int i=0;i<nbCells;i++)
+    {
+      std::set<int> s;
+      for(const int *it=c+ci[i]+1;it!=c+ci[i+1];it++)
+        if(*it>=0)
+          s.insert(ne+nei[*it],ne+nei[*it+1]);
+      s.erase(i);
+      cellNeigh->insertAtTheEnd(s.begin(),s.end());
+      cellNeighIndex->pushBackSilent(cellNeigh->getNumberOfTuples());
+    }
+}
+
 /*!
  * This method is called by MEDCouplingUMesh::computeNeighborsOfCells. This methods performs the algorithm
  * of MEDCouplingUMesh::computeNeighborsOfCells.
@@ -1107,7 +1173,7 @@ void MEDCouplingUMesh::convertToPolyTypes(const int *cellIdsToConvertBg, const i
             {
               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());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
     }
@@ -1125,7 +1191,7 @@ void MEDCouplingUMesh::convertToPolyTypes(const int *cellIdsToConvertBg, const i
             {
               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());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
       for(int cellId=0;cellId<nbOfCells;cellId++)
@@ -1227,13 +1293,13 @@ void MEDCouplingUMesh::convertExtrudedPolyhedra()
           if(std::count(c+ci[i]+1,c+ci[i+1],-1)!=0)
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::convertExtrudedPolyhedra : cell # " << i << " is a polhedron BUT it has NOT exactly 1 face !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
           std::size_t n2=std::distance(c+ci[i]+1,c+ci[i+1]);
           if(n2%2!=0)
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::convertExtrudedPolyhedra : cell # " << i << " is a polhedron with 1 face but there is a mismatch of number of nodes in face should be even !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
           int n1=(int)(n2/2);
           newci[i+1]=7*n1+2+newci[i];//6*n1 (nodal length) + n1+2 (number of faces) - 1 (number of '-1' separator is equal to number of faces -1) + 1 (for cell type)
@@ -1277,6 +1343,8 @@ void MEDCouplingUMesh::convertExtrudedPolyhedra()
  * \warning Cells of the result mesh are \b not sorted by geometric type, hence,
  *          to write this mesh to the MED file, its cells must be sorted using
  *          sortCellsInMEDFileFrmt().
+ * \warning Cells (and most notably polyhedrons) must be correctly oriented for this to work
+ *          properly. See orientCorrectlyPolyhedrons() and arePolyhedronsNotCorrectlyOriented().
  * \return \c true if at least one cell has been converted, \c false else. In the
  *         last case the nodal connectivity remains unchanged.
  * \throw If the coordinates array is not set.
@@ -1403,27 +1471,11 @@ void MEDCouplingUMesh::simplifyPolyhedra(double eps)
 DataArrayInt *MEDCouplingUMesh::computeFetchedNodeIds() const
 {
   checkConnectivityFullyDefined();
-  int nbOfCells=getNumberOfCells();
-  const int *connIndex=_nodal_connec_index->getConstPointer();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *maxEltPt=std::max_element(_nodal_connec->begin(),_nodal_connec->end());
-  int maxElt=maxEltPt==_nodal_connec->end()?0:std::abs(*maxEltPt)+1;
+  const int *maxEltPt(std::max_element(_nodal_connec->begin(),_nodal_connec->end()));
+  int maxElt(maxEltPt==_nodal_connec->end()?0:std::abs(*maxEltPt)+1);
   std::vector<bool> retS(maxElt,false);
-  for(int i=0;i<nbOfCells;i++)
-    for(int j=connIndex[i]+1;j<connIndex[i+1];j++)
-      if(conn[j]>=0)
-        retS[conn[j]]=true;
-  int sz=0;
-  for(int i=0;i<maxElt;i++)
-    if(retS[i])
-      sz++;
-  DataArrayInt *ret=DataArrayInt::New();
-  ret->alloc(sz,1);
-  int *retPtr=ret->getPointer();
-  for(int i=0;i<maxElt;i++)
-    if(retS[i])
-      *retPtr++=i;
-  return ret;
+  computeNodeIdsAlg(retS);
+  return DataArrayInt::BuildListOfSwitchedOn(retS);
 }
 
 /*!
@@ -1443,7 +1495,7 @@ void MEDCouplingUMesh::computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::computeNodeIdsAlg : In cell #" << i  << " presence of node id " <<  conn[j] << " not in [0," << nbOfNodes << ") !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
 }
@@ -1487,7 +1539,7 @@ DataArrayInt *MEDCouplingUMesh::getNodeIdsInUse(int& nbrOfNodesInUse) const
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::getNodeIdsInUse : In cell #" << i  << " presence of node id " <<  conn[j] << " not in [0," << nbOfNodes << ") !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
   nbrOfNodesInUse=(int)std::count(traducer,traducer+nbOfNodes,1);
@@ -1898,7 +1950,7 @@ void MEDCouplingUMesh::FindCommonCellsAlg(int compType, int startCellId, const D
 /*!
  * Checks if \a this mesh includes all cells of an \a other mesh, and returns an array
  * giving for each cell of the \a other an id of a cell in \a this mesh. A value larger
- * than \a other->getNumberOfCells() in the returned array means that there is no
+ * than \a this->getNumberOfCells() in the returned array means that there is no
  * corresponding cell in \a this mesh.
  * It is expected that \a this and \a other meshes share the same node coordinates
  * array, if it is not so an exception is thrown. 
@@ -1929,7 +1981,7 @@ bool MEDCouplingUMesh::areCellsIncludedIn(const MEDCouplingUMesh *other, int com
       std::ostringstream oss; oss << "MEDCouplingUMesh::areCellsIncludedIn : only following policies are possible : ";
       std::copy(possibleCompType,possibleCompType+sizeof(possibleCompType)/sizeof(int),std::ostream_iterator<int>(oss," "));
       oss << " !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   MCAuto<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType,nbOfCells);
   arr=o2n->subArray(nbOfCells);
@@ -2088,13 +2140,13 @@ void MEDCouplingUMesh::setPartOfMySelf(const int *cellIdsBg, const int *cellIdsE
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : Mismatch of meshdimensions ! this is equal to " << getMeshDimension();
       oss << ", whereas other mesh dimension is set equal to " << otherOnSameCoordsThanThis.getMeshDimension() << " !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   int nbOfCellsToModify=(int)std::distance(cellIdsBg,cellIdsEnd);
   if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : cells ids length (" <<  nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   int nbOfCells=getNumberOfCells();
   bool easyAssign=true;
@@ -2109,7 +2161,7 @@ void MEDCouplingUMesh::setPartOfMySelf(const int *cellIdsBg, const int *cellIdsE
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : On pos #" << std::distance(cellIdsBg,it) << " id is equal to " << *it << " which is not in [0," << nbOfCells << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   if(easyAssign)
@@ -2137,13 +2189,13 @@ void MEDCouplingUMesh::setPartOfMySelfSlice(int start, int end, int step, const
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : Mismatch of meshdimensions ! this is equal to " << getMeshDimension();
       oss << ", whereas other mesh dimension is set equal to " << otherOnSameCoordsThanThis.getMeshDimension() << " !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   int nbOfCellsToModify=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::setPartOfMySelfSlice : ");
   if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : cells ids length (" <<  nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   int nbOfCells=getNumberOfCells();
   bool easyAssign=true;
@@ -2159,7 +2211,7 @@ void MEDCouplingUMesh::setPartOfMySelfSlice(int start, int end, int step, const
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : On pos #" << i << " id is equal to " << it << " which is not in [0," << nbOfCells << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   if(easyAssign)
@@ -2437,6 +2489,7 @@ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1On
                                             DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const
 {
   typedef MCAuto<DataArrayInt> DAInt;
+  typedef MCAuto<MEDCouplingUMesh> MCUMesh;
 
   checkFullyDefined();
   otherDimM1OnSameCoords.checkFullyDefined();
@@ -2444,21 +2497,62 @@ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1On
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate : meshes do not share the same coords array !");
   if(otherDimM1OnSameCoords.getMeshDimension()!=getMeshDimension()-1)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate : the mesh given in other parameter must have this->getMeshDimension()-1 !");
-  DataArrayInt *cellIdsRk0=0,*cellIdsRk1=0;
-  findCellIdsLyingOn(otherDimM1OnSameCoords,cellIdsRk0,cellIdsRk1);
-  DAInt cellIdsRk0Auto(cellIdsRk0),cellIdsRk1Auto(cellIdsRk1);
-  DAInt s0=cellIdsRk1->buildComplement(cellIdsRk0->getNumberOfTuples());
-  s0->transformWithIndArr(cellIdsRk0Auto->begin(),cellIdsRk0Auto->end());
-  MCAuto<MEDCouplingUMesh> m0Part=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(s0->begin(),s0->end(),true));
-  DAInt s1=m0Part->computeFetchedNodeIds();
-  DAInt s2=otherDimM1OnSameCoords.computeFetchedNodeIds();
-  DAInt s3=s2->buildSubstraction(s1);
-  cellIdsRk1->transformWithIndArr(cellIdsRk0Auto->begin(),cellIdsRk0Auto->end());
+
+  // Checking star-shaped M1 group:
+  DAInt dt0=DataArrayInt::New(),dit0=DataArrayInt::New(),rdt0=DataArrayInt::New(),rdit0=DataArrayInt::New();
+  MCUMesh meshM2 = otherDimM1OnSameCoords.buildDescendingConnectivity(dt0, dit0, rdt0, rdit0);
+  DAInt dsi = rdit0->deltaShiftIndex();
+  DAInt idsTmp0 = dsi->findIdsNotInRange(-1, 3);
+  if(idsTmp0->getNumberOfTuples())
+    throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group: group is too complex: some points (or edges) have more than two connected segments (or faces)!");
+  dt0=0; dit0=0; rdt0=0; rdit0=0; idsTmp0=0;
+
+  // Get extreme nodes from the group (they won't be duplicated), ie nodes belonging to boundary cells of M1
+  DAInt xtremIdsM2 = dsi->findIdsEqual(1); dsi = 0;
+  MCUMesh meshM2Part = static_cast<MEDCouplingUMesh *>(meshM2->buildPartOfMySelf(xtremIdsM2->begin(), xtremIdsM2->end(),true));
+  DAInt xtrem = meshM2Part->computeFetchedNodeIds();
+  // Remove from the list points on the boundary of the M0 mesh (those need duplication!)
+  dt0=DataArrayInt::New(),dit0=DataArrayInt::New(),rdt0=DataArrayInt::New(),rdit0=DataArrayInt::New();
+  MCUMesh m0desc = buildDescendingConnectivity(dt0, dit0, rdt0, rdit0); dt0=0; dit0=0; rdt0=0;
+  dsi = rdit0->deltaShiftIndex();
+  DAInt boundSegs = dsi->findIdsEqual(1);   // boundary segs/faces of the M0 mesh
+  MCUMesh m0descSkin = static_cast<MEDCouplingUMesh *>(m0desc->buildPartOfMySelf(boundSegs->begin(),boundSegs->end(), true));
+  DAInt fNodes = m0descSkin->computeFetchedNodeIds();
+  // In 3D, some points on the boundary of M0 still need duplication:
+  DAInt notDup = 0;
+  if (getMeshDimension() == 3)
+    {
+      DAInt dnu1=DataArrayInt::New(), dnu2=DataArrayInt::New(), dnu3=DataArrayInt::New(), dnu4=DataArrayInt::New();
+      MCUMesh m0descSkinDesc = m0descSkin->buildDescendingConnectivity(dnu1, dnu2, dnu3, dnu4);
+      dnu1=0;dnu2=0;dnu3=0;dnu4=0;
+      DataArrayInt * corresp=0;
+      meshM2->areCellsIncludedIn(m0descSkinDesc,2,corresp);
+      DAInt validIds = corresp->findIdsInRange(0, meshM2->getNumberOfCells());
+      corresp->decrRef();
+      if (validIds->getNumberOfTuples())
+        {
+          MCUMesh m1IntersecSkin = static_cast<MEDCouplingUMesh *>(m0descSkinDesc->buildPartOfMySelf(validIds->begin(), validIds->end(), true));
+          DAInt notDuplSkin = m1IntersecSkin->findBoundaryNodes();
+          DAInt fNodes1 = fNodes->buildSubstraction(notDuplSkin);
+          notDup = xtrem->buildSubstraction(fNodes1);
+        }
+      else
+        notDup = xtrem->buildSubstraction(fNodes);
+    }
+  else
+    notDup = xtrem->buildSubstraction(fNodes);
+
+  // Now compute cells around group (i.e. cells where we will do the propagation to identify the two sub-sets delimited by the group)
+  DAInt m1Nodes = otherDimM1OnSameCoords.computeFetchedNodeIds();
+  DAInt dupl = m1Nodes->buildSubstraction(notDup);
+  DAInt cellsAroundGroup = getCellIdsLyingOnNodes(dupl->begin(), dupl->end(), false);  // false= take cell in, even if not all nodes are in notDup
+
   //
-  MCAuto<MEDCouplingUMesh> m0Part2=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(cellIdsRk1->begin(),cellIdsRk1->end(),true));
+  MCUMesh m0Part2=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(cellsAroundGroup->begin(),cellsAroundGroup->end(),true));
   int nCells2 = m0Part2->getNumberOfCells();
   DAInt desc00=DataArrayInt::New(),descI00=DataArrayInt::New(),revDesc00=DataArrayInt::New(),revDescI00=DataArrayInt::New();
-  MCAuto<MEDCouplingUMesh> m01=m0Part2->buildDescendingConnectivity(desc00,descI00,revDesc00,revDescI00);
+  MCUMesh m01=m0Part2->buildDescendingConnectivity(desc00,descI00,revDesc00,revDescI00);
+
   // Neighbor information of the mesh without considering the crack (serves to count how many connex pieces it is made of)
   DataArrayInt *tmp00=0,*tmp11=0;
   MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc00,descI00,revDesc00,revDescI00, tmp00, tmp11);
@@ -2468,8 +2562,6 @@ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1On
   DataArrayInt *idsTmp=0;
   bool b=m01->areCellsIncludedIn(&otherDimM1OnSameCoords,2,idsTmp);
   DAInt ids(idsTmp);
-  if(!b)
-    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate : the given mdim-1 mesh in other is not a constituent of this !");
   // In the neighbor information remove the connection between high dimension cells and its low level constituents which are part
   // of the frontier given in parameter (i.e. the cells of low dimension from the group delimiting the crack):
   MEDCouplingUMesh::RemoveIdsFromIndexedArrays(ids->begin(),ids->end(),desc00,descI00);
@@ -2515,12 +2607,12 @@ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1On
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate(): internal error - too many iterations.");
 
   DAInt cellsToModifyConn1_torenum=cellsToModifyConn0_torenum->buildComplement(neighI00->getNumberOfTuples()-1);
-  cellsToModifyConn0_torenum->transformWithIndArr(cellIdsRk1->begin(),cellIdsRk1->end());
-  cellsToModifyConn1_torenum->transformWithIndArr(cellIdsRk1->begin(),cellIdsRk1->end());
+  cellsToModifyConn0_torenum->transformWithIndArr(cellsAroundGroup->begin(),cellsAroundGroup->end());
+  cellsToModifyConn1_torenum->transformWithIndArr(cellsAroundGroup->begin(),cellsAroundGroup->end());
   //
   cellIdsNeededToBeRenum=cellsToModifyConn0_torenum.retn();
   cellIdsNotModified=cellsToModifyConn1_torenum.retn();
-  nodeIdsToDuplicate=s3.retn();
+  nodeIdsToDuplicate=dupl.retn();
 }
 
 /*!
@@ -2595,7 +2687,7 @@ void MEDCouplingUMesh::renumberNodesInConn(const INTERP_KERNEL::HashMap<int,int>
             else
               {
                 std::ostringstream oss; oss << "MEDCouplingUMesh::renumberNodesInConn(map) : presence in connectivity for cell #" << i << " of node #" << node << " : Not in map !";
-                throw INTERP_KERNEL::Exception(oss.str().c_str());
+                throw INTERP_KERNEL::Exception(oss.str());
               }
           }
       }
@@ -2889,7 +2981,7 @@ INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::getTypeOfCell(int cellId) co
   else
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::getTypeOfCell : Requesting type of cell #" << cellId << " but it should be in [0," << _nodal_connec_index->getNbOfElems()-1 << ") !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
 }
 
@@ -3357,7 +3449,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfKeepCoordsSlice(int start,
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoordsSlice : On pos #" << i << " input cell id =" << work << " should be in [0," << ncell << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(newConnIPtr[0],1);
@@ -3401,7 +3493,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfKeepCoords(const int *begin
         {
           free(connIndexRet);
           std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoords : On pos #" << std::distance(begin,work) << " input cell id =" << *work << " should be in [0," << ncell << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   int *connRet=(int *)malloc(connIndexRet[nbOfElemsRet]*sizeof(int));
@@ -3846,18 +3938,15 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSlice3DSurf(const double *origin, const
   checkFullyDefined();
   if(getMeshDimension()!=2 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf works on umeshes with meshdim equal to 2 and spaceDim equal to 3 !");
-  MCAuto<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
+  MCAuto<DataArrayInt> candidates(getCellIdsCrossingPlane(origin,vec,eps));
   if(candidates->empty())
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf : No 3D surf cells in this intercepts the specified plane considering bounding boxes !");
   std::vector<int> nodes;
-  DataArrayInt *cellIds1D=0;
-  MCAuto<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
+  DataArrayInt *cellIds1D(0);
+  MCAuto<MEDCouplingUMesh> subMesh(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
   subMesh->findNodesOnPlane(origin,vec,eps,nodes);
-  MCAuto<DataArrayInt> desc1=DataArrayInt::New();
-  MCAuto<DataArrayInt> descIndx1=DataArrayInt::New();
-  MCAuto<DataArrayInt> revDesc1=DataArrayInt::New();
-  MCAuto<DataArrayInt> revDescIndx1=DataArrayInt::New();
-  MCAuto<MEDCouplingUMesh> mDesc1=subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
+  MCAuto<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
+  MCAuto<MEDCouplingUMesh> mDesc1(subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));//meshDim==1 spaceDim==3
   mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
   MCAuto<DataArrayInt> cellIds1DTmp(cellIds1D);
   //
@@ -3907,6 +3996,117 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSlice3DSurf(const double *origin, const
   return ret.retn();
 }
 
+MCAuto<MEDCouplingUMesh> MEDCouplingUMesh::clipSingle3DCellByPlane(const double origin[3], const double vec[3], double eps) const
+{
+  checkFullyDefined();
+  if(getMeshDimension()!=3 || getSpaceDimension()!=3)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
+  if(getNumberOfCells()!=1)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane works only on mesh containing exactly one cell !");
+  //
+  std::vector<int> nodes;
+  findNodesOnPlane(origin,vec,eps,nodes);
+  MCAuto<DataArrayInt> desc1(DataArrayInt::New()),desc2(DataArrayInt::New()),descIndx1(DataArrayInt::New()),descIndx2(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDesc2(DataArrayInt::New()),revDescIndx1(DataArrayInt::New()),revDescIndx2(DataArrayInt::New());
+  MCAuto<MEDCouplingUMesh> mDesc2(buildDescendingConnectivity(desc2,descIndx2,revDesc2,revDescIndx2));//meshDim==2 spaceDim==3
+  revDesc2=0; revDescIndx2=0;
+  MCAuto<MEDCouplingUMesh> mDesc1(mDesc2->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));//meshDim==1 spaceDim==3
+  revDesc1=0; revDescIndx1=0;
+  DataArrayInt *cellIds1D(0);
+  mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
+  MCAuto<DataArrayInt> cellIds1DTmp(cellIds1D);
+  std::vector<int> cut3DCurve(mDesc1->getNumberOfCells(),-2);
+  for(const int *it=cellIds1D->begin();it!=cellIds1D->end();it++)
+    cut3DCurve[*it]=-1;
+  mDesc1->split3DCurveWithPlane(origin,vec,eps,cut3DCurve);
+  std::vector< std::pair<int,int> > cut3DSurf(mDesc2->getNumberOfCells());
+  AssemblyForSplitFrom3DCurve(cut3DCurve,nodes,mDesc2->getNodalConnectivity()->begin(),mDesc2->getNodalConnectivityIndex()->begin(),
+                              mDesc1->getNodalConnectivity()->begin(),mDesc1->getNodalConnectivityIndex()->begin(),
+                              desc1->begin(),descIndx1->begin(),cut3DSurf);
+  MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
+  connI->pushBackSilent(0); conn->alloc(0,1);
+  {
+    MCAuto<DataArrayInt> cellIds2(DataArrayInt::New()); cellIds2->alloc(0,1);
+    assemblyForSplitFrom3DSurf(cut3DSurf,desc2->begin(),descIndx2->begin(),conn,connI,cellIds2);
+    if(cellIds2->empty())
+      throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane !");
+  }
+  std::vector<std::vector<int> > res;
+  buildSubCellsFromCut(cut3DSurf,desc2->begin(),descIndx2->begin(),mDesc1->getCoords()->begin(),eps,res);
+  std::size_t sz(res.size());
+  if(res.size()==mDesc1->getNumberOfCells())
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane : cell is not clipped !");
+  for(std::size_t i=0;i<sz;i++)
+    {
+      conn->pushBackSilent((int)INTERP_KERNEL::NORM_POLYGON);
+      conn->insertAtTheEnd(res[i].begin(),res[i].end());
+      connI->pushBackSilent(conn->getNumberOfTuples());
+    }
+  MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("",2));
+  ret->setCoords(mDesc1->getCoords());
+  ret->setConnectivity(conn,connI,true);
+  int nbCellsRet(ret->getNumberOfCells());
+  //
+  MCAuto<DataArrayDouble> vec2(DataArrayDouble::New()); vec2->alloc(1,3); std::copy(vec,vec+3,vec2->getPointer());
+  MCAuto<MEDCouplingFieldDouble> ortho(ret->buildOrthogonalField());
+  MCAuto<DataArrayDouble> ortho2(ortho->getArray()->selectByTupleIdSafeSlice(0,1,1));
+  MCAuto<DataArrayDouble> dott(DataArrayDouble::Dot(ortho2,vec2));
+  MCAuto<DataArrayDouble> ccm(ret->computeCellCenterOfMass());
+  MCAuto<DataArrayDouble> occm;
+  {
+    MCAuto<DataArrayDouble> pt(DataArrayDouble::New()); pt->alloc(1,3); std::copy(origin,origin+3,pt->getPointer());
+    occm=DataArrayDouble::Substract(ccm,pt);
+  }
+  vec2=DataArrayDouble::New(); vec2->alloc(nbCellsRet,3);
+  vec2->setPartOfValuesSimple1(vec[0],0,nbCellsRet,1,0,1,1); vec2->setPartOfValuesSimple1(vec[1],0,nbCellsRet,1,1,2,1); vec2->setPartOfValuesSimple1(vec[2],0,nbCellsRet,1,2,3,1);
+  MCAuto<DataArrayDouble> dott2(DataArrayDouble::Dot(occm,vec2));
+  //
+  const int *cPtr(ret->getNodalConnectivity()->begin()),*ciPtr(ret->getNodalConnectivityIndex()->begin());
+  MCAuto<MEDCouplingUMesh> ret2(MEDCouplingUMesh::New("Clip3D",3));
+  ret2->setCoords(mDesc1->getCoords());
+  MCAuto<DataArrayInt> conn2(DataArrayInt::New()),conn2I(DataArrayInt::New());
+  conn2I->pushBackSilent(0); conn2->alloc(0,1);
+  std::vector<int> cell0(1,(int)INTERP_KERNEL::NORM_POLYHED);
+  std::vector<int> cell1(1,(int)INTERP_KERNEL::NORM_POLYHED);
+  if(dott->getIJ(0,0)>0)
+    {
+      cell0.insert(cell0.end(),cPtr+1,cPtr+ciPtr[1]);
+      std::reverse_copy(cPtr+1,cPtr+ciPtr[1],std::inserter(cell1,cell1.end()));
+    }
+  else
+    {
+      cell1.insert(cell1.end(),cPtr+1,cPtr+ciPtr[1]);
+      std::reverse_copy(cPtr+1,cPtr+ciPtr[1],std::inserter(cell0,cell0.end()));
+    }
+  for(int i=1;i<nbCellsRet;i++)
+    {
+      if(dott2->getIJ(i,0)<0)
+        {
+          if(ciPtr[i+1]-ciPtr[i]>=4)
+            {
+              cell0.push_back(-1);
+              cell0.insert(cell0.end(),cPtr+ciPtr[i]+1,cPtr+ciPtr[i+1]);
+            }
+        }
+      else
+        {
+          if(ciPtr[i+1]-ciPtr[i]>=4)
+            {
+              cell1.push_back(-1);
+              cell1.insert(cell1.end(),cPtr+ciPtr[i]+1,cPtr+ciPtr[i+1]);
+            }
+        }
+    }
+  conn2->insertAtTheEnd(cell0.begin(),cell0.end());
+  conn2I->pushBackSilent(conn2->getNumberOfTuples());
+  conn2->insertAtTheEnd(cell1.begin(),cell1.end());
+  conn2I->pushBackSilent(conn2->getNumberOfTuples());
+  ret2->setConnectivity(conn2,conn2I,true);
+  ret2->checkConsistencyLight();
+  ret2->writeVTK("ret2.vtu");
+  ret2->orientCorrectlyPolyhedrons();
+  return ret2;
+}
+
 /*!
  * Finds cells whose bounding boxes intersect a given plane.
  *  \param [in] origin - 3 components of a point defining location of the plane.
@@ -3940,7 +4140,7 @@ DataArrayInt *MEDCouplingUMesh::getCellIdsCrossingPlane(const double *origin, co
       MCAuto<DataArrayDouble> coo=_coords->deepCopy();
       double normm2(sqrt(vec2[0]*vec2[0]+vec2[1]*vec2[1]+vec2[2]*vec2[2]));
       if(normm2/normm>1e-6)
-        MEDCouplingPointSet::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer());
+        DataArrayDouble::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer(),coo->getPointer());
       MCAuto<MEDCouplingUMesh> mw=clone(false);//false -> shallow copy
       mw->setCoords(coo);
       mw->getBoundingBox(bbox);
@@ -3970,8 +4170,7 @@ bool MEDCouplingUMesh::isContiguous1D() const
   int nbCells=getNumberOfCells();
   if(nbCells<1)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::isContiguous1D : this method has a sense for non empty mesh !");
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const int *conn=_nodal_connec->getConstPointer();
+  const int *connI(_nodal_connec_index->begin()),*conn(_nodal_connec->begin());
   int ref=conn[connI[0]+2];
   for(int i=1;i<nbCells;i++)
     {
@@ -4051,7 +4250,7 @@ double MEDCouplingUMesh::distanceToPoint(const double *ptBg, const double *ptEnd
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoint : only mesh dimension 2 and 1 are implemented !");
   checkFullyDefined();
   if((int)std::distance(ptBg,ptEnd)!=spaceDim)
-    { std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoint : input point has to have dimension equal to the space dimension of this (" << spaceDim << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+    { std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoint : input point has to have dimension equal to the space dimension of this (" << spaceDim << ") !"; throw INTERP_KERNEL::Exception(oss.str()); }
   DataArrayInt *ret1=0;
   MCAuto<DataArrayDouble> pts=DataArrayDouble::New(); pts->useArray(ptBg,false,C_DEALLOC,1,spaceDim);
   MCAuto<DataArrayDouble> ret0=distanceToPoints(pts,ret1);
@@ -4094,7 +4293,7 @@ DataArrayDouble *MEDCouplingUMesh::distanceToPoints(const DataArrayDouble *pts,
   if(pts->getNumberOfComponents()!=spaceDim)
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoints : input pts DataArrayDouble has " << pts->getNumberOfComponents() << " components whereas it should be equal to " << spaceDim << " (mesh spaceDimension) !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   checkFullyDefined();
   int nbCells=getNumberOfCells();
@@ -5041,9 +5240,9 @@ bool MEDCouplingUMesh::isPresenceOfQuadratic() const
 void MEDCouplingUMesh::convertQuadraticCellsToLinear()
 {
   checkFullyDefined();
-  int nbOfCells=getNumberOfCells();
+  int nbOfCells(getNumberOfCells());
   int delta=0;
-  const int *iciptr=_nodal_connec_index->getConstPointer();
+  const int *iciptr=_nodal_connec_index->begin();
   for(int i=0;i<nbOfCells;i++)
     {
       INTERP_KERNEL::NormalizedCellType type=getTypeOfCell(i);
@@ -5060,13 +5259,11 @@ void MEDCouplingUMesh::convertQuadraticCellsToLinear()
     }
   if(delta==0)
     return ;
-  MCAuto<DataArrayInt> newConn=DataArrayInt::New();
-  MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
-  const int *icptr=_nodal_connec->getConstPointer();
+  MCAuto<DataArrayInt> newConn(DataArrayInt::New()),newConnI(DataArrayInt::New());
+  const int *icptr(_nodal_connec->begin());
   newConn->alloc(getNodalConnectivityArrayLen()-delta,1);
   newConnI->alloc(nbOfCells+1,1);
-  int *ocptr=newConn->getPointer();
-  int *ociptr=newConnI->getPointer();
+  int *ocptr(newConn->getPointer()),*ociptr(newConnI->getPointer());
   *ociptr=0;
   _types.clear();
   for(int i=0;i<nbOfCells;i++,ociptr++)
@@ -5262,8 +5459,8 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic1D0(DataArrayInt *&
   MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
   int nbOfCells=getNumberOfCells();
   int nbOfNodes=getNumberOfNodes();
-  const int *cPtr=_nodal_connec->getConstPointer();
-  const int *icPtr=_nodal_connec_index->getConstPointer();
+  const int *cPtr=_nodal_connec->begin();
+  const int *icPtr=_nodal_connec_index->begin();
   int lastVal=0,offset=nbOfNodes;
   for(int i=0;i<nbOfCells;i++,icPtr++)
     {
@@ -5307,8 +5504,8 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2DAnd3D0(const MEDC
   const int *c1DPtr=conn1D->begin();
   const int *c1DIPtr=conn1DI->begin();
   int nbOfCells=getNumberOfCells();
-  const int *cPtr=_nodal_connec->getConstPointer();
-  const int *icPtr=_nodal_connec_index->getConstPointer();
+  const int *cPtr=_nodal_connec->begin();
+  const int *icPtr=_nodal_connec_index->begin();
   int lastVal=0;
   for(int i=0;i<nbOfCells;i++,icPtr++,descIPtr++)
     {
@@ -5369,8 +5566,8 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2D1(DataArrayInt *&
   const int *c1DPtr=conn1D->begin();
   const int *c1DIPtr=conn1DI->begin();
   int nbOfCells=getNumberOfCells();
-  const int *cPtr=_nodal_connec->getConstPointer();
-  const int *icPtr=_nodal_connec_index->getConstPointer();
+  const int *cPtr=_nodal_connec->begin();
+  const int *icPtr=_nodal_connec_index->begin();
   int lastVal=0,offset=coordsTmpSafe->getNumberOfTuples();
   for(int i=0;i<nbOfCells;i++,icPtr++,descIPtr++)
     {
@@ -5437,8 +5634,8 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic3D1(DataArrayInt *&
   MCAuto<DataArrayInt> conn2DSafe(conn2D),conn2DISafe(conn2DI);
   const int *c1DPtr=conn1D->begin(),*c1DIPtr=conn1DI->begin(),*c2DPtr=conn2D->begin(),*c2DIPtr=conn2DI->begin();
   int nbOfCells=getNumberOfCells();
-  const int *cPtr=_nodal_connec->getConstPointer();
-  const int *icPtr=_nodal_connec_index->getConstPointer();
+  const int *cPtr=_nodal_connec->begin();
+  const int *icPtr=_nodal_connec_index->begin();
   int lastVal=0,offset=coordsTmpSafe->getNumberOfTuples();
   for(int i=0;i<nbOfCells;i++,icPtr++,descIPtr++,desc2IPtr++)
     {
@@ -5450,7 +5647,7 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic3D1(DataArrayInt *&
           if(typ2==INTERP_KERNEL::NORM_ERROR)
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::convertLinearCellsToQuadratic3D1 : On cell #" << i << " the linear cell type does not support advanced quadratization !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
           types.insert(typ2); newConn->pushBackSilent(typ2);
           newConn->pushBackValsSilent(cPtr+icPtr[0]+1,cPtr+icPtr[1]);
@@ -5556,8 +5753,8 @@ bool MEDCouplingUMesh::areOnlySimplexCells() const
   if(mdim<1 || mdim>3)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::areOnlySimplexCells : only available with meshes having a meshdim 1, 2 or 3 !");
   int nbCells=getNumberOfCells();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   for(int i=0;i<nbCells;i++)
     {
       const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connI[i]]);
@@ -5588,8 +5785,8 @@ DataArrayInt *MEDCouplingUMesh::simplexizePol0()
   int *pt=newConn->getPointer();
   int *ptI=newConnI->getPointer();
   ptI[0]=0;
-  const int *oldc=_nodal_connec->getConstPointer();
-  const int *ci=_nodal_connec_index->getConstPointer();
+  const int *oldc=_nodal_connec->begin();
+  const int *ci=_nodal_connec_index->begin();
   for(int i=0;i<nbOfCells;i++,ci++)
     {
       if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_QUAD4)
@@ -5641,8 +5838,8 @@ DataArrayInt *MEDCouplingUMesh::simplexizePol1()
   int *pt=newConn->getPointer();
   int *ptI=newConnI->getPointer();
   ptI[0]=0;
-  const int *oldc=_nodal_connec->getConstPointer();
-  const int *ci=_nodal_connec_index->getConstPointer();
+  const int *oldc=_nodal_connec->begin();
+  const int *ci=_nodal_connec_index->begin();
   for(int i=0;i<nbOfCells;i++,ci++)
     {
       if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_QUAD4)
@@ -5694,8 +5891,8 @@ DataArrayInt *MEDCouplingUMesh::simplexizePlanarFace5()
   int *pt=newConn->getPointer();
   int *ptI=newConnI->getPointer();
   ptI[0]=0;
-  const int *oldc=_nodal_connec->getConstPointer();
-  const int *ci=_nodal_connec_index->getConstPointer();
+  const int *oldc=_nodal_connec->begin();
+  const int *ci=_nodal_connec_index->begin();
   for(int i=0;i<nbOfCells;i++,ci++)
     {
       if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_HEXA8)
@@ -5746,8 +5943,8 @@ DataArrayInt *MEDCouplingUMesh::simplexizePlanarFace6()
   int *pt=newConn->getPointer();
   int *ptI=newConnI->getPointer();
   ptI[0]=0;
-  const int *oldc=_nodal_connec->getConstPointer();
-  const int *ci=_nodal_connec_index->getConstPointer();
+  const int *oldc=_nodal_connec->begin();
+  const int *ci=_nodal_connec_index->begin();
   for(int i=0;i<nbOfCells;i++,ci++)
     {
       if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_HEXA8)
@@ -5803,7 +6000,7 @@ void MEDCouplingUMesh::tessellate2DInternal(double eps)
   MCAuto<MEDCouplingUMesh> mDesc(buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1));
   revDesc1=0; revDescIndx1=0;
   mDesc->tessellate2D(eps);
-  subDivide2DMesh(mDesc->_nodal_connec->getConstPointer(),mDesc->_nodal_connec_index->getConstPointer(),desc1->getConstPointer(),descIndx1->getConstPointer());
+  subDivide2DMesh(mDesc->_nodal_connec->begin(),mDesc->_nodal_connec_index->begin(),desc1->begin(),descIndx1->begin());
   setCoords(mDesc->getCoords());
 }
 
@@ -5828,9 +6025,9 @@ void MEDCouplingUMesh::tessellate2DCurveInternal(double eps)
   INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=1.e-10;
   int nbCells=getNumberOfCells();
   int nbNodes=getNumberOfNodes();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coords=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coords=_coords->begin();
   std::vector<double> addCoo;
   std::vector<int> newConn;//no direct DataArrayInt because interface with Geometric2D
   MCAuto<DataArrayInt> newConnI(DataArrayInt::New());
@@ -5930,7 +6127,7 @@ void MEDCouplingUMesh::subDivide2DMesh(const int *nodeSubdived, const int *nodeI
               else
                 {
                   std::ostringstream oss; oss << "MEDCouplingUMesh::subDivide2DMesh : On polygon #" << i << " edgeid #" << j << " subedges mismatch : end subedge k!=start subedge k+1 !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  throw INTERP_KERNEL::Exception(oss.str());
                 }
             }
           else
@@ -6034,9 +6231,9 @@ void MEDCouplingUMesh::are2DCellsNotCorrectlyOriented(const double *vec, bool po
   if(getMeshDimension()!=2 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("Invalid mesh to apply are2DCellsNotCorrectlyOriented on it : must be meshDim==2 and spaceDim==3 !");
   int nbOfCells=getNumberOfCells();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coordsPtr=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coordsPtr=_coords->begin();
   for(int i=0;i<nbOfCells;i++)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
@@ -6072,8 +6269,8 @@ void MEDCouplingUMesh::orientCorrectly2DCells(const double *vec, bool polyOnly)
   if(getMeshDimension()!=2 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("Invalid mesh to apply orientCorrectly2DCells on it : must be meshDim==2 and spaceDim==3 !");
   int nbOfCells(getNumberOfCells()),*conn(_nodal_connec->getPointer());
-  const int *connI(_nodal_connec_index->getConstPointer());
-  const double *coordsPtr(_coords->getConstPointer());
+  const int *connI(_nodal_connec_index->begin());
+  const double *coordsPtr(_coords->begin());
   bool isModified(false);
   for(int i=0;i<nbOfCells;i++)
     {
@@ -6105,7 +6302,7 @@ void MEDCouplingUMesh::changeOrientationOfCells()
   if(mdim!=2 && mdim!=1)
     throw INTERP_KERNEL::Exception("Invalid mesh to apply changeOrientationOfCells on it : must be meshDim==2 or meshDim==1 !");
   int nbOfCells(getNumberOfCells()),*conn(_nodal_connec->getPointer());
-  const int *connI(_nodal_connec_index->getConstPointer());
+  const int *connI(_nodal_connec_index->begin());
   if(mdim==2)
     {//2D
       for(int i=0;i<nbOfCells;i++)
@@ -6146,9 +6343,9 @@ void MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented(std::vector<int>& cell
   if(getMeshDimension()!=3 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("Invalid mesh to apply arePolyhedronsNotCorrectlyOriented on it : must be meshDim==3 and spaceDim==3 !");
   int nbOfCells=getNumberOfCells();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coordsPtr=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coordsPtr=_coords->begin();
   for(int i=0;i<nbOfCells;i++)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
@@ -6181,8 +6378,8 @@ void MEDCouplingUMesh::orientCorrectlyPolyhedrons()
     throw INTERP_KERNEL::Exception("Invalid mesh to apply orientCorrectlyPolyhedrons on it : must be meshDim==3 and spaceDim==3 !");
   int nbOfCells=getNumberOfCells();
   int *conn=_nodal_connec->getPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coordsPtr=_coords->getConstPointer();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coordsPtr=_coords->begin();
   for(int i=0;i<nbOfCells;i++)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
@@ -6196,7 +6393,7 @@ void MEDCouplingUMesh::orientCorrectlyPolyhedrons()
           catch(INTERP_KERNEL::Exception& e)
           {
               std::ostringstream oss; oss << "Something wrong in polyhedron #" << i << " : " << e.what();
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
           }
         }
     }
@@ -6233,8 +6430,8 @@ DataArrayInt *MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells()
   //
   int nbOfCells=getNumberOfCells();
   int *conn=_nodal_connec->getPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coo=getCoords()->getConstPointer();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coo=getCoords()->begin();
   MCAuto<DataArrayInt> cells(DataArrayInt::New()); cells->alloc(0,1);
   for(int i=0;i<nbOfCells;i++)
     {
@@ -6265,8 +6462,8 @@ DataArrayInt *MEDCouplingUMesh::findAndCorrectBadOriented3DCells()
     throw INTERP_KERNEL::Exception("Invalid mesh to apply findAndCorrectBadOriented3DCells on it : must be meshDim==3 and spaceDim==3 !");
   int nbOfCells=getNumberOfCells();
   int *conn=_nodal_connec->getPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coordsPtr=_coords->getConstPointer();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coordsPtr=_coords->begin();
   MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
   for(int i=0;i<nbOfCells;i++)
     {
@@ -6330,9 +6527,9 @@ void MEDCouplingUMesh::getFastAveragePlaneOfThis(double *vec, double *pos) const
 {
   if(getMeshDimension()!=2 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("Invalid mesh to apply getFastAveragePlaneOfThis on it : must be meshDim==2 and spaceDim==3 !");
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coordsPtr=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coordsPtr=_coords->begin();
   INTERP_KERNEL::areaVectorOfPolygon<int,INTERP_KERNEL::ALL_C_MODE>(conn+1,connI[1]-connI[0]-1,coordsPtr,vec);
   std::copy(coordsPtr+3*conn[1],coordsPtr+3*conn[1]+3,pos);
 }
@@ -6376,9 +6573,9 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getEdgeRatioField() const
   arr->alloc(nbOfCells,1);
   double *pt=arr->getPointer();
   ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coo=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coo=_coords->begin();
   double tmp[12];
   for(int i=0;i<nbOfCells;i++,pt++)
     {
@@ -6448,9 +6645,9 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getAspectRatioField() const
   arr->alloc(nbOfCells,1);
   double *pt=arr->getPointer();
   ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coo=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coo=_coords->begin();
   double tmp[12];
   for(int i=0;i<nbOfCells;i++,pt++)
     {
@@ -6487,9 +6684,19 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getAspectRatioField() const
 
 /*!
  * Creates a new MEDCouplingFieldDouble holding Warping factor values of all
- * cells of \a this 2D mesh in 3D space. Currently cells of the following types are
+ * cells of \a this 2D mesh in 3D space. It is a measure of the "planarity" of 2D cell
+ * in 3D space. Currently only cells of the following types are
  * treated: INTERP_KERNEL::NORM_QUAD4.
  * For a cell of other type an exception is thrown.
+ * The warp field is computed as follows: let (a,b,c,d) be the points of the quad.
+ * Defining
+ * \f$t=\vec{da}\times\vec{ab}\f$,
+ * \f$u=\vec{ab}\times\vec{bc}\f$
+ * \f$v=\vec{bc}\times\vec{cd}\f$
+ * \f$w=\vec{cd}\times\vec{da}\f$, the warp is defined as \f$W^3\f$ with
+ *  \f[
+ *     W=min(\frac{t}{|t|}\cdot\frac{v}{|v|}, \frac{u}{|u|}\cdot\frac{w}{|w|})
+ *  \f]
  *  \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
  *          cells and one time, lying on \a this mesh. The caller is to delete this
  *          field using decrRef() as it is no more needed. 
@@ -6519,9 +6726,9 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getWarpField() const
   arr->alloc(nbOfCells,1);
   double *pt=arr->getPointer();
   ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coo=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coo=_coords->begin();
   double tmp[12];
   for(int i=0;i<nbOfCells;i++,pt++)
     {
@@ -6549,6 +6756,13 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getWarpField() const
  * Creates a new MEDCouplingFieldDouble holding Skew factor values of all
  * cells of \a this 2D mesh in 3D space. Currently cells of the following types are
  * treated: INTERP_KERNEL::NORM_QUAD4.
+ * The skew is computed as follow for a quad with points (a,b,c,d): let
+ * \f$u=\vec{ab}+\vec{dc}\f$ and \f$v=\vec{ac}+\vec{bd}\f$
+ * then the skew is computed as:
+ *  \f[
+ *    s=\frac{u}{|u|}\cdot\frac{v}{|v|}
+ *  \f]
+ *
  * For a cell of other type an exception is thrown.
  *  \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
  *          cells and one time, lying on \a this mesh. The caller is to delete this
@@ -6579,9 +6793,9 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getSkewField() const
   arr->alloc(nbOfCells,1);
   double *pt=arr->getPointer();
   ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const double *coo=_coords->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
+  const double *coo=_coords->begin();
   double tmp[12];
   for(int i=0;i<nbOfCells;i++,pt++)
     {
@@ -6633,7 +6847,7 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::computeDiameterField() const
 }
 
 /*!
- * This method aggregate the bbox of each cell and put it into bbox parameter.
+ * This method aggregate the bbox of each cell and put it into bbox parameter (xmin,xmax,ymin,ymax,zmin,zmax).
  * 
  * \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
  *                         For all other cases this input parameter is ignored.
@@ -6687,8 +6901,8 @@ DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTreeFast() const
       bbox[2*i]=std::numeric_limits<double>::max();
       bbox[2*i+1]=-std::numeric_limits<double>::max();
     }
-  const double *coordsPtr(_coords->getConstPointer());
-  const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+  const double *coordsPtr(_coords->begin());
+  const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
   for(int i=0;i<nbOfCells;i++)
     {
       int offset=connI[i]+1;
@@ -6709,7 +6923,7 @@ DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTreeFast() const
       if(kk==0)
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::getBoundingBoxForBBTree : cell #" << i << " contains no valid nodeId !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   return ret.retn();
@@ -6736,8 +6950,8 @@ DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic(double arc
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic : This method should be applied on mesh with mesh dimension equal to 2 and space dimension also equal to 2!");
   MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
   double *bbox(ret->getPointer());
-  const double *coords(_coords->getConstPointer());
-  const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+  const double *coords(_coords->begin());
+  const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
   for(int i=0;i<nbOfCells;i++,bbox+=4,connI++)
     {
       const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*connI]));
@@ -6781,8 +6995,8 @@ DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic(double arc
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic : This method should be applied on mesh with mesh dimension equal to 1 and space dimension also equal to 2!");
   MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
   double *bbox(ret->getPointer());
-  const double *coords(_coords->getConstPointer());
-  const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+  const double *coords(_coords->begin());
+  const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
   for(int i=0;i<nbOfCells;i++,bbox+=4,connI++)
     {
       const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*connI]));
@@ -6843,8 +7057,8 @@ namespace MEDCouplingImpl
 std::vector<int> MEDCouplingUMesh::getDistributionOfTypes() const
 {
   checkConnectivityFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   const int *work=connI;
   int nbOfCells=getNumberOfCells();
   std::size_t n=getAllGeoTypes().size();
@@ -6857,7 +7071,7 @@ std::vector<int> MEDCouplingUMesh::getDistributionOfTypes() const
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::getDistributionOfTypes : Type " << INTERP_KERNEL::CellModel::GetCellModel(typ).getRepr();
           oss << " is not contiguous !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
       types.insert(typ);
       ret[3*i]=typ;
@@ -6917,8 +7131,8 @@ DataArrayInt *MEDCouplingUMesh::checkTypeConsistencyAndContig(const std::vector<
   MCAuto<DataArrayInt> ret=DataArrayInt::New();
   ret->alloc(nb,1);
   int *retPtr=ret->getPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
-  const int *conn=_nodal_connec->getConstPointer();
+  const int *connI=_nodal_connec_index->begin();
+  const int *conn=_nodal_connec->begin();
   int nbOfCells=getNumberOfCells();
   const int *i=connI;
   int kk=0;
@@ -6950,7 +7164,7 @@ DataArrayInt *MEDCouplingUMesh::checkTypeConsistencyAndContig(const std::vector<
                             {
                               std::ostringstream oss; oss << "MEDCouplingUMesh::checkTypeConsistencyAndContig : the section " << kk << " points to the profile #" << idInIdsPerType;
                               oss << ", and this profile contains a value " << *k << " should be in [0," << nbOfCellsOfCurType << ") !";
-                              throw INTERP_KERNEL::Exception(oss.str().c_str());
+                              throw INTERP_KERNEL::Exception(oss.str());
                             }
                         }
                     }
@@ -6964,7 +7178,7 @@ DataArrayInt *MEDCouplingUMesh::checkTypeConsistencyAndContig(const std::vector<
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::checkTypeConsistencyAndContig : at section " << kk << " of code it points to the array #" << idInIdsPerType;
               oss << " should be in [0," << idsPerType.size() << ") !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
       i=j;
@@ -6993,8 +7207,8 @@ void MEDCouplingUMesh::splitProfilePerType(const DataArrayInt *profile, std::vec
   if(profile->getNumberOfComponents()!=1)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::splitProfilePerType : input profile should have exactly one component !");
   checkConnectivityFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   int nbOfCells=getNumberOfCells();
   std::vector<INTERP_KERNEL::NormalizedCellType> types;
   std::vector<int> typeRangeVals(1);
@@ -7027,7 +7241,7 @@ void MEDCouplingUMesh::splitProfilePerType(const DataArrayInt *profile, std::vec
       idsInPflPerType2.push_back(tmp3);
       code[3*i]=(int)types[castId];
       code[3*i+1]=tmp3->getNumberOfTuples();
-      MCAuto<DataArrayInt> tmp4=rankInsideCast->selectByTupleId(tmp3->getConstPointer(),tmp3->getConstPointer()+tmp3->getNumberOfTuples());
+      MCAuto<DataArrayInt> tmp4=rankInsideCast->selectByTupleId(tmp3->begin(),tmp3->begin()+tmp3->getNumberOfTuples());
       if(!tmp4->isIota(typeRangeVals[castId+1]-typeRangeVals[castId]))
         {
           tmp4->copyStringInfoFrom(*profile);
@@ -7075,10 +7289,10 @@ MEDCouplingUMesh *MEDCouplingUMesh::emulateMEDMEMBDC(const MEDCouplingUMesh *nM1
   MCAuto<DataArrayInt> tmp1=DataArrayInt::New();
   MCAuto<MEDCouplingUMesh> ret1=buildDescendingConnectivity(desc,descIndx,tmp0,tmp1);
   MCAuto<DataArrayInt> ret0=ret1->sortCellsInMEDFileFrmt();
-  desc->transformWithIndArr(ret0->getConstPointer(),ret0->getConstPointer()+ret0->getNbOfElems());
+  desc->transformWithIndArr(ret0->begin(),ret0->begin()+ret0->getNbOfElems());
   MCAuto<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
   tmp->setConnectivity(tmp0,tmp1);
-  tmp->renumberCells(ret0->getConstPointer(),false);
+  tmp->renumberCells(ret0->begin(),false);
   revDesc=tmp->getNodalConnectivity();
   revDescIndx=tmp->getNodalConnectivityIndex();
   DataArrayInt *ret=0;
@@ -7088,7 +7302,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::emulateMEDMEMBDC(const MEDCouplingUMesh *nM1
       ret->getMaxValue(tmp2);
       ret->decrRef();
       std::ostringstream oss; oss << "MEDCouplingUMesh::emulateMEDMEMBDC : input N-1 mesh present a cell not in descending mesh ... Id of cell is " << tmp2 << " !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   nM1LevMeshIds=ret;
   //
@@ -7112,7 +7326,7 @@ DataArrayInt *MEDCouplingUMesh::sortCellsInMEDFileFrmt()
 {
   checkConnectivityFullyDefined();
   MCAuto<DataArrayInt> ret=getRenumArrForMEDFileFrmt();
-  renumberCells(ret->getConstPointer(),false);
+  renumberCells(ret->begin(),false);
   return ret.retn();
 }
 
@@ -7123,8 +7337,8 @@ DataArrayInt *MEDCouplingUMesh::sortCellsInMEDFileFrmt()
 bool MEDCouplingUMesh::checkConsecutiveCellTypes() const
 {
   checkFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   int nbOfCells=getNumberOfCells();
   std::set<INTERP_KERNEL::NormalizedCellType> types;
   for(const int *i=connI;i!=connI+nbOfCells;)
@@ -7158,8 +7372,8 @@ bool MEDCouplingUMesh::checkConsecutiveCellTypesForMEDFileFrmt() const
 bool MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
 {
   checkFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   int nbOfCells=getNumberOfCells();
   if(nbOfCells==0)
     return true;
@@ -7200,8 +7414,8 @@ DataArrayInt *MEDCouplingUMesh::getLevArrPerCellTypes(const INTERP_KERNEL::Norma
 {
   checkConnectivityFullyDefined();
   int nbOfCells=getNumberOfCells();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   MCAuto<DataArrayInt> tmpa=DataArrayInt::New();
   MCAuto<DataArrayInt> tmpb=DataArrayInt::New();
   tmpa->alloc(nbOfCells,1);
@@ -7223,7 +7437,7 @@ DataArrayInt *MEDCouplingUMesh::getLevArrPerCellTypes(const INTERP_KERNEL::Norma
           const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*i]);
           std::ostringstream oss; oss << "MEDCouplingUMesh::getLevArrPerCellTypes : Cell #" << std::distance(connI,i);
           oss << " has a type " << cm.getRepr() << " not in input array of type !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   nbPerType=tmpb.retn();
@@ -7268,8 +7482,8 @@ DataArrayInt *MEDCouplingUMesh::rearrange2ConsecutiveCellTypes()
 {
   checkFullyDefined();
   computeTypes();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   int nbOfCells=getNumberOfCells();
   std::vector<INTERP_KERNEL::NormalizedCellType> types;
   for(const int *i=connI;i!=connI+nbOfCells && (types.size()!=_types.size());)
@@ -7302,8 +7516,8 @@ DataArrayInt *MEDCouplingUMesh::rearrange2ConsecutiveCellTypes()
 std::vector<MEDCouplingUMesh *> MEDCouplingUMesh::splitByType() const
 {
   checkConnectivityFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   int nbOfCells=getNumberOfCells();
   std::vector<MEDCouplingUMesh *> ret;
   for(const int *i=connI;i!=connI+nbOfCells;)
@@ -7371,7 +7585,7 @@ DataArrayInt *MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh() co
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : this contains a single geo type (" << cm.getRepr() << ") but ";
       oss << "this type is dynamic ! Only static geometric type is possible for that type ! call convertNodalConnectivityToDynamicGeoTypeMesh instead !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   int nbCells=getNumberOfCells();
   int typi=(int)typ;
@@ -7388,7 +7602,7 @@ DataArrayInt *MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh() co
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : there something wrong in cell #" << i << " ! The type of cell is not those expected, or the length of nodal connectivity is not those expected (" << nbNodesPerCell-1 << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   return connOut.retn();
@@ -7494,8 +7708,8 @@ MEDCouplingUMesh *MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(cons
   for(std::size_t i=0;i<m1ssm.size();i++)
     m1ssmfinal[renum->getIJ(i,0)]=m1ssm[i];
   MCAuto<MEDCouplingUMesh> ret0=MEDCouplingUMesh::MergeUMeshesOnSameCoords(m1ssmfinal);
-  szOfCellGrpOfSameType=ret1->renumber(renum->getConstPointer());
-  idInMsOfCellGrpOfSameType=ret2->renumber(renum->getConstPointer());
+  szOfCellGrpOfSameType=ret1->renumber(renum->begin());
+  idInMsOfCellGrpOfSameType=ret2->renumber(renum->begin());
   return ret0.retn();
 }
 
@@ -7506,8 +7720,8 @@ MEDCouplingUMesh *MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(cons
 DataArrayInt *MEDCouplingUMesh::keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, const int *begin, const int *end) const
 {
   checkFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connIndex=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connIndex=_nodal_connec_index->begin();
   MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
   for(const int *w=begin;w!=end;w++)
     if((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*w]]==type)
@@ -7522,8 +7736,8 @@ DataArrayInt *MEDCouplingUMesh::keepCellIdsByType(INTERP_KERNEL::NormalizedCellT
 DataArrayInt *MEDCouplingUMesh::convertCellArrayPerGeoType(const DataArrayInt *da) const
 {
   checkFullyDefined();
-  const int *conn=_nodal_connec->getConstPointer();
-  const int *connI=_nodal_connec_index->getConstPointer();
+  const int *conn=_nodal_connec->begin();
+  const int *connI=_nodal_connec_index->begin();
   int nbOfCells=getNumberOfCells();
   std::set<INTERP_KERNEL::NormalizedCellType> types(getAllGeoTypes());
   int *tmp=new int[nbOfCells];
@@ -7538,7 +7752,7 @@ DataArrayInt *MEDCouplingUMesh::convertCellArrayPerGeoType(const DataArrayInt *d
   ret->alloc(da->getNumberOfTuples(),da->getNumberOfComponents());
   ret->copyStringInfoFrom(*da);
   int *retPtr=ret->getPointer();
-  const int *daPtr=da->getConstPointer();
+  const int *daPtr=da->begin();
   int nbOfElems=da->getNbOfElems();
   for(int k=0;k<nbOfElems;k++)
     retPtr[k]=tmp[daPtr[k]];
@@ -7569,7 +7783,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::keepSpecifiedCells(INTERP_KERNEL::Normalized
       {
         std::ostringstream oss; oss << "MEDCouplingUMesh::keepSpecifiedCells : Request on type " << type << " at place #" << std::distance(idsPerGeoTypeBg,work) << " value " << *work;
         oss << ". It should be in [0," << szOfType << ") !";
-        throw INTERP_KERNEL::Exception(oss.str().c_str());
+        throw INTERP_KERNEL::Exception(oss.str());
       }
   MCAuto<DataArrayInt> idsTokeep=DataArrayInt::New(); idsTokeep->alloc(sz+(int)std::distance(idsPerGeoTypeBg,idsPerGeoTypeEnd),1);
   int *idsPtr=idsTokeep->getPointer();
@@ -7596,8 +7810,8 @@ std::vector<bool> MEDCouplingUMesh::getQuadraticStatus() const
 {
   int ncell=getNumberOfCells();
   std::vector<bool> ret(ncell);
-  const int *cI=getNodalConnectivityIndex()->getConstPointer();
-  const int *c=getNodalConnectivity()->getConstPointer();
+  const int *cI=getNodalConnectivityIndex()->begin();
+  const int *c=getNodalConnectivity()->begin();
   for(int i=0;i<ncell;i++)
     {
       INTERP_KERNEL::NormalizedCellType typ=(INTERP_KERNEL::NormalizedCellType)c[cI[i]];
@@ -7638,9 +7852,9 @@ DataArrayDouble *MEDCouplingUMesh::computeCellCenterOfMass() const
   ret->alloc(nbOfCells,spaceDim);
   ret->copyStringInfoFrom(*getCoords());
   double *ptToFill=ret->getPointer();
-  const int *nodal=_nodal_connec->getConstPointer();
-  const int *nodalI=_nodal_connec_index->getConstPointer();
-  const double *coor=_coords->getConstPointer();
+  const int *nodal=_nodal_connec->begin();
+  const int *nodalI=_nodal_connec_index->begin();
+  const double *coor=_coords->begin();
   for(int i=0;i<nbOfCells;i++)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)nodal[nodalI[i]];
@@ -7670,9 +7884,9 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
   int nbOfNodes=getNumberOfNodes();
   ret->alloc(nbOfCells,spaceDim);
   double *ptToFill=ret->getPointer();
-  const int *nodal=_nodal_connec->getConstPointer();
-  const int *nodalI=_nodal_connec_index->getConstPointer();
-  const double *coor=_coords->getConstPointer();
+  const int *nodal=_nodal_connec->begin();
+  const int *nodalI=_nodal_connec_index->begin();
+  const double *coor=_coords->begin();
   for(int i=0;i<nbOfCells;i++,ptToFill+=spaceDim)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)nodal[nodalI[i]];
@@ -7686,7 +7900,7 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
               else
                 {
                   std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of nodeId #" << *conn << " should be in [0," <<   nbOfNodes << ") !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  throw INTERP_KERNEL::Exception(oss.str());
                 }
             }
           int nbOfNodesInCell=nodalI[i+1]-nodalI[i]-1;
@@ -7695,7 +7909,7 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of cell with no nodes !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
       else
@@ -7709,7 +7923,7 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
               else
                 {
                   std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell polyhedron cell #" << i << " presence of nodeId #" << *it << " should be in [0," <<   nbOfNodes << ") !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  throw INTERP_KERNEL::Exception(oss.str());
                 }
             }
           if(!s.empty())
@@ -7717,7 +7931,7 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on polyhedron cell #" << i << " there are no nodes !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
     }
@@ -7751,9 +7965,9 @@ DataArrayDouble *MEDCouplingUMesh::getPartBarycenterAndOwner(const int *begin, c
   ret->alloc(nbOfTuple,spaceDim);
   double *ptToFill=ret->getPointer();
   double *tmp=new double[spaceDim];
-  const int *nodal=_nodal_connec->getConstPointer();
-  const int *nodalI=_nodal_connec_index->getConstPointer();
-  const double *coor=_coords->getConstPointer();
+  const int *nodal=_nodal_connec->begin();
+  const int *nodalI=_nodal_connec_index->begin();
+  const double *coor=_coords->begin();
   for(const int *w=begin;w!=end;w++)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)nodal[nodalI[*w]];
@@ -7799,14 +8013,14 @@ DataArrayDouble *MEDCouplingUMesh::computePlaneEquationOf3DFaces() const
               else
                 {
                   std::ostringstream oss; oss << "MEDCouplingUMesh::computePlaneEquationOf3DFaces : invalid 2D cell #" << i << " ! This cell points to an invalid nodeId : " << nodeId << " !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  throw INTERP_KERNEL::Exception(oss.str());
                 }
             }
         }
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::computePlaneEquationOf3DFaces : invalid 2D cell #" << i << " ! Must be constitued by more than 3 nodes !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
       INTERP_KERNEL::inverseMatrix(matrix,4,matrix2);
       retPtr[0]=matrix2[3]; retPtr[1]=matrix2[7]; retPtr[2]=matrix2[11]; retPtr[3]=matrix2[15];
@@ -7877,7 +8091,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(const MEDCouplingUMesh *mesh1,
  *  \throw If \a a[ *i* ]->getMeshDimension() < 0.
  *  \throw If the meshes in \a a are of different dimension (getMeshDimension()).
  */
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector<const MEDCouplingUMesh *>& a)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(const std::vector<const MEDCouplingUMesh *>& a)
 {
   std::size_t sz=a.size();
   if(sz==0)
@@ -7886,7 +8100,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector<const MEDCouplingUM
     if(!a[ii])
       {
         std::ostringstream oss; oss << "MEDCouplingUMesh::MergeUMeshes : item #" << ii << " in input array of size "<< sz << " is empty !";
-        throw INTERP_KERNEL::Exception(oss.str().c_str());
+        throw INTERP_KERNEL::Exception(oss.str());
       }
   std::vector< MCAuto<MEDCouplingUMesh> > bb(sz);
   std::vector< const MEDCouplingUMesh * > aa(sz);
@@ -7910,7 +8124,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector<const MEDCouplingUM
 
 /// @cond INTERNAL
 
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(std::vector<const MEDCouplingUMesh *>& a)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(const std::vector<const MEDCouplingUMesh *>& a)
 {
   if(a.empty())
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::MergeUMeshes : input array must be NON EMPTY !");
@@ -7942,8 +8156,8 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(std::vector<const MEDCoupling
   for(it=a.begin();it!=a.end();it++)
     {
       int curNbOfCell=(*it)->getNumberOfCells();
-      const int *curCI=(*it)->_nodal_connec_index->getConstPointer();
-      const int *curC=(*it)->_nodal_connec->getConstPointer();
+      const int *curCI=(*it)->_nodal_connec_index->begin();
+      const int *curC=(*it)->_nodal_connec->begin();
       cIPtr=std::transform(curCI+1,curCI+curNbOfCell+1,cIPtr,std::bind2nd(std::plus<int>(),offset));
       for(int j=0;j<curNbOfCell;j++)
         {
@@ -8012,7 +8226,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const std::vector<c
     if(!meshes[ii])
       {
         std::ostringstream oss; oss << "MEDCouplingUMesh::MergeUMeshesOnSameCoords : item #" << ii << " in input array of size "<< meshes.size() << " is empty !";
-        throw INTERP_KERNEL::Exception(oss.str().c_str());
+        throw INTERP_KERNEL::Exception(oss.str());
       }
   const DataArrayDouble *coords=meshes.front()->getCoords();
   int meshDim=meshes.front()->getMeshDimension();
@@ -8037,8 +8251,8 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const std::vector<c
   int offset=0;
   for(iter=meshes.begin();iter!=meshes.end();iter++)
     {
-      const int *nod=(*iter)->getNodalConnectivity()->getConstPointer();
-      const int *index=(*iter)->getNodalConnectivityIndex()->getConstPointer();
+      const int *nod=(*iter)->getNodalConnectivity()->begin();
+      const int *index=(*iter)->getNodalConnectivityIndex()->begin();
       int nbOfCells=(*iter)->getNumberOfCells();
       int meshLgth2=(*iter)->getNodalConnectivityArrayLen();
       nodalPtr=std::copy(nod,nod+meshLgth2,nodalPtr);
@@ -8088,7 +8302,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::FuseUMeshesOnSameCoords(const std::vector<co
   corr.resize(meshes.size());
   std::size_t nbOfMeshes=meshes.size();
   int offset=0;
-  const int *o2nPtr=o2n->getConstPointer();
+  const int *o2nPtr=o2n->begin();
   for(std::size_t i=0;i<nbOfMeshes;i++)
     {
       DataArrayInt *tmp=DataArrayInt::New();
@@ -8134,14 +8348,14 @@ void MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(const std::vector<MEDCou
             {
               std::ostringstream oss; oss << " MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords : Item #" << std::distance(meshes.begin(),it) << " inside the vector of length " << meshes.size();
               oss << " has no coordinate array defined !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
       else
         {
           std::ostringstream oss; oss << " MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords : Item #" << std::distance(meshes.begin(),it) << " inside the vector of length " << meshes.size();
           oss << " is null !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   MCAuto<DataArrayDouble> res=DataArrayDouble::Aggregate(coords);
@@ -8181,13 +8395,13 @@ void MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(const std::vector<ME
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords : In input vector of unstructured meshes of size " << meshes.size() << " the element #" << std::distance(meshes.begin(),it) << " is null !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   if(s.size()!=1)
     {
       std::ostringstream oss; oss << "MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords : In input vector of unstructured meshes of size " << meshes.size() << ", it appears that they do not share the same instance of DataArrayDouble for coordiantes ! tryToShareSameCoordsPermute method can help to reach that !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
+      throw INTERP_KERNEL::Exception(oss.str());
     }
   const DataArrayDouble *coo=*(s.begin());
   if(!coo)
@@ -8201,10 +8415,10 @@ void MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(const std::vector<ME
   MCAuto<DataArrayInt> o2n=DataArrayInt::ConvertIndexArrayToO2N(oldNbOfNodes,comm->begin(),commI->begin(),commI->end(),newNbOfNodes);
   if(oldNbOfNodes==newNbOfNodes)
     return ;
-  MCAuto<DataArrayDouble> newCoords=coo->renumberAndReduce(o2n->getConstPointer(),newNbOfNodes);
+  MCAuto<DataArrayDouble> newCoords=coo->renumberAndReduce(o2n->begin(),newNbOfNodes);
   for(std::vector<MEDCouplingUMesh *>::const_iterator it=meshes.begin();it!=meshes.end();it++)
     {
-      (*it)->renumberNodesInConn(o2n->getConstPointer());
+      (*it)->renumberNodesInConn(o2n->begin());
       (*it)->setCoords(newCoords);
     } 
 }
@@ -8434,15 +8648,15 @@ void MEDCouplingUMesh::SimplifyPolyhedronCell(double eps, const DataArrayDouble
   for(int i=0;i<nbFaces;i++,vPtr+=3,pPtr++)
     {
       const int *endFaceConn=std::find(stFaceConn,end,-1);
-      ComputeVecAndPtOfFace(eps,coords->getConstPointer(),stFaceConn,endFaceConn,vPtr,pPtr);
+      ComputeVecAndPtOfFace(eps,coords->begin(),stFaceConn,endFaceConn,vPtr,pPtr);
       stFaceConn=endFaceConn+1;
     }
   pPtr=p->getPointer(); vPtr=v->getPointer();
   DataArrayInt *comm1=0,*commI1=0;
   v->findCommonTuples(eps,-1,comm1,commI1);
   MCAuto<DataArrayInt> comm1Auto(comm1),commI1Auto(commI1);
-  const int *comm1Ptr=comm1->getConstPointer();
-  const int *commI1Ptr=commI1->getConstPointer();
+  const int *comm1Ptr=comm1->begin();
+  const int *commI1Ptr=commI1->begin();
   int nbOfGrps1=commI1Auto->getNumberOfTuples()-1;
   res->pushBackSilent((int)INTERP_KERNEL::NORM_POLYHED);
   //
@@ -8457,8 +8671,8 @@ void MEDCouplingUMesh::SimplifyPolyhedronCell(double eps, const DataArrayDouble
       DataArrayInt *comm2=0,*commI2=0;
       tmpgrp2->findCommonTuples(eps,-1,comm2,commI2);
       MCAuto<DataArrayInt> comm2Auto(comm2),commI2Auto(commI2);
-      const int *comm2Ptr=comm2->getConstPointer();
-      const int *commI2Ptr=commI2->getConstPointer();
+      const int *comm2Ptr=comm2->begin();
+      const int *commI2Ptr=commI2->begin();
       int nbOfGrps2=commI2Auto->getNumberOfTuples()-1;
       for(int j=0;j<nbOfGrps2;j++)
         {
@@ -8477,7 +8691,7 @@ void MEDCouplingUMesh::SimplifyPolyhedronCell(double eps, const DataArrayDouble
               MCAuto<MEDCouplingUMesh> mm3=static_cast<MEDCouplingUMesh *>(mm2->buildPartOfMySelf(ids2->begin(),ids2->end(),true));
               MCAuto<DataArrayInt> idsNodeTmp=mm3->zipCoordsTraducer();
               MCAuto<DataArrayInt> idsNode=idsNodeTmp->invertArrayO2N2N2O(mm3->getNumberOfNodes());
-              const int *idsNodePtr=idsNode->getConstPointer();
+              const int *idsNodePtr=idsNode->begin();
               double center[3]; center[0]=pPtr[pointId]*vPtr[3*vecId]; center[1]=pPtr[pointId]*vPtr[3*vecId+1]; center[2]=pPtr[pointId]*vPtr[3*vecId+2];
               double vec[3]; vec[0]=vPtr[3*vecId+1]; vec[1]=-vPtr[3*vecId]; vec[2]=0.;
               double norm=vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2];
@@ -8488,8 +8702,8 @@ void MEDCouplingUMesh::SimplifyPolyhedronCell(double eps, const DataArrayDouble
                 }
               mm3->changeSpaceDimension(2);
               MCAuto<MEDCouplingUMesh> mm4=mm3->buildSpreadZonesWithPoly();
-              const int *conn4=mm4->getNodalConnectivity()->getConstPointer();
-              const int *connI4=mm4->getNodalConnectivityIndex()->getConstPointer();
+              const int *conn4=mm4->getNodalConnectivity()->begin();
+              const int *connI4=mm4->getNodalConnectivityIndex()->begin();
               int nbOfCells=mm4->getNumberOfCells();
               for(int k=0;k<nbOfCells;k++)
                 {
@@ -8599,9 +8813,9 @@ void MEDCouplingUMesh::TryToCorrectPolyhedronOrientation(int *begin, int *end, c
                       std::pair<int,int> p1(bgFace[j],bgFace[(j+1)%nbOfEdgesInFace]);
                       std::pair<int,int> p2(p1.second,p1.first);
                       if(std::find(edgesOK.begin(),edgesOK.end(),p1)!=edgesOK.end())
-                        { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+                        { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str()); }
                       if(std::find(edgesFinished.begin(),edgesFinished.end(),p1)!=edgesFinished.end() || std::find(edgesFinished.begin(),edgesFinished.end(),p2)!=edgesFinished.end())
-                        { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+                        { std::ostringstream oss; oss << "Face #" << j << " of polyhedron looks bad !"; throw INTERP_KERNEL::Exception(oss.str()); }
                       std::list< std::pair<int,int> >::iterator it=std::find(edgesOK.begin(),edgesOK.end(),p2);
                       if(it!=edgesOK.end())
                         {
@@ -8635,12 +8849,12 @@ void MEDCouplingUMesh::TryToCorrectPolyhedronOrientation(int *begin, int *end, c
 DataArrayInt *MEDCouplingUMesh::buildUnionOf2DMeshLinear(const MEDCouplingUMesh *skin, const DataArrayInt *n2o) const
 {
   int nbOfNodesExpected(skin->getNumberOfNodes());
-  const int *n2oPtr(n2o->getConstPointer());
+  const int *n2oPtr(n2o->begin());
   MCAuto<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
   skin->getReverseNodalConnectivity(revNodal,revNodalI);
-  const int *revNodalPtr(revNodal->getConstPointer()),*revNodalIPtr(revNodalI->getConstPointer());
-  const int *nodalPtr(skin->getNodalConnectivity()->getConstPointer());
-  const int *nodalIPtr(skin->getNodalConnectivityIndex()->getConstPointer());
+  const int *revNodalPtr(revNodal->begin()),*revNodalIPtr(revNodalI->begin());
+  const int *nodalPtr(skin->getNodalConnectivity()->begin());
+  const int *nodalIPtr(skin->getNodalConnectivityIndex()->begin());
   MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
   int *work(ret->getPointer());  *work++=INTERP_KERNEL::NORM_POLYGON;
   if(nbOfNodesExpected<1)
@@ -8680,12 +8894,12 @@ DataArrayInt *MEDCouplingUMesh::buildUnionOf2DMeshQuadratic(const MEDCouplingUMe
 {
   int nbOfNodesExpected(skin->getNumberOfNodes());
   int nbOfTurn(nbOfNodesExpected/2);
-  const int *n2oPtr(n2o->getConstPointer());
+  const int *n2oPtr(n2o->begin());
   MCAuto<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
   skin->getReverseNodalConnectivity(revNodal,revNodalI);
-  const int *revNodalPtr(revNodal->getConstPointer()),*revNodalIPtr(revNodalI->getConstPointer());
-  const int *nodalPtr(skin->getNodalConnectivity()->getConstPointer());
-  const int *nodalIPtr(skin->getNodalConnectivityIndex()->getConstPointer());
+  const int *revNodalPtr(revNodal->begin()),*revNodalIPtr(revNodalI->begin());
+  const int *nodalPtr(skin->getNodalConnectivity()->begin());
+  const int *nodalIPtr(skin->getNodalConnectivityIndex()->begin());
   MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
   int *work(ret->getPointer());  *work++=INTERP_KERNEL::NORM_QPOLYG;
   if(nbOfNodesExpected<1)
@@ -8759,8 +8973,8 @@ DataArrayInt *MEDCouplingUMesh::buildUnionOf3DMesh() const
   if(getMeshDimension()!=3 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildUnionOf3DMesh : meshdimension, spacedimension must be equal to 2 !");
   MCAuto<MEDCouplingUMesh> m=computeSkin();
-  const int *conn=m->getNodalConnectivity()->getConstPointer();
-  const int *connI=m->getNodalConnectivityIndex()->getConstPointer();
+  const int *conn=m->getNodalConnectivity()->begin();
+  const int *connI=m->getNodalConnectivityIndex()->begin();
   int nbOfCells=m->getNumberOfCells();
   MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(m->getNodalConnectivity()->getNumberOfTuples(),1);
   int *work=ret->getPointer();  *work++=INTERP_KERNEL::NORM_POLYHED;
@@ -8793,16 +9007,16 @@ MEDCouplingSkyLineArray *MEDCouplingUMesh::generateGraph() const
   MEDCoupling::DataArrayInt* indexr=MEDCoupling::DataArrayInt::New();
   MEDCoupling::DataArrayInt* revConn=MEDCoupling::DataArrayInt::New();
   this->getReverseNodalConnectivity(revConn,indexr);
-  const int* indexr_ptr=indexr->getConstPointer();
-  const int* revConn_ptr=revConn->getConstPointer();
+  const int* indexr_ptr=indexr->begin();
+  const int* revConn_ptr=revConn->begin();
 
   const MEDCoupling::DataArrayInt* index;
   const MEDCoupling::DataArrayInt* conn;
   conn=this->getNodalConnectivity(); // it includes a type as the 1st element!!!
   index=this->getNodalConnectivityIndex();
   int nbCells=this->getNumberOfCells();
-  const int* index_ptr=index->getConstPointer();
-  const int* conn_ptr=conn->getConstPointer();
+  const int* index_ptr=index->begin();
+  const int* conn_ptr=conn->begin();
 
   //creating graph arcs (cell to cell relations)
   //arcs are stored in terms of (index,value) notation
@@ -8878,7 +9092,6 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData
   int nbOfCells=getNumberOfCells();
   if(nbOfCells<=0)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::writeVTK : the unstructured mesh has no cells !");
-  static const int PARAMEDMEM2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,36,4};
   ofs << "  <" << getVTKDataSetType() << ">\n";
   ofs << "    <Piece NumberOfPoints=\"" << getNumberOfNodes() << "\" NumberOfCells=\"" << nbOfCells << "\">\n";
   ofs << "      <PointData>\n" << pointData << std::endl;
@@ -8895,8 +9108,8 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData
     }
   ofs << "      </Points>\n";
   ofs << "      <Cells>\n";
-  const int *cPtr=_nodal_connec->getConstPointer();
-  const int *cIPtr=_nodal_connec_index->getConstPointer();
+  const int *cPtr=_nodal_connec->begin();
+  const int *cIPtr=_nodal_connec_index->begin();
   MCAuto<DataArrayInt> faceoffsets=DataArrayInt::New(); faceoffsets->alloc(nbOfCells,1);
   MCAuto<DataArrayInt> types=DataArrayInt::New(); types->alloc(nbOfCells,1);
   MCAuto<DataArrayInt> offsets=DataArrayInt::New(); offsets->alloc(nbOfCells,1);
@@ -8921,7 +9134,7 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData
           w4=std::copy(c.begin(),c.end(),w4);
         }
     }
-  types->transformWithIndArr(PARAMEDMEM2VTKTYPETRADUCER,PARAMEDMEM2VTKTYPETRADUCER+INTERP_KERNEL::NORM_MAXTYPE+1);
+  types->transformWithIndArr(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+INTERP_KERNEL::NORM_MAXTYPE+1);
   types->writeVTK(ofs,8,"UInt8","types",byteData);
   offsets->writeVTK(ofs,8,"Int32","offsets",byteData);
   if(szFaceOffsets!=0)
@@ -9047,7 +9260,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::Intersect2DMeshes(const MEDCouplingUMesh *m1
   // Step 3:
   std::vector<int> cr,crI; //no DataArrayInt because interface with Geometric2D
   std::vector<int> cNb1,cNb2; //no DataArrayInt because interface with Geometric2D
-  BuildIntersecting2DCellsFromEdges(eps,m1,desc1->getConstPointer(),descIndx1->getConstPointer(),intersectEdge1,colinear2,m2,desc2->getConstPointer(),descIndx2->getConstPointer(),intersectEdge2,addCoo,
+  BuildIntersecting2DCellsFromEdges(eps,m1,desc1->begin(),descIndx1->begin(),intersectEdge1,colinear2,m2,desc2->begin(),descIndx2->begin(),intersectEdge2,addCoo,
                                     /* outputs -> */addCoordsQuadratic,cr,crI,cNb1,cNb2);
 
   // Step 4: Prepare final result:
@@ -9982,11 +10195,11 @@ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCo
                                                          std::vector<double>& addCoordsQuadratic, std::vector<int>& cr, std::vector<int>& crI, std::vector<int>& cNb1, std::vector<int>& cNb2)
 {
   static const int SPACEDIM=2;
-  const double *coo1(m1->getCoords()->getConstPointer());
-  const int *conn1(m1->getNodalConnectivity()->getConstPointer()),*connI1(m1->getNodalConnectivityIndex()->getConstPointer());
+  const double *coo1(m1->getCoords()->begin());
+  const int *conn1(m1->getNodalConnectivity()->begin()),*connI1(m1->getNodalConnectivityIndex()->begin());
   int offset1(m1->getNumberOfNodes());
-  const double *coo2(m2->getCoords()->getConstPointer());
-  const int *conn2(m2->getNodalConnectivity()->getConstPointer()),*connI2(m2->getNodalConnectivityIndex()->getConstPointer());
+  const double *coo2(m2->getCoords()->begin());
+  const int *conn2(m2->getNodalConnectivity()->begin()),*connI2(m2->getNodalConnectivityIndex()->begin());
   int offset2(offset1+m2->getNumberOfNodes());
   int offset3(offset2+((int)addCoords.size())/2);
   MCAuto<DataArrayDouble> bbox1Arr(m1->getBoundingBoxForBBTree()),bbox2Arr(m2->getBoundingBoxForBBTree());
@@ -10048,7 +10261,7 @@ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCo
           catch(INTERP_KERNEL::Exception& e)
           {
               std::ostringstream oss; oss << "Error when computing residual of cell #" << i << " in source/m1 mesh ! Maybe the neighbours of this cell in mesh are not well connected !\n" << "The deep reason is the following : " << e.what();
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
           }
         }
       for(std::map<int,INTERP_KERNEL::Node *>::const_iterator it=mappRev.begin();it!=mappRev.end();it++)
@@ -10078,10 +10291,10 @@ DataArrayInt *MEDCouplingUMesh::orderConsecutiveCells1D() const
   MCAuto<DataArrayInt> _d(DataArrayInt::New()),_dI(DataArrayInt::New());
   MCAuto<DataArrayInt> _rD(DataArrayInt::New()),_rDI(DataArrayInt::New());
   MCAuto<MEDCouplingUMesh> m_points(buildDescendingConnectivity(_d, _dI, _rD, _rDI));
-  const int *d(_d->getConstPointer()), *dI(_dI->getConstPointer());
-  const int *rD(_rD->getConstPointer()), *rDI(_rDI->getConstPointer());
+  const int *d(_d->begin()), *dI(_dI->begin());
+  const int *rD(_rD->begin()), *rDI(_rDI->begin());
   MCAuto<DataArrayInt> _dsi(_rDI->deltaShiftIndex());
-  const int * dsi(_dsi->getConstPointer());
+  const int * dsi(_dsi->begin());
   MCAuto<DataArrayInt> dsii = _dsi->findIdsNotInRange(0,3);
   m_points=0;
   if (dsii->getNumberOfTuples())
@@ -10241,7 +10454,7 @@ DataArrayInt *MEDCouplingUMesh::conformize2D(double eps)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::conformize2D : This method only works for meshes with spaceDim=2 and meshDim=2 !");
   MCAuto<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
   MCAuto<MEDCouplingUMesh> mDesc(buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));
-  const int *c(mDesc->getNodalConnectivity()->getConstPointer()),*ci(mDesc->getNodalConnectivityIndex()->getConstPointer()),*rd(revDesc1->getConstPointer()),*rdi(revDescIndx1->getConstPointer());
+  const int *c(mDesc->getNodalConnectivity()->begin()),*ci(mDesc->getNodalConnectivityIndex()->begin()),*rd(revDesc1->begin()),*rdi(revDescIndx1->begin());
   MCAuto<DataArrayDouble> bboxArr(mDesc->getBoundingBoxForBBTree());
   const double *bbox(bboxArr->begin()),*coords(getCoords()->begin());
   int nCell(getNumberOfCells()),nDescCell(mDesc->getNumberOfCells());
@@ -10420,7 +10633,7 @@ void MEDCouplingUMesh::Intersect1DMeshes(const MEDCouplingUMesh *m1Desc, const M
   static const int SPACEDIM=2;
   INTERP_KERNEL::QUADRATIC_PLANAR::_precision=eps;
   INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=eps;
-  const int *c1(m1Desc->getNodalConnectivity()->getConstPointer()),*ci1(m1Desc->getNodalConnectivityIndex()->getConstPointer());
+  const int *c1(m1Desc->getNodalConnectivity()->begin()),*ci1(m1Desc->getNodalConnectivityIndex()->begin());
   // Build BB tree of all edges in the tool mesh (second mesh)
   MCAuto<DataArrayDouble> bbox1Arr(m1Desc->getBoundingBoxForBBTree()),bbox2Arr(m2Desc->getBoundingBoxForBBTree());
   const double *bbox1(bbox1Arr->begin()),*bbox2(bbox2Arr->begin());
@@ -10514,10 +10727,10 @@ void MEDCouplingUMesh::BuildIntersectEdges(const MEDCouplingUMesh *m1, const MED
 {
   int offset1=m1->getNumberOfNodes();
   int ncell=m2->getNumberOfCells();
-  const int *c=m2->getNodalConnectivity()->getConstPointer();
-  const int *cI=m2->getNodalConnectivityIndex()->getConstPointer();
-  const double *coo=m2->getCoords()->getConstPointer();
-  const double *cooBis=m1->getCoords()->getConstPointer();
+  const int *c=m2->getNodalConnectivity()->begin();
+  const int *cI=m2->getNodalConnectivityIndex()->begin();
+  const double *coo=m2->getCoords()->begin();
+  const double *cooBis=m1->getCoords()->begin();
   int offset2=offset1+m2->getNumberOfNodes();
   intersectEdge.resize(ncell);
   for(int i=0;i<ncell;i++,cI++)
@@ -10650,9 +10863,8 @@ void MEDCouplingUMesh::assemblyForSplitFrom3DSurf(const std::vector< std::pair<i
   checkFullyDefined();
   if(getMeshDimension()!=3 || getSpaceDimension()!=3)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::assemblyForSplitFrom3DSurf works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
-  const int *nodal3D=_nodal_connec->getConstPointer();
-  const int *nodalIndx3D=_nodal_connec_index->getConstPointer();
-  int nbOfCells=getNumberOfCells();
+  const int *nodal3D(_nodal_connec->begin()),*nodalIndx3D(_nodal_connec_index->begin());
+  int nbOfCells(getNumberOfCells());
   for(int i=0;i<nbOfCells;i++)
     {
       std::map<int, std::set<int> > m;
@@ -10718,6 +10930,100 @@ void MEDCouplingUMesh::assemblyForSplitFrom3DSurf(const std::vector< std::pair<i
     }
 }
 
+void InsertNodeInConnIfNecessary(int nodeIdToInsert, std::vector<int>& conn, const double *coords, double eps)
+{
+  std::vector<int>::iterator it(std::find(conn.begin(),conn.end(),nodeIdToInsert));
+  if(it!=conn.end())
+    return ;
+  std::size_t sz(conn.size());
+  std::size_t found(std::numeric_limits<std::size_t>::max());
+  for(std::size_t i=0;i<sz;i++)
+    {
+      int pt0(conn[i]),pt1(conn[(i+1)%sz]);
+      double v1[3]={coords[3*pt1+0]-coords[3*pt0+0],coords[3*pt1+1]-coords[3*pt0+1],coords[3*pt1+2]-coords[3*pt0+2]},v2[3]={coords[3*nodeIdToInsert+0]-coords[3*pt0+0],coords[3*nodeIdToInsert+1]-coords[3*pt0+1],coords[3*nodeIdToInsert+2]-coords[3*pt0+2]};
+      double normm(sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]));
+      std::transform(v1,v1+3,v1,std::bind2nd(std::multiplies<double>(),1./normm));
+      std::transform(v2,v2+3,v2,std::bind2nd(std::multiplies<double>(),1./normm));
+      double v3[3];
+      v3[0]=v1[1]*v2[2]-v1[2]*v2[1]; v3[1]=v1[2]*v2[0]-v1[0]*v2[2]; v3[2]=v1[0]*v2[1]-v1[1]*v2[0];
+      double normm2(sqrt(v3[0]*v3[0]+v3[1]*v3[1]+v3[2]*v3[2])),dotTest(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]);
+      if(normm2<eps)
+        if(dotTest>eps && dotTest<1.-eps)
+          {
+            found=i;
+            break;
+          }
+    }
+  if(found==std::numeric_limits<std::size_t>::max())
+    throw INTERP_KERNEL::Exception("InsertNodeInConnIfNecessary : not found point !");
+  conn.insert(conn.begin()+(found+1)%sz,nodeIdToInsert);
+}
+
+void SplitIntoToPart(const std::vector<int>& conn, int pt0, int pt1, std::vector<int>& part0, std::vector<int>& part1)
+{
+  std::size_t sz(conn.size());
+  std::vector<int> *curPart(&part0);
+  for(std::size_t i=0;i<sz;i++)
+    {
+      int nextt(conn[(i+1)%sz]);
+      (*curPart).push_back(nextt);
+      if(nextt==pt0 || nextt==pt1)
+        {
+          if(curPart==&part0)
+            curPart=&part1;
+          else
+            curPart=&part0;
+          (*curPart).push_back(nextt);
+        }
+    }
+}
+
+/*!
+ * this method method splits cur cells 3D Surf in sub cells 3DSurf using the previous subsplit. This method is the last one used to clip.
+ */
+void MEDCouplingUMesh::buildSubCellsFromCut(const std::vector< std::pair<int,int> >& cut3DSurf,
+                                            const int *desc, const int *descIndx, const double *coords, double eps,
+                                            std::vector<std::vector<int> >& res) const
+{
+  checkFullyDefined();
+  if(getMeshDimension()!=3 || getSpaceDimension()!=3)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSubCellsFromCut works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
+  const int *nodal3D(_nodal_connec->begin()),*nodalIndx3D(_nodal_connec_index->begin());
+  int nbOfCells(getNumberOfCells());
+  if(nbOfCells!=1)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSubCellsFromCut works only with single cell presently !");
+  for(int i=0;i<nbOfCells;i++)
+    {
+      int offset(descIndx[i]),nbOfFaces(descIndx[i+1]-offset),start(-1),end(-1);
+      for(int j=0;j<nbOfFaces;j++)
+        {
+          const std::pair<int,int>& p=cut3DSurf[desc[offset+j]];
+          const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)nodal3D[nodalIndx3D[i]]));
+          int sz=nodalIndx3D[i+1]-nodalIndx3D[i]-1;
+          INTERP_KERNEL::AutoPtr<int> tmp(new int[sz]);
+          INTERP_KERNEL::NormalizedCellType cmsId;
+          unsigned nbOfNodesSon(cm.fillSonCellNodalConnectivity2(j,nodal3D+nodalIndx3D[i]+1,sz,tmp,cmsId));
+          std::vector<int> elt((int *)tmp,(int *)tmp+nbOfNodesSon);
+          if(p.first!=-1 && p.second!=-1)
+            {
+              if(p.first!=-2)
+                {
+                  InsertNodeInConnIfNecessary(p.first,elt,coords,eps);
+                  InsertNodeInConnIfNecessary(p.second,elt,coords,eps);
+                  std::vector<int> elt1,elt2;
+                  SplitIntoToPart(elt,p.first,p.second,elt1,elt2);
+                  res.push_back(elt1);
+                  res.push_back(elt2);
+                }
+              else
+                res.push_back(elt);
+            }
+          else
+            res.push_back(elt);
+        }
+    }
+}
+
 /*!
  * This method compute the convex hull of a single 2D cell. This method tries to conserve at maximum the given input connectivity. In particular, if the orientation of cell is not clockwise
  * as in MED format norm. If definitely the result of Jarvis algorithm is not matchable with the input connectivity, the result will be copied into \b nodalConnecOut parameter and
@@ -10837,7 +11143,7 @@ bool MEDCouplingUMesh::RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, cons
   int *arrIPtr=arrIndx->getPointer();
   *arrIPtr++=0;
   int previousArrI=0;
-  const int *arrPtr=arr->getConstPointer();
+  const int *arrPtr=arr->begin();
   std::vector<int> arrOut;//no utility to switch to DataArrayInt because copy always needed
   for(int i=0;i<nbOfGrps;i++,arrIPtr++)
     {
@@ -10883,8 +11189,8 @@ void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const
   if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : input arrays must have exactly one component !");
   std::size_t sz=std::distance(idsOfSelectBg,idsOfSelectEnd);
-  const int *arrInPtr=arrIn->getConstPointer();
-  const int *arrIndxPtr=arrIndxIn->getConstPointer();
+  const int *arrInPtr=arrIn->begin();
+  const int *arrIndxPtr=arrIndxIn->begin();
   int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
   if(nbOfGrps<0)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
@@ -10903,7 +11209,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " ! Must be in [0," << nbOfGrps << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
       if(lgth>=work[-1])
         *work=lgth;
@@ -10911,7 +11217,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " and at this pos arrIndxIn[" << *idsIt;
           oss << "+1]-arrIndxIn[" << *idsIt << "] < 0 ! The input index array is bugged !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   arro->alloc(lgth,1);
@@ -10925,7 +11231,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " arrIndx[" << *idsIt << "] must be >= 0 and arrIndx[";
           oss << *idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   arrOut=arro.retn();
@@ -10957,8 +11263,8 @@ void MEDCouplingUMesh::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int i
   if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : input arrays must have exactly one component !");
   int sz=DataArrayInt::GetNumberOfItemGivenBESRelative(idsOfSelectStart,idsOfSelectStop,idsOfSelectStep,"MEDCouplingUMesh::ExtractFromIndexedArraysSlice : Input slice ");
-  const int *arrInPtr=arrIn->getConstPointer();
-  const int *arrIndxPtr=arrIndxIn->getConstPointer();
+  const int *arrInPtr=arrIn->begin();
+  const int *arrIndxPtr=arrIndxIn->begin();
   int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
   if(nbOfGrps<0)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
@@ -10977,7 +11283,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int i
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " ! Must be in [0," << nbOfGrps << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
       if(lgth>=work[-1])
         *work=lgth;
@@ -10985,7 +11291,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int i
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " and at this pos arrIndxIn[" << idsIt;
           oss << "+1]-arrIndxIn[" << idsIt << "] < 0 ! The input index array is bugged !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   arro->alloc(lgth,1);
@@ -10999,7 +11305,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int i
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " arrIndx[" << idsIt << "] must be >= 0 and arrIndx[";
           oss << idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
   arrOut=arro.retn();
@@ -11034,8 +11340,8 @@ void MEDCouplingUMesh::SetPartOfIndexedArrays(const int *idsOfSelectBg, const in
   int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
   std::vector<bool> v(nbOfTuples,true);
   int offset=0;
-  const int *arrIndxInPtr=arrIndxIn->getConstPointer();
-  const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+  const int *arrIndxInPtr=arrIndxIn->begin();
+  const int *srcArrIndexPtr=srcArrIndex->begin();
   for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
     {
       if(*it>=0 && *it<nbOfTuples)
@@ -11046,14 +11352,14 @@ void MEDCouplingUMesh::SetPartOfIndexedArrays(const int *idsOfSelectBg, const in
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArrays : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
-  srcArrIndexPtr=srcArrIndex->getConstPointer();
+  srcArrIndexPtr=srcArrIndex->begin();
   arrIo->alloc(nbOfTuples+1,1);
   arro->alloc(arrIn->getNumberOfTuples()+offset,1);
-  const int *arrInPtr=arrIn->getConstPointer();
-  const int *srcArrPtr=srcArr->getConstPointer();
+  const int *arrInPtr=arrIn->begin();
+  const int *srcArrPtr=srcArr->begin();
   int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
   int *arroPtr=arro->getPointer();
   for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
@@ -11093,10 +11399,10 @@ void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, c
   if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : presence of null pointer in input parameter !");
   int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
-  const int *arrIndxInPtr=arrIndxIn->getConstPointer();
-  const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+  const int *arrIndxInPtr=arrIndxIn->begin();
+  const int *srcArrIndexPtr=srcArrIndex->begin();
   int *arrInOutPtr=arrInOut->getPointer();
-  const int *srcArrPtr=srcArr->getConstPointer();
+  const int *srcArrPtr=srcArr->begin();
   for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
     {
       if(*it>=0 && *it<nbOfTuples)
@@ -11106,13 +11412,13 @@ void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, c
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " id (idsOfSelectBg[" << std::distance(idsOfSelectBg,it)<< "]) is " << *it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
 }
@@ -11181,10 +11487,10 @@ DataArrayInt *MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeedAlg(std::vecto
       if(*seedElt>=0 && *seedElt<nbOfTuples)
         { fetched[*seedElt]=true; fetched2[*seedElt]=true; }
       else
-        { std::ostringstream oss; oss << "MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeedAlg : At pos #" << i << " of seeds value is " << *seedElt << "! Should be in [0," << nbOfTuples << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+        { std::ostringstream oss; oss << "MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeedAlg : At pos #" << i << " of seeds value is " << *seedElt << "! Should be in [0," << nbOfTuples << ") !"; throw INTERP_KERNEL::Exception(oss.str()); }
     }
-  const int *arrInPtr=arrIn->getConstPointer();
-  const int *arrIndxPtr=arrIndxIn->getConstPointer();
+  const int *arrInPtr=arrIn->begin();
+  const int *arrIndxPtr=arrIndxIn->begin();
   int targetNbOfDepthPeeling=nbOfDepthPeeling!=-1?nbOfDepthPeeling:std::numeric_limits<int>::max();
   std::vector<int> idsToFetch1(seedBg,seedEnd);
   std::vector<int> idsToFetch2;
@@ -11238,8 +11544,8 @@ void MEDCouplingUMesh::SetPartOfIndexedArraysSlice(int start, int end, int step,
   MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
   int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
   int offset=0;
-  const int *arrIndxInPtr=arrIndxIn->getConstPointer();
-  const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+  const int *arrIndxInPtr=arrIndxIn->begin();
+  const int *srcArrIndexPtr=srcArrIndex->begin();
   int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSlice : ");
   int it=start;
   for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
@@ -11249,14 +11555,14 @@ void MEDCouplingUMesh::SetPartOfIndexedArraysSlice(int start, int end, int step,
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
-  srcArrIndexPtr=srcArrIndex->getConstPointer();
+  srcArrIndexPtr=srcArrIndex->begin();
   arrIo->alloc(nbOfTuples+1,1);
   arro->alloc(arrIn->getNumberOfTuples()+offset,1);
-  const int *arrInPtr=arrIn->getConstPointer();
-  const int *srcArrPtr=srcArr->getConstPointer();
+  const int *arrInPtr=arrIn->begin();
+  const int *srcArrPtr=srcArr->begin();
   int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
   int *arroPtr=arro->getPointer();
   for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
@@ -11297,10 +11603,10 @@ void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(int start, int end, in
   if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : presence of null pointer in input parameter !");
   int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
-  const int *arrIndxInPtr=arrIndxIn->getConstPointer();
-  const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
+  const int *arrIndxInPtr=arrIndxIn->begin();
+  const int *srcArrIndexPtr=srcArrIndex->begin();
   int *arrInOutPtr=arrInOut->getPointer();
-  const int *srcArrPtr=srcArr->getConstPointer();
+  const int *srcArrPtr=srcArr->begin();
   int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : ");
   int it=start;
   for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
@@ -11312,13 +11618,13 @@ void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(int start, int end, in
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " id (idsOfSelectBg[" << i << "]) is " << it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
-              throw INTERP_KERNEL::Exception(oss.str().c_str());
+              throw INTERP_KERNEL::Exception(oss.str());
             }
         }
       else
         {
           std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
+          throw INTERP_KERNEL::Exception(oss.str());
         }
     }
 }
@@ -11362,7 +11668,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSpreadZonesWithPoly() const
           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSpreadZonesWithPoly : meshdimension supported are [2,3] ! Not implemented yet for others !");
       }
 
-      ret->insertNextCell((INTERP_KERNEL::NormalizedCellType)cell->getIJSafe(0,0),cell->getNumberOfTuples()-1,cell->getConstPointer()+1);
+      ret->insertNextCell((INTERP_KERNEL::NormalizedCellType)cell->getIJSafe(0,0),cell->getNumberOfTuples()-1,cell->begin()+1);
     }
   //
   ret->finishInsertingCells();
@@ -11376,20 +11682,31 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSpreadZonesWithPoly() const
  */
 std::vector<DataArrayInt *> MEDCouplingUMesh::partitionBySpreadZone() const
 {
-  int nbOfCellsCur=getNumberOfCells();
-  std::vector<DataArrayInt *> ret;
-  if(nbOfCellsCur<=0)
-    return ret;
   DataArrayInt *neigh=0,*neighI=0;
   computeNeighborsOfCells(neigh,neighI);
   MCAuto<DataArrayInt> neighAuto(neigh),neighIAuto(neighI);
+  return PartitionBySpreadZone(neighAuto,neighIAuto);
+}
+
+std::vector<DataArrayInt *> MEDCouplingUMesh::PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
+{
+  if(!arrIn || !arrIndxIn)
+    throw INTERP_KERNEL::Exception("PartitionBySpreadZone : null input pointers !");
+  arrIn->checkAllocated(); arrIndxIn->checkAllocated();
+  int nbOfTuples(arrIndxIn->getNumberOfTuples());
+  if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1 || nbOfTuples<1)
+    throw INTERP_KERNEL::Exception("PartitionBySpreadZone : invalid arrays in input !");
+  int nbOfCellsCur(nbOfTuples-1);
+  std::vector<DataArrayInt *> ret;
+  if(nbOfCellsCur<=0)
+    return ret;
   std::vector<bool> fetchedCells(nbOfCellsCur,false);
   std::vector< MCAuto<DataArrayInt> > ret2;
   int seed=0;
   while(seed<nbOfCellsCur)
     {
       int nbOfPeelPerformed=0;
-      ret2.push_back(ComputeSpreadZoneGraduallyFromSeedAlg(fetchedCells,&seed,&seed+1,neigh,neighI,-1,nbOfPeelPerformed));
+      ret2.push_back(ComputeSpreadZoneGraduallyFromSeedAlg(fetchedCells,&seed,&seed+1,arrIn,arrIndxIn,-1,nbOfPeelPerformed));
       seed=(int)std::distance(fetchedCells.begin(),std::find(fetchedCells.begin()+seed,fetchedCells.end(),false));
     }
   for(std::vector< MCAuto<DataArrayInt> >::iterator it=ret2.begin();it!=ret2.end();it++)
@@ -11769,7 +12086,7 @@ void MEDCouplingUMesh::ComputeAllTypesInternal(std::set<INTERP_KERNEL::Normalize
   if(nodalConnec && nodalConnecIndex)
     {
       types.clear();
-      const int *conn(nodalConnec->getConstPointer()),*connIndex(nodalConnecIndex->getConstPointer());
+      const int *conn(nodalConnec->begin()),*connIndex(nodalConnecIndex->begin());
       int nbOfElem(nodalConnecIndex->getNbOfElems()-1);
       if(nbOfElem>0)
         for(const int *pt=connIndex;pt!=connIndex+nbOfElem;pt++)
@@ -11879,8 +12196,8 @@ MEDCouplingUMeshCellByTypeIterator::~MEDCouplingUMeshCellByTypeIterator()
 
 MEDCouplingUMeshCellEntry *MEDCouplingUMeshCellByTypeIterator::nextt()
 {
-  const int *c=_mesh->getNodalConnectivity()->getConstPointer();
-  const int *ci=_mesh->getNodalConnectivityIndex()->getConstPointer();
+  const int *c=_mesh->getNodalConnectivity()->begin();
+  const int *ci=_mesh->getNodalConnectivityIndex()->begin();
   if(_cell_id<_nb_cell)
     {
       INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)c[ci[_cell_id]];