Salome HOME
Indices are stored as mcIdType type instead of int to support switch to 64bits indexing
[tools/medcoupling.git] / src / INTERP_KERNEL / Interpolation3D1D.txx
old mode 100644 (file)
new mode 100755 (executable)
index 15d100d..9bc67b3
@@ -39,27 +39,27 @@ namespace INTERP_KERNEL
    *  adjusted in a similar fashion as in InterpolationPlanar::performAdjustmentOfBB()
    **/
   template<class MyMeshType, class MatrixType>
-  int Interpolation3D1D::interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const std::string& method)
+  typename MyMeshType::MyConnType Interpolation3D1D::interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const std::string& method)
   {
     if(InterpolationOptions::getIntersectionType() != PointLocator)
       INTERP_KERNEL::Exception("Invalid 3D/1D intersection type specified : must be PointLocator.");
 
     typedef typename MyMeshType::MyConnType ConnType;
     // create MeshElement objects corresponding to each element of the two meshes
-    const unsigned long numSrcElems = srcMesh.getNumberOfElements();
-    const unsigned long numTargetElems = targetMesh.getNumberOfElements();
+    const ConnType numSrcElems = srcMesh.getNumberOfElements();
+    const ConnType numTargetElems = targetMesh.getNumberOfElements();
 
     LOG(2, "Source mesh has " << numSrcElems << " elements and target mesh has " << numTargetElems << " elements ");
 
     std::vector<MeshElement<ConnType>*> srcElems(numSrcElems);
     std::vector<MeshElement<ConnType>*> targetElems(numTargetElems);
 
-    std::map<MeshElement<ConnType>*, int> indices;
+    std::map<MeshElement<ConnType>*, ConnType> indices;
 
-    for(unsigned long i = 0 ; i < numSrcElems ; ++i)
+    for(ConnType i = 0 ; i < numSrcElems ; ++i)
       srcElems[i] = new MeshElement<ConnType>(i, srcMesh);       
 
-    for(unsigned long i = 0 ; i < numTargetElems ; ++i)
+    for(ConnType i = 0 ; i < numTargetElems ; ++i)
       targetElems[i] = new MeshElement<ConnType>(i, targetMesh);
 
     Intersector3D<MyMeshType,MatrixType>* intersector=0;
@@ -84,8 +84,8 @@ namespace INTERP_KERNEL
     // create BBTree structure
     // - get bounding boxes
     std::vector<double> bboxes(6*numSrcElems);
-    int* srcElemIdx = new int[numSrcElems];
-    for(unsigned long i = 0; i < numSrcElems ; ++i)
+    ConnType* srcElemIdx = new ConnType[numSrcElems];
+    for(ConnType i = 0; i < numSrcElems ; ++i)
       {
         // get source bboxes in right order
         const BoundingBox* box = srcElems[i]->getBoundingBox();
@@ -107,10 +107,10 @@ namespace INTERP_KERNEL
 
     // for each target element, get source elements with which to calculate intersection
     // - calculate intersection by calling intersectCells
-    for(unsigned long i = 0; i < numTargetElems; ++i)
+    for(ConnType i = 0; i < numTargetElems; ++i)
       {
         const BoundingBox* box = targetElems[i]->getBoundingBox();
-        const int targetIdx = targetElems[i]->getIndex();
+        const ConnType targetIdx = targetElems[i]->getIndex();
 
         // get target bbox in right order
         double targetBox[6];
@@ -132,15 +132,15 @@ namespace INTERP_KERNEL
     // free allocated memory
     delete [] srcElemIdx;
 
-    int ret=intersector->getNumberOfColsOfResMatrix();
+    ConnType ret=intersector->getNumberOfColsOfResMatrix();
 
     delete intersector;
 
-    for(unsigned long i = 0 ; i < numSrcElems ; ++i)
+    for(ConnType i = 0 ; i < numSrcElems ; ++i)
       {
         delete srcElems[i];
       }
-    for(unsigned long i = 0 ; i < numTargetElems ; ++i)
+    for(ConnType i = 0 ; i < numTargetElems ; ++i)
       {
         delete targetElems[i];
       }