X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMEDPartitioner%2FMEDPARTITIONER_Graph.hxx;h=a2f56a0f0be75182eb74a0fdbd0d7c9f04eb3f93;hb=1b5fb5650409b0ad3a61da3215496f2adf2dae02;hp=12227bdb013491b423e64f38f3bcb8e05a69a56b;hpb=ec2cb33155cef66242cfd257d2bfd2e50ee99170;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx b/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx index 12227bdb0..a2f56a0f0 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -21,25 +21,29 @@ #define __MEDPARTITIONER_GRAPH_HXX__ #include "MEDPARTITIONER.hxx" +#include "MCAuto.hxx" +#include "MCType.hxx" #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingSkyLineArray; } +using namespace MEDCoupling; + namespace MEDPARTITIONER { class ParaDomainSelector; class MEDPARTITIONER_EXPORT Graph { public: - typedef enum {METIS,SCOTCH} splitter_type; + typedef enum {METIS,SCOTCH,PTSCOTCH} splitter_type; - Graph(){}; - //creates a graph from a SKYLINEARRAY - Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight=0); + Graph(); + //creates a graph from a SKYLINEARRAY- WARNING!! Graph takes ownership of the array. + Graph(MEDCouplingSkyLineArray* graph, int* edgeweight=0); virtual ~Graph(); void setEdgesWeights(int *edgeweight) { _edge_weight=edgeweight; } @@ -49,20 +53,20 @@ namespace MEDPARTITIONER virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) = 0; //returns the partitioning - const int *getPart() const; + const mcIdType *getPart() const; //returns the number of graph vertices (which can correspond to the cells in the mesh!) - int nbVertices() const; + mcIdType nbVertices() const; // returns nb of domains in _partition int nbDomains() const; - - const ParaMEDMEM::MEDCouplingSkyLineArray *getGraph() const { return _graph; } - const ParaMEDMEM::MEDCouplingSkyLineArray *getPartition() const { return _partition; } + + const MEDCouplingSkyLineArray *getGraph() const { return (const MEDCouplingSkyLineArray*)_graph; } + const MEDCouplingSkyLineArray *getPartition() const { return (const MEDCouplingSkyLineArray*)_partition; } protected: - ParaMEDMEM::MEDCouplingSkyLineArray* _graph; - ParaMEDMEM::MEDCouplingSkyLineArray* _partition; + MCAuto _graph; + MCAuto _partition; int* _edge_weight; int* _cell_weight; };