]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
improve algorithm
authorsecher <secher>
Wed, 11 Mar 2009 13:56:01 +0000 (13:56 +0000)
committersecher <secher>
Wed, 11 Mar 2009 13:56:01 +0000 (13:56 +0000)
src/ParaMEDMEM/InterpolationMatrix.cxx
src/ParaMEDMEM/InterpolationMatrix.hxx

index e4605258cc76e05e5f41f7af9e9574de3f7a3da6..162251141329dbbe6bb8d3dc0df84038cc3405cc 100644 (file)
@@ -182,9 +182,7 @@ namespace ParaMEDMEM
             double surf = target_triangle_surf->getIJ(iter->first,0);
 
             //locating the (iproc, itriangle) pair in the list of columns
-            vector<pair<int,int> >::iterator iter2 =
-              find(_col_offsets.begin(), _col_offsets.end(),
-                   make_pair(iproc_distant,iter->first));
+            map<pair<int,int>,int >::iterator iter2 = _col_offsets.find(make_pair(iproc_distant,iter->first));
             int col_id;
 
             if (iter2 == _col_offsets.end())
@@ -192,15 +190,15 @@ namespace ParaMEDMEM
                 //(iproc, itriangle) is not registered in the list
                 //of distant elements
 
-                _col_offsets.push_back(make_pair(iproc_distant,iter->first));
-                col_id =_col_offsets.size();
+                col_id =_col_offsets.size()+1;
+                _col_offsets.insert(make_pair(make_pair(iproc_distant,iter->first),col_id));
                 _mapping.addElementFromSource(iproc_distant,
                                               distant_elems[iter->first]);
                 _target_volume.push_back(surf);
               }
             else 
               {
-                col_id = iter2 - _col_offsets.begin() + 1;
+                col_id = iter2->second;
               }
 
             //the non zero coefficient is stored 
index c0c6984a869a0ecd05c5fb1efd121caf5ac3e678..1c89069847c45890b1b4913e732e041e23cc96e1 100644 (file)
@@ -51,7 +51,7 @@ namespace ParaMEDMEM
     static MEDCouplingFieldDouble *getSupportUnstructuredVolumes(MEDCouplingUMesh *field);
   private:
     std::vector<int> _row_offsets;
-    std::vector<std::pair<int,int> > _col_offsets;
+    std::map<std::pair<int,int>, int > _col_offsets;
     MEDCouplingUMesh *_source_support; 
     MxN_Mapping _mapping;