Salome HOME
[EDF21269] : Reproduce PTScotch graph split between independant runs
[tools/medcoupling.git] / src / ParaMEDLoader / ParaMEDLoader.cxx
index 9f00d463aced1238bd2e571239e9ccbb807d6347..dbd238af10989506f8f22812baa6da6314fdd68b 100644 (file)
@@ -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
 #include "MEDCouplingUMesh.hxx"
 
 #include <fstream>
+#include <sstream>
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 ParaMEDLoader::ParaMEDLoader()
 {
 }
 
-void ParaMEDLoader::WriteParaMesh(const char *fileName, ParaMEDMEM::ParaMESH *mesh)
+void ParaMEDLoader::WriteParaMesh(const char *fileName, MEDCoupling::ParaMESH *mesh)
 {
   if(!mesh->getBlockTopology()->getProcGroup()->containsMyRank())
     return ;
@@ -47,7 +48,7 @@ void ParaMEDLoader::WriteParaMesh(const char *fileName, ParaMEDMEM::ParaMESH *me
     }
   if(myRank==0)
     WriteMasterFile(fileName,fileNames,mesh->getCellMesh()->getName().c_str());
-  MEDLoader::WriteUMesh(fileNames[myRank].c_str(),dynamic_cast<MEDCouplingUMesh *>(mesh->getCellMesh()),true);
+  WriteUMesh(fileNames[myRank].c_str(),dynamic_cast<MEDCouplingUMesh *>(mesh->getCellMesh()),true);
 }
 
 /*!
@@ -55,11 +56,11 @@ void ParaMEDLoader::WriteParaMesh(const char *fileName, ParaMEDMEM::ParaMESH *me
  */
 void ParaMEDLoader::WriteMasterFile(const char *fileName, const std::vector<std::string>& fileNames, const char *meshName)
 {
-  int nbOfDom=fileNames.size();
+  std::size_t nbOfDom=fileNames.size();
   std::ofstream fs(fileName);
   fs << "#MED Fichier V 2.3" << " " << std::endl;
   fs << "#"<<" " << std::endl;
   fs << nbOfDom <<" " << std::endl;
-  for(int i=0;i<nbOfDom;i++)
+  for(std::size_t i=0;i<nbOfDom;i++)
     fs << meshName << " " << i+1 << " " << meshName << "_" << i+1 << " localhost " << fileNames[i] << " " << std::endl;
 }