X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FRENUMBER%2FRENUMBER_METISRenumbering.cxx;h=b89d793e53ffa61f68b41239a5f2dc0a87abfc95;hb=c4551c56aa89896595842e5b41b048044681b4e8;hp=ca07cf8dc6043fb2354e85209b10db458fbf6cc8;hpb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;p=tools%2Fmedcoupling.git diff --git a/src/RENUMBER/RENUMBER_METISRenumbering.cxx b/src/RENUMBER/RENUMBER_METISRenumbering.cxx index ca07cf8dc..b89d793e5 100644 --- a/src/RENUMBER/RENUMBER_METISRenumbering.cxx +++ b/src/RENUMBER/RENUMBER_METISRenumbering.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 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 @@ -28,13 +28,18 @@ extern "C" #include "metis.h" } +#include "MEDCouplingMemArray.hxx" +#include "MCAuto.hxx" + #include "RENUMBER_METISRenumbering.hxx" -void METISRenumbering::renumber(const int* graph,const int* index_graph,int nb_cell,std::vector& iperm,std::vector& perm) +void METISRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm) { - iperm.resize(nb_cell,0); - perm.resize(nb_cell,0); + MEDCoupling::MCAuto out0(MEDCoupling::DataArrayInt::New()),out1(MEDCoupling::DataArrayInt::New()); + out0->alloc(nbCell,1); out1->alloc(nbCell,1); + out0->fillWithZero(); out1->fillWithZero(); int num_flag=1; int options=0; - METIS_NodeND(&nb_cell,(int*)index_graph,(int*)graph,&num_flag,&options,&iperm[0],&perm[0]); + METIS_NodeND(&nbCell,(int*)index_graph,(int*)graph,&num_flag,&options,out0->getPointer(),out1->getPointer()); + iperm=out0.retn(); perm=out1.retn(); }