]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
API change of DECs constructors.
authorageay <ageay>
Mon, 28 Jun 2010 12:58:44 +0000 (12:58 +0000)
committerageay <ageay>
Mon, 28 Jun 2010 12:58:44 +0000 (12:58 +0000)
src/ParaMEDMEM/DEC.cxx
src/ParaMEDMEM/DEC.hxx
src/ParaMEDMEM/InterpKernelDEC.cxx
src/ParaMEDMEM/InterpKernelDEC.hxx

index 32bcc69ea1e71725e41520f90cfc3143a76df86a..d8256bdc034ea94cf55fb57f0985bb684be98cfc 100644 (file)
@@ -85,8 +85,7 @@ namespace ParaMEDMEM
     _union_group = source_group.fuse(target_group);  
   }
 
-  DEC::DEC(const int *src_ids_bg, const int *src_ids_end,
-           const int *trg_ids_bg, const int *trg_ids_end,
+  DEC::DEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
            const MPI_Comm& world_comm):_local_field(0), 
                                        _owns_field(false),
                                        _owns_groups(true),
@@ -94,10 +93,10 @@ namespace ParaMEDMEM
   {
     ParaMEDMEM::CommInterface comm;
     // Create the list of procs including source and target
-    int nbOfProcsInComm=std::distance(src_ids_bg,src_ids_end)+std::distance(trg_ids_bg,trg_ids_end);
+    int nbOfProcsInComm=src_ids.size()+trg_ids.size();
     int *allRanks=new int[nbOfProcsInComm];
-    std::copy(src_ids_bg,src_ids_end,allRanks);
-    std::copy(trg_ids_bg,trg_ids_end,allRanks+std::distance(src_ids_bg,src_ids_end));
+    std::copy(src_ids.begin(),src_ids.end(),allRanks);
+    std::copy(trg_ids.begin(),trg_ids.end(),allRanks+src_ids.size());
     // Create a communicator on these procs
     MPI_Group src_trg_group, world_group;
     comm.commGroup(world_comm,&world_group);
@@ -113,12 +112,10 @@ namespace ParaMEDMEM
         _union_group=0;
         return;
       }
-    std::set<int> source_ids(src_ids_bg,src_ids_end);
-    _source_group=new MPIProcessorGroup(comm,source_ids,src_trg_comm);
-    std::set<int> target_ids(trg_ids_bg,trg_ids_end);
-    _target_group=new MPIProcessorGroup(comm,target_ids,src_trg_comm);
-    std::set<int> src_trg_ids(src_ids_bg,src_ids_end);
-    src_trg_ids.insert(trg_ids_bg,trg_ids_end);
+    _source_group=new MPIProcessorGroup(comm,src_ids,src_trg_comm);
+    _target_group=new MPIProcessorGroup(comm,trg_ids,src_trg_comm);
+    std::set<int> src_trg_ids(src_ids);
+    src_trg_ids.insert(trg_ids.begin(),trg_ids.end());
     _union_group=new MPIProcessorGroup(comm,src_trg_ids,src_trg_comm);
   }
 
index e6082516825fda38a8f3f3c23a2993197ca1b7e0..7054c2fd2b38249f03fbdc56bbefe1d7acd465ed 100644 (file)
@@ -39,8 +39,7 @@ namespace ParaMEDMEM
   public:
     DEC():_local_field(0) { }
     DEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
-    DEC(const int *src_ids_bg, const int *src_ids_end,
-        const int *trg_ids_bg, const int *trg_ids_end,
+    DEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
         const MPI_Comm& world_comm=MPI_COMM_WORLD);
     void setNature(NatureOfField nature);
     void attachLocalField( MEDCouplingFieldDouble* field);
index 1eb5a243edb00121fa7c53e8b8ffa1687d75e74c..3545092bfd387f80c36aaf41bde564d89d00c06d 100644 (file)
@@ -123,9 +123,8 @@ namespace ParaMEDMEM
 
   }
 
-  InterpKernelDEC::InterpKernelDEC(const int *src_ids_bg, const int *src_ids_end,
-                                   const int *trg_ids_bg, const int *trg_ids_end,
-                                   const MPI_Comm& world_comm):DEC(src_ids_bg,src_ids_end,trg_ids_bg,trg_ids_end,world_comm),
+  InterpKernelDEC::InterpKernelDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
+                                   const MPI_Comm& world_comm):DEC(src_ids,trg_ids,world_comm),
                                                                _interpolation_matrix(0)
   {
   }
index 908f21700772f5802c6a91f404d6e97ceffec163..7930a044d8022d2ed5357c217c106f88d43b5cc1 100644 (file)
@@ -33,8 +33,7 @@ namespace ParaMEDMEM
   public:  
     InterpKernelDEC();
     InterpKernelDEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
-    InterpKernelDEC(const int *src_ids_bg, const int *src_ids_end,
-                    const int *trg_ids_bg, const int *trg_ids_end,
+    InterpKernelDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
                     const MPI_Comm& world_comm=MPI_COMM_WORLD);
     virtual ~InterpKernelDEC();
     void synchronize();