Salome HOME
Merge branch 'master' of https://git.salome-platform.org/git/tools/medcoupling
[tools/medcoupling.git] / src / MEDPartitioner / MEDPARTITIONER_MEDPartitioner.cxx
index 57e9ae919df93631c4bd994cc5304ede3235e2a0..6ea40a0e6a931d31e57ba4008dbe8fae12c3b138 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  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
 #include "MEDPARTITIONER_ParallelTopology.hxx"
 #include "MEDPARTITIONER_Utils.hxx"
 #include "MEDPARTITIONER_Graph.hxx"
-#include "MEDPARTITIONER_MetisGraph.hxx"
-#include "MEDPARTITIONER_ScotchGraph.hxx"
+#ifdef MED_ENABLE_METIS
+#  include "MEDPARTITIONER_MetisGraph.hxx"
+#endif
+#ifdef MED_ENABLE_SCOTCH
+#  include "MEDPARTITIONER_ScotchGraph.hxx"
+#endif
 #include "MEDPARTITIONER_MeshCollectionDriver.hxx"
 
 #include "MEDCouplingUMesh.hxx"
@@ -55,7 +59,7 @@ MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const std::string& filename, int
   parallelizer.evaluateMemory();
 }
 
-MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory):
+MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const MEDCoupling::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory):
   _input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 )
 {
   MyGlobals::_World_Size = 1;
@@ -77,7 +81,7 @@ MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* fi
   parallelizer.evaluateMemory();
 }
 
-MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, MEDPARTITIONER ::Graph* graph, bool creates_boundary_faces, bool create_joints, bool mesure_memory):
+MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const MEDCoupling::MEDFileData* filedata, MEDPARTITIONER ::Graph* graph, bool creates_boundary_faces, bool create_joints, bool mesure_memory):
   _input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 )
 {
   MyGlobals::_World_Size = 1;
@@ -128,15 +132,16 @@ void MEDPARTITIONER::MEDPartitioner::write(const std::string& filename)
   parallelizer.evaluateMemory();
 }
 
-ParaMEDMEM::MEDFileData* MEDPARTITIONER::MEDPartitioner::getMEDFileData()
+MEDCoupling::MEDFileData* MEDPARTITIONER::MEDPartitioner::getMEDFileData()
 {
   return _output_collection->retrieveDriver()->getMEDFileData();
 }
 
-MEDPARTITIONER::Graph* MEDPARTITIONER::MEDPartitioner::Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split, int* edgeweight)
+MEDPARTITIONER::Graph* MEDPARTITIONER::MEDPartitioner::Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split, int* edgeweight)
 {
   MEDPARTITIONER::Graph* cellGraph=0;
-  ParaMEDMEM::MEDCouplingSkyLineArray* arr = new ParaMEDMEM::MEDCouplingSkyLineArray(graph->getIndexArray(), graph->getValueArray());
+  // will be destroyed by XXXGraph class:
+  MEDCoupling::MEDCouplingSkyLineArray* arr = MEDCoupling::MEDCouplingSkyLineArray::New(graph->getIndexArray(), graph->getValuesArray());
   switch (split)
     {
     case Graph::METIS: