Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/medcoupling
[tools/medcoupling.git] / src / MEDPartitioner / MEDPARTITIONER_ParaDomainSelector.hxx
index cfe465a9a8d10a89992b10d3b379ff3a7eefeaa8..e5009e39378584bb274430a096f795c8a5f59261 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  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
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #define __MEDPARTITIONER_PARADOMAINSELECTOR_HXX__
 
 #include "MEDPARTITIONER.hxx"
+#include "MCType.hxx"
 
 #include <memory>
 #include <vector>
 
-namespace ParaMEDMEM
+namespace MEDCoupling
 {
   class MEDCouplingUMesh;
 }
@@ -59,35 +60,35 @@ namespace MEDPARTITIONER
     //identifier for a joint
     int jointId( int local_domain, int distant_domain ) const;
   
-    int getNbTotalCells() { return _cell_shift_by_domain.back(); }
-    int getNbTotalNodes() { return _node_shift_by_domain.back(); };
-    int getNbTotalFaces() { return _face_shift_by_domain.back(); };
+    mcIdType getNbTotalCells() { return _cell_shift_by_domain.back(); }
+    mcIdType getNbTotalNodes() { return _node_shift_by_domain.back(); };
+    mcIdType getNbTotalFaces() { return _face_shift_by_domain.back(); };
 
     //Collect nb of entities on procs
-    void gatherNbOf(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>& domain_meshes);
+    void gatherNbOf(const std::vector<MEDCoupling::MEDCouplingUMesh*>& domain_meshes);
   
     //distribution of the graph vertices among the processors
-    int* getProcVtxdist() const;
+    mcIdType* getProcVtxdist() const;
 
     //nb of nodes on processors with lower rank
-    int getProcNodeShift() const;
+    mcIdType getProcNodeShift() const;
     //nb of cells in domains with lower index
-    int getDomainCellShift(int domainIndex) const;
+    mcIdType getDomainCellShift(int domainIndex) const;
     //nb of nodes in domains with lower index
-    int getDomainNodeShift(int domainIndex) const;
+    mcIdType getDomainNodeShift(int domainIndex) const;
 
     //Gather graphs from all processors into one
-    std::auto_ptr<Graph> gatherGraph(const Graph* graph) const;
+    std::unique_ptr<Graph> gatherGraph(const Graph* graph) const;
 
     //Set nb of cell/cell pairs in a joint between domains
-    void setNbCellPairs( int nb_cell_pairs, int dist_domain, int loc_domain );
+    void setNbCellPairs( mcIdType nb_cell_pairs, int dist_domain, int loc_domain );
     //Gather size of each proc/proc joint
     void gatherNbCellPairs();
     //nb of cell/cell pairs in a joint between domains on different procs
-    int getNbCellPairs( int dist_domain, int loc_domain ) const;
+    mcIdType getNbCellPairs( int dist_domain, int loc_domain ) const;
 
     //get the first global id of sub-entity for the joint
-    int getFisrtGlobalIdOfSubentity( int loc_domain, int dist_domain ) const;
+    mcIdType getFisrtGlobalIdOfSubentity( int loc_domain, int dist_domain ) const;
     //Send-receive local ids of joint faces
     int* exchangeSubentityIds( int loc_domain, int dist_domain,
                                const std::vector<int>& loc_ids_here ) const;
@@ -97,18 +98,18 @@ namespace MEDPARTITIONER
     //Evaluate current memory usage and return the maximal one in KB
     int evaluateMemory() const;
 
-    void sendMesh(const ParaMEDMEM::MEDCouplingUMesh& mesh, int target) const;
-    void recvMesh(ParaMEDMEM::MEDCouplingUMesh*& mesh, int source) const;
+    void sendMesh(const MEDCoupling::MEDCouplingUMesh& mesh, int target) const;
+    void recvMesh(MEDCoupling::MEDCouplingUMesh*& mesh, int source) const;
   private:
     int _rank; //my rank
     int _world_size; //nb of processors
     int _nb_result_domains; //required nb of domains
 
-    std::vector< int > _nb_cell_pairs_by_joint;
-    std::vector< int > _nb_vert_of_procs; //graph vertices
-    std::vector< int > _cell_shift_by_domain;
-    std::vector< int > _node_shift_by_domain;
-    std::vector< int > _face_shift_by_domain;
+    std::vector< mcIdType > _nb_cell_pairs_by_joint;
+    std::vector< mcIdType > _nb_vert_of_procs; //graph vertices
+    std::vector< mcIdType > _cell_shift_by_domain;
+    std::vector< mcIdType > _node_shift_by_domain;
+    std::vector< mcIdType > _face_shift_by_domain;
 
     double _init_time;
     bool _mesure_memory;