Salome HOME
activate paramedmem test with "salome test" mechanism
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingDataArrayTypemaps.i
index 8f596420d4ec9165d220cc30667be8469c85961e..8fb267b853eec982b85aa780ed12e3d0de064213 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020  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
 
 #include "InterpKernelAutoPtr.hxx"
 #include "MEDCouplingDataArrayTraits.hxx"
+#include "MCType.hxx"
 
 #include <sstream>
 
+using namespace MEDCoupling;
+
+template<class T>
+struct SWIGTITraits
+{ };
+
+template<>
+struct SWIGTITraits<double>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+template<>
+struct SWIGTITraits<float>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+template<>
+struct SWIGTITraits<Int32>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+template<>
+struct SWIGTITraits<Int64>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+swig_type_info *SWIGTITraits<double>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<float>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int32>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt32 is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int64>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt64 is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<double>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<float>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int32>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt32 is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int64>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt64 is null when called here ! Postpone initialization at inlined initializeMe()
+
 static PyObject *convertArray(MEDCoupling::DataArray *array, int owner)
 {
   PyObject *ret(NULL);
@@ -40,8 +72,10 @@ static PyObject *convertArray(MEDCoupling::DataArray *array, int owner)
     }
   if(dynamic_cast<MEDCoupling::DataArrayDouble *>(array))
     ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayDouble,owner);
-  if(dynamic_cast<MEDCoupling::DataArrayInt *>(array))
-    ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayInt,owner);
+  if(dynamic_cast<MEDCoupling::DataArrayInt32 *>(array))
+    ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayInt32,owner);
+  if(dynamic_cast<MEDCoupling::DataArrayInt64 *>(array))
+    ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayInt64,owner);
   if(dynamic_cast<MEDCoupling::DataArrayFloat *>(array))
     ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayFloat,owner);
   if(!ret)
@@ -50,7 +84,7 @@ static PyObject *convertArray(MEDCoupling::DataArray *array, int owner)
 }
 
 /*!
- * This method is an extention of PySlice_GetIndices but less
+ * This method is an extension of PySlice_GetIndices but less
  * open than PySlice_GetIndicesEx that accepts too many situations.
  */
 void GetIndicesOfSlice(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
@@ -92,11 +126,11 @@ void GetIndicesOfSliceExplicitely(PyObject *slice, Py_ssize_t *start, Py_ssize_t
   throw INTERP_KERNEL::Exception(msgInCaseOfFailure);
 }
 
-int InterpreteNegativeInt(int val, int nbelem)
+int InterpreteNegativeInt(long val, mcIdType nbelem)
 {
   if(val<0)
     {
-      int newVal(nbelem+val);
+      int newVal((int)(nbelem+val));
       if(newVal<0)
         {
           std::ostringstream oss; oss << "interpreteNegativeInt : request for negative int=" << val << " but number of elems is equal to " << nbelem << " !";
@@ -105,7 +139,7 @@ int InterpreteNegativeInt(int val, int nbelem)
       return newVal;
     }
   else
-    return val;
+    return (int)val;
 }
 
 #ifdef WITH_NUMPY
@@ -133,6 +167,9 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype
   if(PyArray_DESCR(elt0)->type_num != npyObjectType)
     {
       std::ostringstream oss; oss << "Input numpy array has not the type " << msg << "!";
+#ifdef _DEBUG_
+      oss << " type_num == " << PyArray_DESCR(elt0)->type_num;
+#endif
       throw INTERP_KERNEL::Exception(oss.str().c_str());
     }
   npy_intp sz0=PyArray_DIM(elt0,0);
@@ -182,7 +219,7 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype
           std::size_t nbOfElems(sz0*sz1);
           T *dataCpy=(T*)malloc(sizeof(T)*nbOfElems);
           std::copy(reinterpret_cast<const T*>(data),reinterpret_cast<const T*>(data)+nbOfElems,dataCpy);
-          ret->useArray(dataCpy,true,MEDCoupling::C_DEALLOC,sz0,sz1);
+          ret->useArray(dataCpy,true,MEDCoupling::DeallocType::C_DEALLOC,sz0,sz1);
           return ret.retn();
         }
       typename MEDCoupling::MemArray<T>& mma=ret->accessToMemArray();
@@ -190,26 +227,32 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype
         {
           PyCallBackDataArraySt<MCData> *cb=PyObject_GC_New(PyCallBackDataArraySt<MCData>,pytype);
           cb->_pt_mc=ret;
-          ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::C_DEALLOC,sz0,sz1);
+          ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::DeallocType::C_DEALLOC,sz0,sz1);
           PyObject *ref=PyWeakref_NewRef(deepestObj,(PyObject *)cb);
           void **objs=new void *[2]; objs[0]=cb; objs[1]=ref;
           mma.setParameterForDeallocator(objs);
           mma.setSpecificDeallocator(numarrdeal2<MCData>);
-          //"Impossible to share this numpy array chunk of data, because already shared by an another non numpy array object (maybe an another DataArrayInt instance) ! Release it, or perform a copy on the input array !");
+          //"Impossible to share this numpy array chunk of data, because already shared by an another non numpy array object (maybe an another DataArrayIdType instance) ! Release it, or perform a copy on the input array !");
         }
       else
         {
-          ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::C_DEALLOC,sz0,sz1);
+          ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::DeallocType::C_DEALLOC_WITH_OFFSET,sz0,sz1);
           PyObject *ref=PyWeakref_NewRef(reinterpret_cast<PyObject *>(eltOwning),NULL);
-          typename MEDCoupling::MemArray<T>::Deallocator tmp(MEDCoupling::MemArray<T>::CDeallocator);
+          typename MEDCoupling::MemArray<T>::Deallocator tmp(MEDCoupling::MemArray<T>::COffsetDeallocator);
           void **tmp2 = reinterpret_cast<void**>(&tmp); // MSVC2010 does not support constructor()
-          void **objs=new void *[2]; objs[0]=ref; objs[1]=*tmp2;
+          const char *dataEltOwning(PyArray_BYTES(eltOwning));//In case of input array is a sub array of a 2D,3D... array there is an offset
+          int64_t offset(0);
+          if(data!=dataEltOwning)
+            {
+              offset=data>dataEltOwning?-((int64_t)(std::distance(dataEltOwning,data))):(int64_t)std::distance(data,dataEltOwning);
+            }
+          void **objs=new void *[3]; objs[0]=ref; objs[1]=*tmp2; objs[2]=new int64_t(offset);
           mma.setParameterForDeallocator(objs);
           mma.setSpecificDeallocator(numarrdeal);
         }
     }
   else if(PyArray_ISBEHAVED_RO(elt0))
-    ret->useArray(reinterpret_cast<const T *>(data),false,MEDCoupling::CPP_DEALLOC,sz0,sz1);
+    ret->useArray(reinterpret_cast<const T *>(data),false,MEDCoupling::DeallocType::CPP_DEALLOC,sz0,sz1);
   return ret.retn();
 }
 
@@ -236,27 +279,27 @@ int NumpyArrSetBaseObjectExt(PyArrayObject *arr, PyObject *obj)
 
     /*
      * Don't allow infinite chains of views, always set the base
-     * to the first owner of the data.  
-     * That is, either the first object which isn't an array, 
+     * to the first owner of the data.
+     * That is, either the first object which isn't an array,
      * or the first object which owns its own data.
      */
 
     while (PyArray_Check(obj) && (PyObject *)arr != obj) {
         PyArrayObject *obj_arr = (PyArrayObject *)obj;
         PyObject *tmp;
+
 
         /* If this array owns its own data, stop collapsing */
-        if (PyArray_CHKFLAGS(obj_arr, MED_NUMPY_OWNDATA )) { 
+        if (PyArray_CHKFLAGS(obj_arr, MED_NUMPY_OWNDATA )) {
             break;
-        }   
+        }
 
         tmp = PyArray_BASE(obj_arr);
         /* If there's no base, stop collapsing */
         if (tmp == NULL) {
             break;
         }
-        /* Stop the collapse new base when the would not be of the same 
+        /* Stop the collapse new base when the would not be of the same
          * type (i.e. different subclass).
          */
         if (Py_TYPE(tmp) != Py_TYPE(arr)) {
@@ -283,7 +326,7 @@ int NumpyArrSetBaseObjectExt(PyArrayObject *arr, PyObject *obj)
 }
 
 template<class MCData, class T>
-PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *MCDataStr, int nbTuples, int nbComp)
+PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *MCDataStr, mcIdType nbTuples, std::size_t nbComp)
 {
   if(!self->isAllocated())
     {
@@ -293,12 +336,12 @@ PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *M
   MEDCoupling::MemArray<T>& mem=self->accessToMemArray();
   if(nbComp==0)
     {
-      std::ostringstream oss; oss << MCDataStr << "::toNumPyArray : number of components of this is 0 ! Should be > 0 !"; 
+      std::ostringstream oss; oss << MCDataStr << "::toNumPyArray : number of components of this is 0 ! Should be > 0 !";
       throw INTERP_KERNEL::Exception(oss.str().c_str());
     }
   int nbDims=nbComp==1?1:2;
   npy_intp dim[2];
-  dim[0]=(npy_intp)nbTuples; dim[1]=nbComp;
+  dim[0]=(npy_intp)nbTuples; dim[1]=(npy_intp)nbComp;
   const T *bg=self->getConstPointer();
   PyObject *ret(PyArray_SimpleNewFromData(nbDims,dim,npyObjectType,const_cast<T *>(bg)));
   if(mem.isDeallocatorCalled())
@@ -308,7 +351,7 @@ PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *M
           PyObject *ref(PyWeakref_NewRef(ret,NULL));
           typename MEDCoupling::MemArray<T>::Deallocator tmp(mem.getDeallocator());
           void **tmp2 = reinterpret_cast<void**>(&tmp); // MSVC2010 does not support constructor()
-          void **objs=new void *[2]; objs[0]=reinterpret_cast<void*>(ref); objs[1]=*tmp2;
+          void **objs=new void *[3]; objs[0]=reinterpret_cast<void*>(ref); objs[1]=*tmp2; objs[2]=new int64_t(0);
           mem.setParameterForDeallocator(objs);
           mem.setSpecificDeallocator(numarrdeal);
           return ret;
@@ -340,35 +383,40 @@ PyObject *ToNumPyArray(MCData *self, int npyObjectType, const char *MCDataStr)
   return ToNumPyArrayUnderground<MCData,T>(self,npyObjectType,MCDataStr,self->getNumberOfTuples(),self->getNumberOfComponents());
 }
 
-SWIGINTERN PyObject *MEDCoupling_DataArrayInt_toNumPyArray(MEDCoupling::DataArrayInt *self);
+SWIGINTERN PyObject *MEDCoupling_DataArrayInt32_toNumPyArray(MEDCoupling::DataArrayInt32 *self);
+SWIGINTERN PyObject *MEDCoupling_DataArrayInt64_toNumPyArray(MEDCoupling::DataArrayInt64 *self);
 SWIGINTERN PyObject *MEDCoupling_DataArrayDouble_toNumPyArray(MEDCoupling::DataArrayDouble *self);
 
 #endif
 
 #ifdef WITH_SCIPY
-PyObject *ToCSRMatrix(const std::vector<std::map<int,double> >& m, int nbCols)
+PyObject *ToCSRMatrix(const std::vector<std::map<mcIdType,double> >& m, mcIdType nbCols)
 {
-  int nbRows((int)m.size());
-  MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> indPtr(MEDCoupling::DataArrayInt::New()),indices(MEDCoupling::DataArrayInt::New());
+  mcIdType nbRows((mcIdType)m.size());
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType> indPtr(MEDCoupling::DataArrayIdType::New()),indices(MEDCoupling::DataArrayIdType::New());
   MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> data(MEDCoupling::DataArrayDouble::New());
   indPtr->alloc(nbRows+1,1);
-  int *intPtr_ptr(indPtr->getPointer()); intPtr_ptr[0]=0; intPtr_ptr++;
-  int sz2(0);
-  for(std::vector<std::map<int,double> >::const_iterator it0=m.begin();it0!=m.end();it0++,intPtr_ptr++)
+  mcIdType *intPtr_ptr(indPtr->getPointer()); intPtr_ptr[0]=0; intPtr_ptr++;
+  mcIdType sz2(0);
+  for(std::vector<std::map<mcIdType,double> >::const_iterator it0=m.begin();it0!=m.end();it0++,intPtr_ptr++)
     {
-      sz2+=(int)(*it0).size();
+      sz2+=(mcIdType)(*it0).size();
       *intPtr_ptr=sz2;
     }
   indices->alloc(sz2,1); data->alloc(sz2,1);
-  int *indices_ptr(indices->getPointer());
+  mcIdType *indices_ptr(indices->getPointer());
   double *data_ptr(data->getPointer());
-  for(std::vector<std::map<int,double> >::const_iterator it0=m.begin();it0!=m.end();it0++)
-    for(std::map<int,double>::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++,indices_ptr++,data_ptr++)
+  for(std::vector<std::map<mcIdType,double> >::const_iterator it0=m.begin();it0!=m.end();it0++)
+    for(std::map<mcIdType,double>::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++,indices_ptr++,data_ptr++)
       {
         *indices_ptr=(*it1).first;
         *data_ptr=(*it1).second;
       }
-  PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt_toNumPyArray(indPtr));
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+  PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt32_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt32_toNumPyArray(indPtr));
+#else
+  PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt64_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt64_toNumPyArray(indPtr));
+#endif
   //
   PyObject *args(PyTuple_New(1)),*args0(PyTuple_New(3)),*kw(PyDict_New()),*kw1(PyTuple_New(2));
   PyTuple_SetItem(args0,0,a); PyTuple_SetItem(args0,1,b); PyTuple_SetItem(args0,2,c); PyTuple_SetItem(args,0,args0);
@@ -417,8 +465,10 @@ static PyObject *convertDataArray(MEDCoupling::DataArray *dac, int owner)
     }
   if(dynamic_cast<MEDCoupling::DataArrayDouble *>(dac))
     ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayDouble,owner);
-  if(dynamic_cast<MEDCoupling::DataArrayInt *>(dac))
-    ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt,owner);
+  if(dynamic_cast<MEDCoupling::DataArrayInt32 *>(dac))
+    ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt32,owner);
+  if(dynamic_cast<MEDCoupling::DataArrayInt64 *>(dac))
+    ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt64,owner);
   if(dynamic_cast<MEDCoupling::DataArrayFloat *>(dac))
     ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayFloat,owner);
   if(dynamic_cast<MEDCoupling::DataArrayByte *>(dac))
@@ -430,29 +480,32 @@ static PyObject *convertDataArray(MEDCoupling::DataArray *dac, int owner)
   return ret;
 }
 
-static PyObject *convertIntArrToPyList(const int *ptr, int size)
+template<class T>
+static PyObject *convertIntArrToPyList(const T *ptr, mcIdType size)
 {
   PyObject *ret=PyList_New(size);
-  for(int i=0;i<size;i++)
+  for(T i=0;i<size;i++)
     PyList_SetItem(ret,i,PyInt_FromLong(ptr[i]));
   return ret;
 }
 
-static PyObject *convertIntArrToPyList2(const std::vector<int>& v)
+template<class T>
+static PyObject *convertIntArrToPyList2(const std::vector<T>& v)
 {
-  int size=v.size();
+  std::size_t size=v.size();
   PyObject *ret=PyList_New(size);
-  for(int i=0;i<size;i++)
+  for(std::size_t i=0;i<size;i++)
     PyList_SetItem(ret,i,PyInt_FromLong(v[i]));
   return ret;
 }
 
-static PyObject *convertIntArrToPyList3(const std::set<int>& v)
+template<class T>
+static PyObject *convertIntArrToPyList3(const std::set<T>& v)
 {
-  int size=v.size();
+  std::size_t size=v.size();
   PyObject *ret=PyList_New(size);
-  std::set<int>::const_iterator it=v.begin();
-  for(int i=0;i<size;i++,it++)
+  typename std::set<T>::const_iterator it=v.begin();
+  for(std::size_t i=0;i<size;i++,it++)
     PyList_SetItem(ret,i,PyInt_FromLong(*it));
   return ret;
 }
@@ -489,37 +542,39 @@ static std::string convertPyObjectToStr(PyObject *obj, const char *msg=NULL)
       if(msg)
         oss << msg;
       else
-        oss << "PyWrap convertPyObjectToStr : expect a sting like py object !";
+        oss << "PyWrap convertPyObjectToStr : expect a string like py object !";
       throw INTERP_KERNEL::Exception(oss.str());
     }
   return ret;
 }
 
-static PyObject *convertIntArrToPyListOfTuple(const int *vals, int nbOfComp, int nbOfTuples)
+template<class T>
+static PyObject *convertIntArrToPyListOfTuple(const T *vals, mcIdType nbOfComp, mcIdType nbOfTuples)
 {
   PyObject *ret=PyList_New(nbOfTuples);
-  for(int i=0;i<nbOfTuples;i++)
+  for(T i=0;i<nbOfTuples;i++)
     {
       PyObject *t=PyTuple_New(nbOfComp);
-      for(int j=0;j<nbOfComp;j++)
+      for(T j=0;j<nbOfComp;j++)
         PyTuple_SetItem(t,j,PyInt_FromLong(vals[i*nbOfComp+j]));
       PyList_SetItem(ret,i,t);
     }
   return ret;
 }
 
-static int *convertPyToNewIntArr2(PyObject *pyLi, int *size)
+template< class T = mcIdType >
+static T *convertPyToNewIntArr2(PyObject *pyLi, mcIdType *size)
 {
   if(PyList_Check(pyLi))
     {
-      *size=PyList_Size(pyLi);
-      int *tmp=new int[*size];
-      for(int i=0;i<*size;i++)
+      *size=ToIdType(PyList_Size(pyLi));
+      T *tmp=new T[*size];
+      for(mcIdType i=0;i<*size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              T val=(T)PyInt_AS_LONG(o);
               tmp[i]=val;
             }
           else
@@ -532,14 +587,14 @@ static int *convertPyToNewIntArr2(PyObject *pyLi, int *size)
     }
   else if(PyTuple_Check(pyLi))
     {
-      *size=PyTuple_Size(pyLi);
-      int *tmp=new int[*size];
-      for(int i=0;i<*size;i++)
+      *size=ToIdType(PyTuple_Size(pyLi));
+      T *tmp=new T[*size];
+      for(mcIdType i=0;i<*size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              T val=(T)PyInt_AS_LONG(o);
               tmp[i]=val;
             }
           else
@@ -556,7 +611,7 @@ static int *convertPyToNewIntArr2(PyObject *pyLi, int *size)
     }
 }
 
-static PyObject *convertFromVectorPairInt(const std::vector< std::pair<int,int> >& arr)
+static PyObject *convertFromVectorPairInt(const std::vector< std::pair<mcIdType,mcIdType> >& arr)
 {
   PyObject *ret=PyList_New(arr.size());
   for(std::size_t i=0;i<arr.size();i++)
@@ -569,19 +624,19 @@ static PyObject *convertFromVectorPairInt(const std::vector< std::pair<int,int>
   return ret;
 }
 
-static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,int> >& arr)
+static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<mcIdType,mcIdType> >& arr)
 {
   const char msg[]="list must contain tuples of 2 integers only or tuple must contain tuples of 2 integers only !";
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       arr.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              int sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -590,8 +645,8 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,
               PyObject *o_1=PyTuple_GetItem(o,1);
               if(!PyInt_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
-              arr[i].first=(int)PyInt_AS_LONG(o_0);
-              arr[i].second=(int)PyInt_AS_LONG(o_1);
+              arr[i].first=(mcIdType)PyInt_AS_LONG(o_0);
+              arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -599,14 +654,14 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       arr.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              int sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -615,8 +670,8 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,
               PyObject *o_1=PyTuple_GetItem(o,1);
               if(!PyInt_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
-              arr[i].first=(int)PyInt_AS_LONG(o_0);
-              arr[i].second=(int)PyInt_AS_LONG(o_1);
+              arr[i].first=(mcIdType)PyInt_AS_LONG(o_0);
+              arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -631,14 +686,14 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
   const char msg[]="convertPyToVectorPairStringInt : list must contain tuples of 2 integers only or tuple must contain tuples of 1 string and 1 integer only !";
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       arr.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              int sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -654,14 +709,14 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       arr.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              int sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -679,18 +734,19 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
     throw INTERP_KERNEL::Exception(msg);
 }
 
-static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr)
+template<class T>
+static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<T>& arr)
 {
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       arr.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              T val=(T)PyInt_AS_LONG(o);
               arr[i]=val;
             }
           else
@@ -699,14 +755,14 @@ static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr)
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       arr.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              T val=(T)PyInt_AS_LONG(o);
               arr[i]=val;
             }
           else
@@ -719,27 +775,27 @@ static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr)
     }
 }
 
-static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPart, std::vector<int>& arr)
+static void convertPyToNewIntArr4(PyObject *pyLi, mcIdType recurseLev, mcIdType nbOfSubPart, std::vector<mcIdType>& arr)
 {
   if(recurseLev<0)
     throw INTERP_KERNEL::Exception("convertPyToNewIntArr4 : invalid list of integers level of recursion !");
   arr.clear();
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
-      for(int i=0;i<size;i++)
+      std::size_t size=PyList_Size(pyLi);
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              mcIdType val=(mcIdType)PyInt_AS_LONG(o);
               arr.push_back(val);
             }
           else
             {
-              std::vector<int> arr2;
+              std::vector<mcIdType> arr2;
               convertPyToNewIntArr4(o,recurseLev-1,nbOfSubPart,arr2);
-              if(nbOfSubPart>=1 && nbOfSubPart!=(int)arr2.size())
+              if(nbOfSubPart>=1 && nbOfSubPart!=(mcIdType)arr2.size())
                   {
                     std::ostringstream oss; oss << "convertPyToNewIntArr4 : input list at lev " <<  recurseLev << " invalid nb of subpart elts expected " << nbOfSubPart << " having " << arr2.size() << " !";
                     throw INTERP_KERNEL::Exception(oss.str().c_str());
@@ -750,20 +806,20 @@ static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPar
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
-      for(int i=0;i<size;i++)
+      std::size_t size=PyTuple_Size(pyLi);
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              mcIdType val=ToIdType(PyInt_AS_LONG(o));
               arr.push_back(val);
             }
           else
             {
-              std::vector<int> arr2;
+              std::vector<mcIdType> arr2;
               convertPyToNewIntArr4(o,recurseLev-1,nbOfSubPart,arr2);
-              if(nbOfSubPart>=1 && nbOfSubPart!=(int)arr2.size())
+              if(nbOfSubPart>=1 && nbOfSubPart!=(mcIdType)arr2.size())
                   {
                     std::ostringstream oss; oss << "convertPyToNewIntArr4 : input list at lev " <<  recurseLev << " invalid nb of subpart elts expected " << nbOfSubPart << " having " << arr2.size() << " !";
                     throw INTERP_KERNEL::Exception(oss.str().c_str());
@@ -776,7 +832,7 @@ static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPar
     throw INTERP_KERNEL::Exception("convertPyToNewIntArr4 : not a list nor a tuple recursively !");
 }
 
-static void checkFillArrayWithPyList(int size1, int size2, int& nbOfTuples, int& nbOfComp)
+static void checkFillArrayWithPyList(mcIdType size1, mcIdType size2, mcIdType& nbOfTuples, mcIdType& nbOfComp)
 {
   if(nbOfTuples==-1)
     {
@@ -816,12 +872,13 @@ static void checkFillArrayWithPyList(int size1, int size2, int& nbOfTuples, int&
     }
 }
 
-static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<int>& ret)
+template< class T >
+static void fillArrayWithPyListInt3(PyObject *pyLi, mcIdType& nbOfElt, std::vector<T>& ret)
 {
   static const char MSG[]="fillArrayWithPyListInt3 : It appears that the input list or tuple is composed by elts having different sizes !";
   if(PyInt_Check(pyLi))
     {
-      long val=PyInt_AS_LONG(pyLi);
+      T val=(T)PyInt_AS_LONG(pyLi);
       if(nbOfElt==-1)
         nbOfElt=1;
       else
@@ -831,12 +888,12 @@ static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<in
     }
   else if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
-      int tmp=0;
-      for(int i=0;i<size;i++)
+      std::size_t size=PyList_Size(pyLi);
+      mcIdType tmp=0;
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
-          int tmp1=-1;
+          mcIdType tmp1=-1;
           fillArrayWithPyListInt3(o,tmp1,ret);
           tmp+=tmp1;
         }
@@ -850,12 +907,12 @@ static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<in
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
-      int tmp=0;
-      for(int i=0;i<size;i++)
+      std::size_t size=PyTuple_Size(pyLi);
+      mcIdType tmp=0;
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          int tmp1=-1;
+          mcIdType tmp1=-1;
           fillArrayWithPyListInt3(o,tmp1,ret);
           tmp+=tmp1;
         }
@@ -871,14 +928,15 @@ static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<in
     throw INTERP_KERNEL::Exception("fillArrayWithPyListInt3 : Unrecognized type ! Should be a composition of tuple,list,int !");
 }
 
-static std::vector<int> fillArrayWithPyListInt2(PyObject *pyLi, int& nbOfTuples, int& nbOfComp)
+template< class T = mcIdType >
+static std::vector<T> fillArrayWithPyListInt2(PyObject *pyLi, mcIdType& nbOfTuples, mcIdType& nbOfComp)
 {
-  std::vector<int> ret;
-  int size1=-1,size2=-1;
+  std::vector<T> ret;
+  mcIdType size1=-1,size2=-1;
   if(PyList_Check(pyLi))
     {
-      size1=PyList_Size(pyLi);
-      for(int i=0;i<size1;i++)
+      size1=ToIdType(PyList_Size(pyLi));
+      for(mcIdType i=0;i<size1;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           fillArrayWithPyListInt3(o,size2,ret);
@@ -888,8 +946,8 @@ static std::vector<int> fillArrayWithPyListInt2(PyObject *pyLi, int& nbOfTuples,
     }
   else if(PyTuple_Check(pyLi))
     {
-      size1=PyTuple_Size(pyLi);
-      for(int i=0;i<size1;i++)
+      size1=ToIdType(PyTuple_Size(pyLi));
+      for(mcIdType i=0;i<size1;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           fillArrayWithPyListInt3(o,size2,ret);
@@ -910,7 +968,7 @@ static bool fillStringVector(PyObject *pyLi, std::vector<std::string>& vec)
     {
       Py_ssize_t sz=PyList_Size(pyLi);
       vec.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(!convertPyObjectToStrNT(o,vec[i]))
@@ -922,7 +980,7 @@ static bool fillStringVector(PyObject *pyLi, std::vector<std::string>& vec)
     {
       Py_ssize_t sz=PyTuple_Size(pyLi);
       vec.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(!convertPyObjectToStrNT(o,vec[i]))
@@ -940,7 +998,7 @@ static void convertPyToVectorOfVectorOfString(PyObject *pyLi, std::vector< std::
     {
       Py_ssize_t sz=PyList_Size(pyLi);
       arr.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(!fillStringVector(o,arr[i]))
@@ -951,7 +1009,7 @@ static void convertPyToVectorOfVectorOfString(PyObject *pyLi, std::vector< std::
     {
       Py_ssize_t sz=PyTuple_Size(pyLi);
       arr.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(!fillStringVector(o,arr[i]))
@@ -962,17 +1020,17 @@ static void convertPyToVectorOfVectorOfString(PyObject *pyLi, std::vector< std::
     throw INTERP_KERNEL::Exception(msg);
 }
 
-static bool fillIntVector(PyObject *pyLi, std::vector<int>& vec)
+static bool fillIntVector(PyObject *pyLi, std::vector<mcIdType>& vec)
 {
   if(PyList_Check(pyLi))
     {
       Py_ssize_t sz=PyList_Size(pyLi);
       vec.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
-            vec[i]=PyInt_AS_LONG(o);
+            vec[i]=ToIdType(PyInt_AS_LONG(o));
           else
             return false;
         }
@@ -982,11 +1040,11 @@ static bool fillIntVector(PyObject *pyLi, std::vector<int>& vec)
     {
       Py_ssize_t sz=PyTuple_Size(pyLi);
       vec.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyInt_Check(o))
-            vec[i]=PyInt_AS_LONG(o);
+            vec[i]=ToIdType(PyInt_AS_LONG(o));
           else
             return false;
         }
@@ -996,14 +1054,14 @@ static bool fillIntVector(PyObject *pyLi, std::vector<int>& vec)
     return false;
 }
 
-static void convertPyToVectorOfVectorOfInt(PyObject *pyLi, std::vector< std::vector<int> >& arr)
+static void convertPyToVectorOfVectorOfInt(PyObject *pyLi, std::vector< std::vector<mcIdType> >& arr)
 {
   const char msg[]="convertPyToVectorOfVectorOfInt : expecting list of list of strings !";
   if(PyList_Check(pyLi))
     {
       Py_ssize_t sz=PyList_Size(pyLi);
       arr.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(!fillIntVector(o,arr[i]))
@@ -1014,7 +1072,7 @@ static void convertPyToVectorOfVectorOfInt(PyObject *pyLi, std::vector< std::vec
     {
       Py_ssize_t sz=PyTuple_Size(pyLi);
       arr.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(!fillIntVector(o,arr[i]))
@@ -1032,12 +1090,12 @@ static void convertPyToVectorPairStringVecString(PyObject *pyLi, std::vector< st
     {
       Py_ssize_t sz=PyList_Size(pyLi);
       arr.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(mcIdType i=0;i<sz;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              int sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               std::pair<std::string, std::vector<std::string> > item;
@@ -1056,12 +1114,12 @@ static void convertPyToVectorPairStringVecString(PyObject *pyLi, std::vector< st
     {
       Py_ssize_t sz=PyTuple_Size(pyLi);
       arr.resize(sz);
-      for(int i=0;i<sz;i++)
+      for(Py_ssize_t i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              int sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               std::pair<std::string, std::vector<std::string> > item;
@@ -1081,42 +1139,42 @@ static void convertPyToVectorPairStringVecString(PyObject *pyLi, std::vector< st
 }
 
 template<class T>
-PyObject *convertDblArrToPyList(const T *ptr, int size)
+PyObject *convertDblArrToPyList(const T *ptr, std::size_t size)
 {
   PyObject *ret(PyList_New(size));
-  for(int i=0;i<size;i++)
+  for(std::size_t i=0;i<size;i++)
     PyList_SetItem(ret,i,PyFloat_FromDouble(ptr[i]));
   return ret;
 }
 
 static PyObject *convertDblArrToPyList2(const std::vector<double>& v)
 {
-  int size(v.size());
+  std::size_t size(v.size());
   PyObject *ret(PyList_New(size));
-  for(int i=0;i<size;i++)
+  for(std::size_t i=0;i<size;i++)
     PyList_SetItem(ret,i,PyFloat_FromDouble(v[i]));
   return ret;
 }
 
 template<class T>
-PyObject *convertDblArrToPyListOfTuple(const T *vals, int nbOfComp, int nbOfTuples)
+PyObject *convertDblArrToPyListOfTuple(const T *vals, std::size_t nbOfComp, mcIdType nbOfTuples)
 {
   PyObject *ret(PyList_New(nbOfTuples));
-  for(int i=0;i<nbOfTuples;i++)
+  for(mcIdType i=0;i<nbOfTuples;i++)
     {
       PyObject *t=PyTuple_New(nbOfComp);
-      for(int j=0;j<nbOfComp;j++)
+      for(std::size_t j=0;j<nbOfComp;j++)
         PyTuple_SetItem(t,j,PyFloat_FromDouble(vals[i*nbOfComp+j]));
       PyList_SetItem(ret,i,t);
     }
   return ret;
 }
 
-static PyObject *convertCharArrToPyListOfTuple(const char *vals, int nbOfComp, int nbOfTuples)
+static PyObject *convertCharArrToPyListOfTuple(const char *vals, int nbOfComp, mcIdType nbOfTuples)
 {
   PyObject *ret=PyList_New(nbOfTuples);
   INTERP_KERNEL::AutoPtr<char> tmp=new char[nbOfComp+1]; tmp[nbOfComp]='\0';
-  for(int i=0;i<nbOfTuples;i++)
+  for(mcIdType i=0;i<nbOfTuples;i++)
     {
       std::copy(vals+i*nbOfComp,vals+(i+1)*nbOfComp,(char *)tmp);
       PyList_SetItem(ret,i,PyString_FromString(tmp));
@@ -1124,13 +1182,13 @@ static PyObject *convertCharArrToPyListOfTuple(const char *vals, int nbOfComp, i
   return ret;
 }
 
-static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
+static double *convertPyToNewDblArr2(PyObject *pyLi, mcIdType *size)
 {
   if(PyList_Check(pyLi))
     {
-      *size=PyList_Size(pyLi);
+      *size=ToIdType(PyList_Size(pyLi));
       double *tmp=(double *)malloc((*size)*sizeof(double));
-      for(int i=0;i<*size;i++)
+      for(mcIdType i=0;i<*size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyFloat_Check(o))
@@ -1141,7 +1199,7 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
           else if(PyInt_Check(o))
             {
               long val0=PyInt_AS_LONG(o);
-              double val=val0;
+              double val=(double)val0;
               tmp[i]=val;
             }
           else
@@ -1154,9 +1212,9 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
     }
   else if(PyTuple_Check(pyLi))
     {
-      *size=PyTuple_Size(pyLi);
+      *size=ToIdType(PyTuple_Size(pyLi));
       double *tmp=(double *)malloc((*size)*sizeof(double));
-      for(int i=0;i<*size;i++)
+      for(mcIdType i=0;i<*size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyFloat_Check(o))
@@ -1167,7 +1225,7 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
           else if(PyInt_Check(o))
             {
               long val0=PyInt_AS_LONG(o);
-              double val=val0;
+              double val=(double)val0;
               tmp[i]=val;
             }
           else
@@ -1182,7 +1240,7 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
     throw INTERP_KERNEL::Exception("convertPyToNewDblArr2 : not a list");
 }
 
-static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<double>& ret)
+static void fillArrayWithPyListDbl3(PyObject *pyLi, mcIdType& nbOfElt, std::vector<double>& ret)
 {
   static const char MSG[]="fillArrayWithPyListDbl3 : It appears that the input list or tuple is composed by elts having different sizes !";
   if(PyFloat_Check(pyLi))
@@ -1197,8 +1255,8 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<do
     }
   else if(PyInt_Check(pyLi))
     {
-      long val0=PyInt_AS_LONG(pyLi);
-      double val=val0;
+      mcIdType val0=ToIdType(PyInt_AS_LONG(pyLi));
+      double val=(double)val0;
       if(nbOfElt==-1)
         nbOfElt=1;
       else
@@ -1208,12 +1266,12 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<do
     }
   else if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
-      int tmp=0;
-      for(int i=0;i<size;i++)
+      std::size_t size=PyList_Size(pyLi);
+      mcIdType tmp=0;
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
-          int tmp1=-1;
+          mcIdType tmp1=-1;
           fillArrayWithPyListDbl3(o,tmp1,ret);
           tmp+=tmp1;
         }
@@ -1227,12 +1285,12 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<do
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
-      int tmp=0;
-      for(int i=0;i<size;i++)
+      std::size_t size=PyTuple_Size(pyLi);
+      mcIdType tmp=0;
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          int tmp1=-1;
+          mcIdType tmp1=-1;
           fillArrayWithPyListDbl3(o,tmp1,ret);
           tmp+=tmp1;
         }
@@ -1248,14 +1306,15 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<do
     throw INTERP_KERNEL::Exception("fillArrayWithPyListDbl3 : Unrecognized type ! Should be a composition of tuple,list,int and float !");
 }
 
-static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, int& nbOfTuples, int& nbOfComp)
+static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, mcIdType& nbOfTuples, mcIdType& nbOfComp)
 {
   std::vector<double> ret;
-  int size1=-1,size2=-1;
+  std::size_t size1=-1;
+  mcIdType size2=-1;
   if(PyList_Check(pyLi))
     {
       size1=PyList_Size(pyLi);
-      for(int i=0;i<size1;i++)
+      for(std::size_t i=0;i<size1;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           fillArrayWithPyListDbl3(o,size2,ret);
@@ -1266,7 +1325,7 @@ static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, int& nbOfTupl
   else if(PyTuple_Check(pyLi))
     {
       size1=PyTuple_Size(pyLi);
-      for(int i=0;i<size1;i++)
+      for(std::size_t i=0;i<size1;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           fillArrayWithPyListDbl3(o,size2,ret);
@@ -1277,7 +1336,7 @@ static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, int& nbOfTupl
   else
     throw INTERP_KERNEL::Exception("fillArrayWithPyListDbl2 : Unrecognized type ! Should be a tuple or a list !");
   //
-  checkFillArrayWithPyList(size1,size2,nbOfTuples,nbOfComp);
+  checkFillArrayWithPyList(ToIdType(size1),ToIdType(size2),nbOfTuples,nbOfComp);
   return ret;
 }
 
@@ -1288,9 +1347,9 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
   void *argp=0;
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       ret.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *obj=PyList_GetItem(pyLi,i);
           int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
@@ -1305,9 +1364,9 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       ret.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *obj=PyTuple_GetItem(pyLi,i);
           int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
@@ -1330,33 +1389,45 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
     throw INTERP_KERNEL::Exception("convertFromPyObjVectorOfObj : not a list nor a tuple");
 }
 
+//convertFromVectorAutoObjToPyObj<MEDCoupling::MEDCouplingUMesh>(inpv,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh)
+template<class T>
+static PyObject *convertFromVectorAutoObjToPyObj(std::vector< MCAuto<T> >& inpVector, swig_type_info *ty)
+{
+  std::size_t sz(inpVector.size());
+  PyObject *ret = PyList_New(sz);
+  for(std::size_t i=0;i<sz;++i)
+    PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(inpVector[i].retn()),ty, SWIG_POINTER_OWN | 0 ));
+  return ret;
+}
+
 /*!
  * if python int -> cpp int sw=1
  * if python list[int] -> cpp vector<int> sw=2
  * if python tuple[int] -> cpp vector<int> sw=2
- * if python DataArrayInt -> cpp DataArrayInt sw=3
- * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4
+ * if python DataArrayIdType -> cpp DataArrayIdType sw=3
+ * if python DataArrayIntTuple -> cpp DataArrayIdTypeTuple sw=4
  *
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
  */
-static void convertIntStarLikePyObjToCpp(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, MEDCoupling::DataArrayInt *& daIntTyypp, MEDCoupling::DataArrayIntTuple *&daIntTuple)
+template< class T, class ARRAY >
+static void convertIntStarLikePyObjToCpp(PyObject *value, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, ARRAY *& daIntTyypp, typename MEDCoupling::Traits< T >::ArrayTuple *&daIntTuple)
 {
   sw=-1;
   if(PyInt_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(T)PyInt_AS_LONG(value);
       sw=1;
       return;
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1368,13 +1439,13 @@ static void convertIntStarLikePyObjToCpp(PyObject *value, int& sw, int& iTyypp,
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1385,82 +1456,84 @@ static void convertIntStarLikePyObjToCpp(PyObject *value, int& sw, int& iTyypp,
       return;
     }
   void *argp;
-  int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+  int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits< typename ARRAY::Type >::TI,0|0);
   if(SWIG_IsOK(status))
     {
-      daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+      daIntTyypp=reinterpret_cast< ARRAY * >(argp);
       sw=3;
       return;
     }
-  status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+  status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<T>::TI_TUPLE,0|0);
   if(SWIG_IsOK(status))
-    {  
-      daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+    {
+      daIntTuple=reinterpret_cast< typename MEDCoupling::Traits< T >::ArrayTuple * >(argp);
       sw=4;
       return ;
     }
-  throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple");
+  throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayIdType, DataArrayIdTypeTuple");
 }
 
 /*!
  * if python int -> cpp int sw=1
  * if python list[int] -> cpp vector<int> sw=2
  * if python tuple[int] -> cpp vector<int> sw=2
- * if python DataArrayInt -> cpp DataArrayInt sw=3
- * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4
+ * if python DataArrayIdType -> cpp DataArrayIdType sw=3
+ * if python DataArrayIdTypeTuple -> cpp DataArrayIdTypeTuple sw=4
  *
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
  */
-static const int *convertIntStarLikePyObjToCppIntStar(PyObject *value, int& sw, int& sz, int& iTyypp, std::vector<int>& stdvecTyypp)
+template< class T >
+static const T *convertIntStarLikePyObjToCppIntStar(PyObject *value, mcIdType& sw, mcIdType& sz, T& iTyypp, std::vector<T>& stdvecTyypp)
 {
   sw=-1;
   if(PyInt_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(T)PyInt_AS_LONG(value);
       sw=1; sz=1;
       return &iTyypp;
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
               throw INTERP_KERNEL::Exception(oss.str().c_str());
             }
         }
-      sw=2; sz=size;
+      sw=2; sz=ToIdType(size);
       return &stdvecTyypp[0];
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
               throw INTERP_KERNEL::Exception(oss.str().c_str());
             }
         }
-      sw=2; sz=size;
+      sw=2; sz=ToIdType(size);
       return &stdvecTyypp[0];
     }
   void *argp;
-  int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+  int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<T>::TI,0|0);
   if(SWIG_IsOK(status))
     {
-      MEDCoupling::DataArrayInt *daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+      typedef typename MEDCoupling::Traits< T >::ArrayType ARRAY;
+      ARRAY *daIntTyypp=reinterpret_cast< ARRAY * >(argp);
       if(daIntTyypp)
         {
           sw=3; sz=daIntTyypp->getNbOfElems();
@@ -1472,14 +1545,15 @@ static const int *convertIntStarLikePyObjToCppIntStar(PyObject *value, int& sw,
           return 0;
         }
     }
-  status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+  status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<T>::TI_TUPLE,0|0);
   if(SWIG_IsOK(status))
-    {  
-      MEDCoupling::DataArrayIntTuple *daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
-      sw=4; sz=daIntTuple->getNumberOfCompo();
+    {
+      typedef typename MEDCoupling::Traits< T >::ArrayTuple ARRAYTUPLE;
+      ARRAYTUPLE *daIntTuple=reinterpret_cast< ARRAYTUPLE * >(argp);
+      sw=4; sz=ToIdType(daIntTuple->getNumberOfCompo());
       return daIntTuple->getConstPointer();
     }
-  throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple");
+  throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayIdType, DataArrayIdTypeTuple");
 }
 
 /*!
@@ -1491,10 +1565,10 @@ static const int *convertIntStarLikePyObjToCppIntStar(PyObject *value, int& sw,
  * if python tuple[int] -> cpp vector<double> sw=2
  * if python DataArrayDouble -> cpp DataArrayDouble sw=3
  *
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
  */
 template<class T>
-void considerPyObjAsATStarLikeObject(PyObject *value, int& sw, T& iTyypp, std::vector<T>& stdvecTyypp, typename MEDCoupling::Traits<T>::ArrayType *& daIntTyypp, swig_type_info *ti)
+void considerPyObjAsATStarLikeObject(PyObject *value, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, typename MEDCoupling::Traits<T>::ArrayType *& daIntTyypp, swig_type_info *ti)
 {
   sw=-1;
   if(PyFloat_Check(value))
@@ -1511,9 +1585,9 @@ void considerPyObjAsATStarLikeObject(PyObject *value, int& sw, T& iTyypp, std::v
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1531,9 +1605,9 @@ void considerPyObjAsATStarLikeObject(PyObject *value, int& sw, T& iTyypp, std::v
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1566,9 +1640,9 @@ void considerPyObjAsATStarLikeObject(PyObject *value, int& sw, T& iTyypp, std::v
  * if python tuple[int] -> cpp vector<double> sw=2
  * if python DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
  *
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
  */
-static void convertDoubleStarLikePyObjToCpp(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, MEDCoupling::DataArrayDoubleTuple *& daIntTyypp)
+static void convertDoubleStarLikePyObjToCpp(PyObject *value, mcIdType& sw, double& iTyypp, std::vector<double>& stdvecTyypp, MEDCoupling::DataArrayDoubleTuple *& daIntTyypp)
 {
   sw=-1;
   if(PyFloat_Check(value))
@@ -1585,9 +1659,9 @@ static void convertDoubleStarLikePyObjToCpp(PyObject *value, int& sw, double& iT
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1605,9 +1679,9 @@ static void convertDoubleStarLikePyObjToCpp(PyObject *value, int& sw, double& iT
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1632,12 +1706,12 @@ static void convertDoubleStarLikePyObjToCpp(PyObject *value, int& sw, double& iT
 }
 
 template<class T>
-void convertFPStarLikePyObjToCpp_2(PyObject *value, int& sw, T& val, typename MEDCoupling::Traits<T>::ArrayType *&d, typename MEDCoupling::Traits<T>::ArrayTuple *&e, std::vector<T>& f, swig_type_info *ti_da, swig_type_info *ti_tuple)
+void convertFPStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, T& val, typename MEDCoupling::Traits<T>::ArrayType *&d, typename MEDCoupling::Traits<T>::ArrayTuple *&e, std::vector<T>& f, swig_type_info *ti_da, swig_type_info *ti_tuple)
 {
   sw=-1;
   if(PyFloat_Check(value))
     {
-      val=PyFloat_AS_DOUBLE(value);
+      val=(T)PyFloat_AS_DOUBLE(value);
       sw=1;
       return;
     }
@@ -1649,13 +1723,13 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, int& sw, T& val, typename ME
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       f.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
-            f[i]=PyFloat_AS_DOUBLE(o);
+            f[i]=(T)PyFloat_AS_DOUBLE(o);
           else if(PyInt_Check(o))
             f[i]=(T)PyInt_AS_LONG(o);
           else
@@ -1669,13 +1743,13 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, int& sw, T& val, typename ME
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       f.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
-            f[i]=PyFloat_AS_DOUBLE(o);
+            f[i]=(T)PyFloat_AS_DOUBLE(o);
           else if(PyInt_Check(o))
             f[i]=(T)PyInt_AS_LONG(o);
           else
@@ -1690,14 +1764,14 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, int& sw, T& val, typename ME
   void *argp;
   int status=SWIG_ConvertPtr(value,&argp,ti_da,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       d=reinterpret_cast< typename MEDCoupling::Traits<T>::ArrayType * >(argp);
       sw=2;
       return ;
     }
   status=SWIG_ConvertPtr(value,&argp,ti_tuple,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       e=reinterpret_cast< typename MEDCoupling::Traits<T>::ArrayTuple * >(argp);
       sw=3;
       return ;
@@ -1713,39 +1787,53 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, int& sw, T& val, typename ME
  * if value list[int,double] -> cpp std::vector<double> sw=4
  * if value tuple[int,double] -> cpp std::vector<double> sw=4
  */
-static void convertDoubleStarLikePyObjToCpp_2(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f)
+static void convertDoubleStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f)
 {
   convertFPStarLikePyObjToCpp_2<double>(value,sw,val,d,e,f,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple);
 }
 
+/*!
+ * if value int -> cpp val sw=1
+ * if value double -> cpp val sw=1
+ * if value DataArrayDouble -> cpp DataArrayDouble sw=2
+ * if value DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
+ * if value list[int,double] -> cpp std::vector<double> sw=4
+ * if value tuple[int,double] -> cpp std::vector<double> sw=4
+ */
+static void convertFloatStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, float& val, MEDCoupling::DataArrayFloat *&d, MEDCoupling::DataArrayFloatTuple *&e, std::vector<float>& f)
+{
+  convertFPStarLikePyObjToCpp_2<float>(value,sw,val,d,e,f,SWIGTYPE_p_MEDCoupling__DataArrayFloat,SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple);
+}
+
 /*!
  * if python int -> cpp int sw=1
  * if python list[int] -> cpp vector<int> sw=2
  * if python tuple[int] -> cpp vector<int> sw=2
  * if python slicp -> cpp pair sw=3 (begin,end,step)
- * if python DataArrayInt -> cpp DataArrayInt sw=4 . The returned pointer cannot be the null pointer ! If null an exception is thrown.
+ * if python DataArrayIdType -> cpp DataArrayIdType sw=4 . The returned pointer cannot be the null pointer ! If null an exception is thrown.
  *
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
  */
-static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayInt *& daIntTyypp)
+template<class T, class ARRAY>
+static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, mcIdType nbelem, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& p, ARRAY *& daIntTyypp)
 {
-  const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple";
+  const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIdType, DataArrayIdTypeTuple";
   sw=-1;
   if(PyInt_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(T)PyInt_AS_LONG(value);
       sw=1;
       return;
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1757,13 +1845,13 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, int nbelem, int
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1777,17 +1865,17 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, int nbelem, int
     {
       Py_ssize_t strt=2,stp=2,step=2;
       GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
-      p.first=strt;
-      p.second.first=stp;
-      p.second.second=step;
+      p.first=ToIdType(strt);
+      p.second.first=ToIdType(stp);
+      p.second.second=ToIdType(step);
       sw=3;
       return ;
     }
   void *argp;
-  int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+  int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits< typename ARRAY::Type >::TI,0|0);
   if(SWIG_IsOK(status))
     {
-      daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+      daIntTyypp=reinterpret_cast< ARRAY * >(argp);
       if(!daIntTyypp)
         {
           std::ostringstream oss; oss << msg << " Instance in null !";
@@ -1796,10 +1884,11 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, int nbelem, int
       sw=4;
       return ;
     }
-  status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+  status=SWIG_ConvertPtr(value,&argp,SWIGTITraits< typename ARRAY::Type >::TI_TUPLE,0|0);
   if(SWIG_IsOK(status))
     {
-      MEDCoupling::DataArrayIntTuple *tmp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+      typedef typename MEDCoupling::Traits< typename ARRAY::Type >::ArrayTuple ARRAYTUPLE;
+      ARRAYTUPLE *tmp=reinterpret_cast< ARRAYTUPLE * >(argp);
       if(!tmp)
         {
           std::ostringstream oss; oss << msg << " Instance in null !";
@@ -1816,12 +1905,13 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, int nbelem, int
 /*!
  * Idem than convertIntStarOrSliceLikePyObjToCpp
  */
-static void convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayInt *& daIntTyypp)
+template<class T, class ARRAY>
+static void convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(PyObject *value, mcIdType nbelem, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& p, ARRAY *& daIntTyypp)
 {
   convertIntStarOrSliceLikePyObjToCpp(value,nbelem,sw,iTyypp,stdvecTyypp,p,daIntTyypp);
   if(sw==1)
     {
-      iTyypp=InterpreteNegativeInt(iTyypp,nbelem);
+      iTyypp=(T)InterpreteNegativeInt(iTyypp,nbelem);
     }
 }
 
@@ -1830,26 +1920,27 @@ static void convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(PyObject *value,
  * if python tuple[int] -> cpp vector<int> sw=2
  * if python list[int] -> cpp vector<int> sw=2
  * if python slice -> cpp pair sw=3
- * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4 . WARNING The returned pointer can be the null pointer !
+ * if python DataArrayIdTypeTuple -> cpp DataArrayIdTypeTuple sw=4 . WARNING The returned pointer can be the null pointer !
  */
-static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayIntTuple *& daIntTyypp)
+template< class TUPLE_T >
+static void convertObjToPossibleCpp22(PyObject *value, mcIdType nbelem, mcIdType& sw, mcIdType& iTyypp, std::vector<mcIdType>& stdvecTyypp, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& p, typename MEDCoupling::Traits< TUPLE_T >::ArrayTuple *& daIntTyypp)
 {
   sw=-1;
   if(PyInt_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=ToIdType(PyInt_AS_LONG(value));
       sw=1;
       return;
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1861,13 +1952,13 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int&
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1881,17 +1972,17 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int&
     {
       Py_ssize_t strt=2,stp=2,step=2;
       GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
-      p.first=strt;
-      p.second.first=stp;
-      p.second.second=step;
+      p.first=ToIdType(strt);
+      p.second.first=ToIdType(stp);
+      p.second.second=ToIdType(step);
       sw=3;
       return ;
     }
   void *argp;
-  int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+  int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<TUPLE_T>::TI_TUPLE,0|0);
   if(!SWIG_IsOK(status))
-    throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIntTuple");
-  daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+    throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIdTypeTuple");
+  daIntTyypp=reinterpret_cast< typename MEDCoupling::Traits< TUPLE_T >::ArrayTuple * >(argp);
   sw=4;
 }
 
@@ -1902,7 +1993,7 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int&
  * if python not null pointer of DataArrayChar -> cpp DataArrayChar sw=4
  * switch between (int,string,vector<string>,DataArrayChar)
  */
-static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::string& sType, std::vector<std::string>& vsType, MEDCoupling::DataArrayChar *& dacType)
+static void convertObjToPossibleCpp6(PyObject *value, mcIdType& sw, char& cTyp, std::string& sType, std::vector<std::string>& vsType, MEDCoupling::DataArrayChar *& dacType)
 {
   const char *msg="4 types accepted : string, list or tuple of strings having same size, not null DataArrayChar instance.";
   sw=-1;
@@ -1944,16 +2035,16 @@ static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::
 #endif
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       vsType.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           try
             {
               vsType[i]=convertPyObjectToStr(o);
             }
-          catch(INTERP_KERNEL::Exception& e)
+          catch(INTERP_KERNEL::Exception& )
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not a string ! only tuples of strings accepted !";
               throw INTERP_KERNEL::Exception(oss.str().c_str());
@@ -1964,16 +2055,16 @@ static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       vsType.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           try
             {
               vsType[i]=convertPyObjectToStr(o);
             }
-          catch(INTERP_KERNEL::Exception& e)
+          catch(INTERP_KERNEL::Exception& )
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not a string ! only tuples of strings accepted !";
               throw INTERP_KERNEL::Exception(oss.str().c_str());
@@ -2003,7 +2094,7 @@ static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::
  * if value list[int] -> vt sw=2
  * if value tuple[int] -> vt sw=2
  * if value slice -> pt sw=3
- * if value DataArrayInt -> dt sw=4
+ * if value DataArrayIdType -> dt sw=4
  * if value tuple [int,int] -> cpp it,ip sw=5
  * if value tuple [list[int],int] -> cpp vt,ip sw=6
  * if value tuple [tuple[int],int] -> cpp vt,ip sw=6
@@ -2025,11 +2116,12 @@ static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::
  * if value tuple [slice,slice] -> cpp pt,pc sw=15
  * if value tuple [DaI,slice] -> cpp dt,pc sw=16
  *
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
  */
-static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, int& sw, int& it, int& ic, std::vector<int>& vt, std::vector<int>& vc,
-                                     std::pair<int, std::pair<int,int> >& pt, std::pair<int, std::pair<int,int> >& pc,
-                                     MEDCoupling::DataArrayInt *&dt, MEDCoupling::DataArrayInt *&dc)
+template<class TC>
+static void convertObjToPossibleCpp3(PyObject *value, mcIdType nbTuple, int nbCompo, mcIdType& sw, mcIdType& it, TC& ic, std::vector<mcIdType>& vt, std::vector<TC>& vc,
+                                     std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& pt, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& pc,
+                                     MEDCoupling::DataArrayIdType *&dt, MEDCoupling::DataArrayIdType *&dc)
 {
   if(!PyTuple_Check(value))
     {
@@ -2038,11 +2130,11 @@ static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo,
     }
   else
     {
-      int sz=PyTuple_Size(value);
+      std::size_t sz=PyTuple_Size(value);
       if(sz!=2)
         throw INTERP_KERNEL::Exception("Unexpected nb of slice element : 1 or 2 expected !\n1st is for tuple selection, 2nd for component selection !");
       PyObject *ob0=PyTuple_GetItem(value,0);
-      int sw1,sw2;
+      mcIdType sw1,sw2;
       convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(ob0,nbTuple,sw1,it,vt,pt,dt);
       PyObject *ob1=PyTuple_GetItem(value,1);
       convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(ob1,nbCompo,sw2,ic,vc,pc,dc);
@@ -2058,8 +2150,8 @@ static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo,
  * if value list[int,double] -> cpp std::vector<double> sw=4
  * if value tuple[int,double] -> cpp std::vector<double> sw=4
  */
-static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
-                                                   const char *msg, int nbTuplesExpected, int nbCompExpected, bool throwIfNullPt)
+static const double *convertObjToPossibleCpp5_Safe(PyObject *value, mcIdType& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
+                                                   const char *msg, mcIdType nbTuplesExpected, int nbCompExpected, bool throwIfNullPt)
 {
   sw=-1;
   if(PyFloat_Check(value))
@@ -2068,7 +2160,7 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
       sw=1;
       if(nbTuplesExpected*nbCompExpected!=1)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyFloat) !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyFloat) !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
       return &val;
@@ -2079,7 +2171,7 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
       sw=1;
       if(nbTuplesExpected*nbCompExpected!=1)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyInt) !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyInt) !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
       return &val;
@@ -2088,7 +2180,7 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
     {
       try
         {
-          int tmp1=nbTuplesExpected,tmp2=nbCompExpected;
+          mcIdType tmp1=nbTuplesExpected,tmp2=nbCompExpected;
           std::vector<double> ret=fillArrayWithPyListDbl2(value,tmp1,tmp2);
           sw=4;
           f=ret;
@@ -2099,14 +2191,14 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
   void *argp;
   int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
       sw=2;
       if(d)
         {
           if(d->getNumberOfTuples()==nbTuplesExpected)
             {
-              if(d->getNumberOfComponents()==nbCompExpected)
+              if(ToIdType(d->getNumberOfComponents())==nbCompExpected)
                 {
                   return d->getConstPointer();
                 }
@@ -2135,16 +2227,16 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
     }
   status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
       sw=3;
-      if(e->getNumberOfCompo()==nbCompExpected)
+      if(ToIdType(e->getNumberOfCompo())==nbCompExpected)
         {
           if(nbTuplesExpected==1)
             return e->getConstPointer();
           else
             {
-              std::ostringstream oss; oss << msg << "nb of tuples expected to be " << nbTuplesExpected << " , and input DataArrayDoubleTuple has always one tuple by contruction !";
+              std::ostringstream oss; oss << msg << "nb of tuples expected to be " << nbTuplesExpected << " , and input DataArrayDoubleTuple has always one tuple by construction !";
               throw INTERP_KERNEL::Exception(oss.str().c_str());
             }
         }
@@ -2165,8 +2257,8 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
  * if value list[int,double] -> cpp std::vector<double> sw=4
  * if value tuple[int,double] -> cpp std::vector<double> sw=4
  */
-static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
-                                                    const char *msg, int nbCompExpected, bool throwIfNullPt, int& nbTuples)
+static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, mcIdType& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
+                                                    const char *msg, int nbCompExpected, bool throwIfNullPt, mcIdType& nbTuples)
 {
   sw=-1;
   if(PyFloat_Check(value))
@@ -2175,7 +2267,7 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
       sw=1;
       if(nbCompExpected!=1)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyFloat) !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyFloat) !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
       nbTuples=1;
@@ -2187,7 +2279,7 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
       sw=1;
       if(nbCompExpected!=1)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyInt) !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyInt) !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
       nbTuples=1;
@@ -2195,9 +2287,9 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       f.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2213,17 +2305,17 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
       sw=4;
       if(size%nbCompExpected!=0)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
-      nbTuples=size/nbCompExpected;
+      nbTuples=ToIdType(size/nbCompExpected);
       return &f[0];
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       f.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2239,21 +2331,21 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
       sw=4;
       if(size%nbCompExpected!=0)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
-      nbTuples=size/nbCompExpected;
+      nbTuples=ToIdType(size/nbCompExpected);
       return &f[0];
     }
   void *argp;
   int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
       sw=2;
       if(d)
         {
-          if(d->getNumberOfComponents()==nbCompExpected)
+          if(ToIdType(d->getNumberOfComponents())==nbCompExpected)
             {
               nbTuples=d->getNumberOfTuples();
               return d->getConstPointer();
@@ -2277,12 +2369,12 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
     }
   status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
       sw=3;
       if(e)
         {
-          if(e->getNumberOfCompo()==nbCompExpected)
+          if(ToIdType(e->getNumberOfCompo())==nbCompExpected)
             {
               nbTuples=1;
               return e->getConstPointer();
@@ -2315,8 +2407,8 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
  * if value list[int,double] -> cpp std::vector<double> sw=4
  * if value tuple[int,double] -> cpp std::vector<double> sw=4
  */
-static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int& sw, double& val, std::vector<double>& f,
-                                                          const char *msg, bool throwIfNullPt, int& nbTuples)
+static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, mcIdType& sw, double& val, std::vector<double>& f,
+                                                          const char *msg, bool throwIfNullPt, mcIdType& nbTuples)
 {
   MEDCoupling::DataArrayDouble *d=0;
   MEDCoupling::DataArrayDoubleTuple *e=0;
@@ -2337,9 +2429,9 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
     }
   if(PyTuple_Check(value))
     {
-      int size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       f.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2353,14 +2445,14 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
             }
         }
       sw=4;
-      nbTuples=size;
+      nbTuples=ToIdType(size);
       return &f[0];
     }
   if(PyList_Check(value))
     {
-      int size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       f.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2374,13 +2466,13 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
             }
         }
       sw=4;
-      nbTuples=size;
+      nbTuples=ToIdType(size);
       return &f[0];
     }
   void *argp;
   int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
       sw=2;
       if(d)
@@ -2409,12 +2501,12 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
     }
   status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
   if(SWIG_IsOK(status))
-    {  
+    {
       e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
       sw=3;
       if(e)
         {
-          nbTuples=e->getNumberOfCompo();
+          nbTuples=ToIdType(e->getNumberOfCompo());
           return e->getConstPointer();
         }
       else
@@ -2440,15 +2532,19 @@ static MEDCoupling::DataArray *CheckAndRetrieveDataArrayInstance(PyObject *obj,
       status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
       if(!SWIG_IsOK(status))
         {
-          status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+          status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt32,0|0);
           if(!SWIG_IsOK(status))
             {
-              status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,0|0);
+              status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt64,0|0);
               if(!SWIG_IsOK(status))
                 {
-                  status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayByte,0|0);
-                  std::ostringstream oss; oss << msg << " ! Accepted instances are DataArrayDouble, DataArrayInt, DataArrayAsciiChar, DataArrayByte !";
-                  throw INTERP_KERNEL::Exception(oss.str().c_str());
+                  status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,0|0);
+                  if(!SWIG_IsOK(status))
+                    {
+                      status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayByte,0|0);
+                      std::ostringstream oss; oss << msg << " ! Accepted instances are DataArrayDouble, DataArrayIdType, DataArrayAsciiChar, DataArrayByte !";
+                      throw INTERP_KERNEL::Exception(oss.str().c_str());
+                    }
                 }
             }
         }
@@ -2456,114 +2552,6 @@ static MEDCoupling::DataArray *CheckAndRetrieveDataArrayInstance(PyObject *obj,
   return reinterpret_cast< MEDCoupling::DataArray * >(aBasePtrVS);
 }
 
-static PyObject *NewMethWrapCallInitOnlyIfEmptyDictInInput(PyObject *cls, PyObject *args, const char *clsName)
-{
-  if(!PyTuple_Check(args))
-    {
-      std::ostringstream oss; oss << clsName << ".__new__ : the args in input is expected to be a tuple !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
-    }
-  PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
-  PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
-  PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
-  //
-  PyObject *tmp0(PyTuple_New(1));
-  PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
-  PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
-  Py_DECREF(tmp0);
-  Py_DECREF(selfMeth);
-  if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==0 )
-    {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
-      PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
-      PyObject *tmp3(PyTuple_New(0));
-      PyObject *tmp2(PyObject_CallObject(initMeth,tmp3));
-      Py_XDECREF(tmp2);
-      Py_DECREF(tmp3);
-      Py_DECREF(initMeth);
-    }
-  return instance;
-}
-
-template<class T>
-static PyObject *NewMethWrapCallInitOnlyIfDictWithSingleEltInInputGeneral(PyObject *cls, PyObject *args, const char *clsName)
-{
-  if(!PyTuple_Check(args))
-    {
-      std::ostringstream oss; oss << clsName << ".__new__ : the args in input is expected to be a tuple !";
-      throw INTERP_KERNEL::Exception(oss.str().c_str());
-    }
-  PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
-  PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
-  PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
-  //
-  PyObject *tmp0(PyTuple_New(1));
-  PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
-  PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
-  Py_DECREF(tmp0);
-  Py_DECREF(selfMeth);
-  if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
-    {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
-      PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
-      PyObject *zeNumpyRepr(0);
-      {
-        PyObject *tmp1(PyInt_FromLong(0));
-       zeNumpyRepr=PyDict_GetItem(PyTuple_GetItem(args,1),tmp1);//borrowed
-        Py_DECREF(tmp1);
-      }
-      if(!zeNumpyRepr)
-        {
-          std::ostringstream oss; oss << clsName << ".__new__ : the args in input is expected to be a tuple !";
-          throw INTERP_KERNEL::Exception(oss.str().c_str());
-        }
-      T tt;
-      {
-        PyObject *tmp3(0);
-        try
-          {
-            tmp3=tt(zeNumpyRepr);
-          }
-        catch(INTERP_KERNEL::Exception& e)
-          {
-            std::ostringstream oss; oss << clsName << ".__new__ : Invalid type in input " << " : " << e.what();
-            throw INTERP_KERNEL::Exception(oss.str());
-          }
-        {
-          PyObject *tmp2(PyObject_CallObject(initMeth,tmp3));
-          Py_XDECREF(tmp2);
-        }
-        Py_DECREF(tmp3);
-      }
-      Py_DECREF(initMeth);
-    }
-  return instance;
-}
-
-struct SinglePyObjToBePutInATuple
-{
-  PyObject *operator()(PyObject *zeNumpyRepr)
-  {
-    PyObject *tmp3(PyTuple_New(1));
-    PyTuple_SetItem(tmp3,0,zeNumpyRepr); Py_XINCREF(zeNumpyRepr);
-    return tmp3;
-  }
-};
-
-struct SinglePyObjExpectToBeAListOfSz2
-{
-  PyObject *operator()(PyObject *uniqueElt)
-  {
-    if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
-      throw INTERP_KERNEL::Exception("Not a tuple of size 2 !");
-    Py_XINCREF(uniqueElt);
-    return uniqueElt;
-  }
-};
-
-static PyObject *NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(PyObject *cls, PyObject *args, const char *clsName)
-{
-  return NewMethWrapCallInitOnlyIfDictWithSingleEltInInputGeneral<SinglePyObjToBePutInATuple>(cls,args,clsName);
-}
-
 static PyObject *convertPartDefinition(MEDCoupling::PartDefinition *pd, int owner)
 {
   PyObject *ret=0;
@@ -2594,14 +2582,14 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
         {
           if(PyInt_Check(nbOfTuples))
             {
-              int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+              mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
               if(nbOfTuples1<0)
                 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
               if(elt2)
                 {
                   if(PyInt_Check(elt2))
                     {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
-                      int nbOfCompo=PyInt_AS_LONG(elt2);
+                      mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(elt2));
                       if(nbOfCompo<0)
                         throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
                       MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
@@ -2615,7 +2603,7 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
               else
                 {//DataArrayDouble.New([1.,3.,4.],3)
                   MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
-                  int tmpp1(-1);
+                  mcIdType tmpp1(-1);
                   std::vector<double> tmp(fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1));
                   ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
                   return ret.retn();
@@ -2627,7 +2615,7 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
       else
         {// DataArrayDouble.New([1.,3.,4.])
           MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
-          int tmpp1(-1),tmpp2(-1);
+          mcIdType tmpp1(-1),tmpp2(-1);
           std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
           ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
           return ret.retn();
@@ -2635,7 +2623,7 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
     }
   else if(PyInt_Check(elt0))
     {
-      int nbOfTuples1(PyInt_AS_LONG(elt0));
+      mcIdType nbOfTuples1(ToIdType(PyInt_AS_LONG(elt0)));
       if(nbOfTuples1<0)
         throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
       if(nbOfTuples)
@@ -2644,7 +2632,7 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
             {
               if(PyInt_Check(nbOfTuples))
                 {//DataArrayDouble.New(5,2)
-                  int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                  mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfTuples));
                   if(nbOfCompo<0)
                     throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
                   MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
@@ -2680,16 +2668,18 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
 {
   self->checkAllocated();
   const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
-  int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
-  int sw1,sw2;
+  mcIdType nbOfTuples(self->getNumberOfTuples());
+  int nbOfComponents((int)(self->getNumberOfComponents()));
+  mcIdType sw1,sw2;
   T i1;
   std::vector<T> v1;
   typename MEDCoupling::Traits<T>::ArrayType *d1=0;
   considerPyObjAsATStarLikeObject<T>(value,sw1,i1,v1,d1,ti);
-  int it1,ic1;
-  std::vector<int> vt1,vc1;
-  std::pair<int, std::pair<int,int> > pt1,pc1;
-  MEDCoupling::DataArrayInt *dt1=0,*dc1=0;
+  mcIdType it1,ic1;
+  std::vector<mcIdType> vt1;
+  std::vector<mcIdType> vc1;
+  std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+  MEDCoupling::DataArrayIdType *dt1=0,*dc1=0;
   convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
   MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > tmp;
   switch(sw2)
@@ -2703,7 +2693,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
             return self;
           case 3:
@@ -2723,7 +2713,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
             return self;
           case 3:
@@ -2743,7 +2733,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
             return self;
           case 3:
@@ -2763,7 +2753,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
             return self;
           case 3:
@@ -2783,7 +2773,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
             return self;
           case 3:
@@ -2803,7 +2793,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
             return self;
           case 3:
@@ -2823,7 +2813,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
             return self;
           case 3:
@@ -2843,7 +2833,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
             return self;
           case 3:
@@ -2863,7 +2853,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
             return self;
           case 3:
@@ -2883,7 +2873,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
             return self;
           case 3:
@@ -2903,7 +2893,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
             return self;
           case 3:
@@ -2923,7 +2913,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
             return self;
           case 3:
@@ -2943,7 +2933,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
             return self;
           case 3:
@@ -2963,7 +2953,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
             return self;
           case 3:
@@ -2983,7 +2973,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
             return self;
           case 3:
@@ -3003,7 +2993,7 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
             return self;
           case 2:
             tmp=MEDCoupling::Traits<T>::ArrayType::New();
-            tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+            tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
             self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
             return self;
           case 3:
@@ -3026,12 +3016,15 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
   const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
   const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
   self->checkAllocated();
-  int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
-  int it1,ic1;
-  std::vector<int> vt1,vc1;
-  std::pair<int, std::pair<int,int> > pt1,pc1;
-  MEDCoupling::DataArrayInt *dt1=0,*dc1=0;
-  int sw;
+  mcIdType nbOfTuples(self->getNumberOfTuples());
+  int nbOfComponents((int)(self->getNumberOfComponents()));
+  mcIdType it1;
+  std::size_t ic1;
+  std::vector<mcIdType> vt1;
+  std::vector<std::size_t> vc1;
+  std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+  MEDCoupling::DataArrayIdType *dt1=0,*dc1=0;
+  mcIdType sw;
   convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
   MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType > ret;
   switch(sw)
@@ -3051,19 +3044,19 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 6:
       {
         ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
-        std::vector<int> v2(1,ic1);
+        std::vector<std::size_t> v2(1,ic1);
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
       }
     case 7:
       {
         ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
-        std::vector<int> v2(1,ic1);
+        std::vector<std::size_t> v2(1,ic1);
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
       }
     case 8:
       {
         ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
-        std::vector<int> v2(1,ic1);
+        std::vector<std::size_t> v2(1,ic1);
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
       }
     case 9:
@@ -3089,17 +3082,17 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 13:
       {
         ret=self->selectByTupleIdSafe(&it1,&it1+1);
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
-        std::vector<int> v2(nbOfComp);
-        for(int i=0;i<nbOfComp;i++)
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        std::vector<std::size_t> v2(nbOfComp);
+        for(mcIdType i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
       }
     case 14:
       {
         ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
-        std::vector<int> v2(nbOfComp);
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        std::vector<std::size_t> v2(nbOfComp);
         for(int i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
@@ -3107,8 +3100,8 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 15:
       {
         ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
-        std::vector<int> v2(nbOfComp);
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        std::vector<std::size_t> v2(nbOfComp);
         for(int i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
@@ -3116,8 +3109,8 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 16:
       {
         ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
-        std::vector<int> v2(nbOfComp);
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        std::vector<std::size_t> v2(nbOfComp);
         for(int i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
         return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
@@ -3127,6 +3120,79 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     }
 }
 
+bool isCSRMatrix(PyObject *m)
+{
+#if defined(WITH_NUMPY) && defined(WITH_SCIPY)
+  PyObject* pdict(PyDict_New());
+  PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins());
+  PyObject *tmp(PyRun_String("from scipy.sparse import csr_matrix", Py_single_input, pdict, pdict));
+  if(!tmp)
+    throw INTERP_KERNEL::Exception("Problem during loading csr_matrix in scipy.sparse ! Is Scipy module available in present ?");
+  PyObject *csrMatrixCls=PyDict_GetItemString(pdict,"csr_matrix");
+  if(!csrMatrixCls)
+    throw INTERP_KERNEL::Exception("csr_matrix not found in scipy.sparse ! Is Scipy module available in present ?");
+  bool ret(PyObject_IsInstance(m,csrMatrixCls));
+  Py_DECREF(pdict); Py_XDECREF(tmp);
+  return ret;
+#else
+  return false;
+#endif
+}
+
+void convertCSR_MCDataToVectMapIntDouble(const MEDCoupling::DataArrayInt32 *indptrPtr, const MEDCoupling::DataArrayInt32 *indicesPtr, const MEDCoupling::DataArrayDouble *dataPtr, std::vector<std::map<mcIdType,double> >& mCpp)
+{
+  auto nbOfRows(indptrPtr->getNumberOfTuples()-1);
+  if(nbOfRows<0)
+    throw INTERP_KERNEL::Exception("pywrap of MEDCouplingRemapper::setMatrix : input CSR matrix looks bad regarding indptr array !");
+  mCpp.resize(nbOfRows);
+  auto indPtrCPtr(indptrPtr->begin());
+  auto indicesCPtr(indicesPtr->begin());
+  auto dataCPtr(dataPtr->begin());
+  for(auto i=0;i<nbOfRows;i++)
+    {
+      auto& line(mCpp[i]);
+      for(auto j=indPtrCPtr[i];j<indPtrCPtr[i+1];j++)
+        {
+          line[indicesCPtr[j]]=dataCPtr[j];
+        }
+    }
+}
+
+void convertToVectMapIntDouble(PyObject *pyobj, std::vector<std::map<mcIdType,double> >& mCpp)
+{
+  if(!PyList_Check(pyobj))
+    throw INTERP_KERNEL::Exception("convertToVectMapIntDouble : input is not a python list !");
+  mCpp.clear();
+  Py_ssize_t sz(PyList_Size(pyobj));
+  mCpp.resize(sz);
+  for(Py_ssize_t i=0;i<sz;i++)
+    {
+      PyObject *elt(PyList_GetItem(pyobj,i));
+      if(!PyDict_Check(elt))
+        {
+          std::ostringstream oss; oss << "convertToVectMapIntDouble : at pos # " << i << " of pylist a dict is exepect !";
+          throw INTERP_KERNEL::Exception(oss.str());
+        }
+      PyObject *key, *value;
+      Py_ssize_t pos(0);
+      std::map<mcIdType,double>& mapCpp(mCpp[i]);
+      while(PyDict_Next(elt,&pos,&key,&value))
+        {
+          if(!PyInt_Check(key))
+            {
+              std::ostringstream oss; oss << "convertToVectMapIntDouble : at pos # " << i << " of pylist the dict contains at pos " << pos << " a key not mappable to pyint !";
+              throw INTERP_KERNEL::Exception(oss.str());
+            }
+          if(!PyFloat_Check(value))
+            {
+              std::ostringstream oss; oss << "convertToVectMapIntDouble : at pos # " << i << " of pylist the dict contains at pos " << pos << " the value not mappable to pyfloat !";
+              throw INTERP_KERNEL::Exception(oss.str());
+            }
+          mapCpp[ToIdType(PyInt_AS_LONG(key))]=PyFloat_AS_DOUBLE(value);
+        }
+    }
+}
+
 template<class T>
 PyObject *DataArrayT_imul__internal(PyObject *trueSelf, PyObject *obj, typename MEDCoupling::Traits<T>::ArrayType *self, swig_type_info *ti_da, swig_type_info *ti_tuple)
 {
@@ -3135,7 +3201,7 @@ PyObject *DataArrayT_imul__internal(PyObject *trueSelf, PyObject *obj, typename
   typename MEDCoupling::Traits<T>::ArrayType *a;
   typename MEDCoupling::Traits<T>::ArrayTuple *aa;
   std::vector<T> bb;
-  int sw;
+  mcIdType sw;
   convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
   switch(sw)
     {
@@ -3160,7 +3226,7 @@ PyObject *DataArrayT_imul__internal(PyObject *trueSelf, PyObject *obj, typename
       }
     case 4:
       {
-        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
         self->multiplyEqual(aaa);
         Py_XINCREF(trueSelf);
         return trueSelf;
@@ -3178,7 +3244,7 @@ PyObject *DataArrayT_idiv__internal(PyObject *trueSelf, PyObject *obj, typename
   typename MEDCoupling::Traits<T>::ArrayType *a;
   typename MEDCoupling::Traits<T>::ArrayTuple *aa;
   std::vector<T> bb;
-  int sw;
+  mcIdType sw;
   convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
   switch(sw)
     {
@@ -3186,7 +3252,7 @@ PyObject *DataArrayT_idiv__internal(PyObject *trueSelf, PyObject *obj, typename
       {
         if(val==0.)
           throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
-        self->applyLin(1./val,0.);
+        self->applyLin((T)(1./val),(T)0.);
         Py_XINCREF(trueSelf);
         return trueSelf;
       }
@@ -3205,7 +3271,7 @@ PyObject *DataArrayT_idiv__internal(PyObject *trueSelf, PyObject *obj, typename
       }
     case 4:
       {
-        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
         self->divideEqual(aaa);
         Py_XINCREF(trueSelf);
         return trueSelf;
@@ -3223,7 +3289,7 @@ PyObject *DataArrayT_iadd__internal(PyObject *trueSelf, PyObject *obj, typename
   typename MEDCoupling::Traits<T>::ArrayType *a;
   typename MEDCoupling::Traits<T>::ArrayTuple *aa;
   std::vector<T> bb;
-  int sw;
+  mcIdType sw;
   convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
   switch(sw)
     {
@@ -3248,7 +3314,7 @@ PyObject *DataArrayT_iadd__internal(PyObject *trueSelf, PyObject *obj, typename
       }
     case 4:
       {
-        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
         self->addEqual(aaa);
         Py_XINCREF(trueSelf);
         return trueSelf;
@@ -3257,7 +3323,7 @@ PyObject *DataArrayT_iadd__internal(PyObject *trueSelf, PyObject *obj, typename
       throw INTERP_KERNEL::Exception(msg);
     }
 }
-  
+
 template<class T>
 PyObject *DataArrayT_isub__internal(PyObject *trueSelf, PyObject *obj, typename MEDCoupling::Traits<T>::ArrayType *self, swig_type_info *ti_da, swig_type_info *ti_tuple)
 {
@@ -3266,7 +3332,7 @@ PyObject *DataArrayT_isub__internal(PyObject *trueSelf, PyObject *obj, typename
   typename MEDCoupling::Traits<T>::ArrayType *a;
   typename MEDCoupling::Traits<T>::ArrayTuple *aa;
   std::vector<T> bb;
-  int sw;
+  mcIdType sw;
   convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
   switch(sw)
     {
@@ -3291,7 +3357,7 @@ PyObject *DataArrayT_isub__internal(PyObject *trueSelf, PyObject *obj, typename
       }
     case 4:
       {
-        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+        MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
         self->substractEqual(aaa);
         Py_XINCREF(trueSelf);
         return trueSelf;
@@ -3301,33 +3367,16 @@ PyObject *DataArrayT_isub__internal(PyObject *trueSelf, PyObject *obj, typename
     }
 }
 
-template<class T>
-struct SWIGTITraits
-{ };
-
-template<>
-struct SWIGTITraits<double>
-{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
-
-template<>
-struct SWIGTITraits<float>
-{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
-
-template<>
-struct SWIGTITraits<int>
-{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
-
-swig_type_info *SWIGTITraits<double>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<float>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<int>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<double>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<float>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<int>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-
+#ifdef WITH_NUMPY
 PyTypeObject *NPYTraits<double>::NPYFunc=&PyCallBackDataArrayDouble_RefType;
 
 PyTypeObject *NPYTraits<float>::NPYFunc=&PyCallBackDataArrayFloat_RefType;
 
+PyTypeObject *NPYTraits<int>::NPYFunc=&PyCallBackDataArrayInt32_RefType;
+
+PyTypeObject *NPYTraits<MEDCoupling::Int64>::NPYFunc=&PyCallBackDataArrayInt64_RefType;
+#endif
+
 template<class T>
 typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__(typename MEDCoupling::Traits<T>::ArrayType *self, PyObject *obj, PyObject *value)
 {
@@ -3364,4 +3413,37 @@ PyObject *DataArrayT_isub(PyObject *trueSelf, PyObject *obj, typename MEDCouplin
   return DataArrayT_isub__internal<T>(trueSelf,obj,self,SWIGTITraits<T>::TI,SWIGTITraits<T>::TI_TUPLE);
 }
 
+template<class T>
+typename MEDCoupling::Traits<T>::ArrayType *DataArrayFPT_rmul(typename MEDCoupling::Traits<T>::ArrayType *self, PyObject *obj)
+{
+  const char msg[]="Unexpected situation in __rmul__ !";
+  T val;
+  typename MEDCoupling::Traits<T>::ArrayType *a;
+  typename MEDCoupling::Traits<T>::ArrayTuple *aa;
+  std::vector<T> bb;
+  mcIdType sw;
+  convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,SWIGTITraits<T>::TI,SWIGTITraits<T>::TI_TUPLE);
+  switch(sw)
+    {
+    case 1:
+      {
+        typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> ret(self->deepCopy());
+        ret->applyLin(val,0.);
+        return ret.retn();
+      }
+    case 3:
+      {
+        typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> aaa(aa->buildDA(1,self->getNumberOfComponents()));
+        return MEDCoupling::Traits<T>::ArrayType::Multiply(self,aaa);
+      }
+    case 4:
+      {
+        typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
+        return MEDCoupling::Traits<T>::ArrayType::Multiply(self,aaa);
+      }
+    default:
+      throw INTERP_KERNEL::Exception(msg);
+    }
+}
+
 #endif