X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_MetisGraph.cxx;h=6f20908ee86c10200474fe49e886bf904f372e95;hb=bb91878b3fb670041c09ea7aefce3132e157b126;hp=2c33ad1d3ccd15f4572ae83a9e8decbf5a2261b8;hpb=659f8c67d0348350e12fde38fe8c4de1ff95dffe;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx index 2c33ad1d3..6f20908ee 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2019 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(MEDPARTITIONER::SkyLineArray* 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