X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_MetisGraph.cxx;h=5c998b7236b22ed80e2e69ef2ad486a63b91df34;hb=b307fa3ee9c6d9e08082e2ccc832b28a17fd6d2c;hp=d91ceda7ff4a550b4a9ba5754b477afae0ce357e;hpb=1ca2b215a1ae474745fabc87dd9c5c98e9af6354;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx index d91ceda7f..5c998b723 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 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 @@ -21,6 +21,7 @@ #include "MEDPARTITIONER_ParaDomainSelector.hxx" #include "MEDPARTITIONER_Utils.hxx" +#include "MEDCouplingSkyLineArray.hxx" #include "InterpKernelException.hxx" #include @@ -36,7 +37,7 @@ METISGraph::METISGraph():Graph() { } -METISGraph::METISGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight) +METISGraph::METISGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight) :Graph(graph,edgeweight) { } @@ -54,10 +55,17 @@ void METISGraph::partGraph(int ndomain, std::cout << "proc " << MyGlobals::_Rank << " : METISGraph::partGraph" << std::endl; //number of graph vertices - int n=_graph->getNumberOf(); + int n=FromIdType(_graph->getNumberOf()); //graph +#ifdef MEDCOUPLING_USE_64BIT_IDS + std::vector indexVec( _graph->getIndex(), _graph->getIndexArray()->end() ); + std::vector valueVec( _graph->getValues(), _graph->getValuesArray()->end() ); + int * xadj=indexVec.data(); + int * adjncy=valueVec.data(); +#else int * xadj=const_cast(_graph->getIndex()); - int * adjncy=const_cast(_graph->getValue()); + int * adjncy=const_cast(_graph->getValues()); +#endif //constraints int * vwgt=_cell_weight; int * adjwgt=_edge_weight; @@ -99,20 +107,20 @@ void METISGraph::partGraph(int ndomain, for (int i=0; i index(n+1); - vector value(n); + vector index(n+1); + vector value(n); index[0]=0; for (int i=0; i