Salome HOME
Fix: getCellsContainingPoints() in case of polyhedron with a face containing colinear...
[tools/medcoupling.git] / src / MEDPartitioner / MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx
index 7d17c8aceb133c974b1de530b20fdc9b74552e74..d200a1121e92845e78caa190073ae47557b92af6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -58,14 +58,14 @@ int MeshCollectionMedAsciiDriver::read(MEDCoupling::MEDFileData* filedata)
   readMEDFileData(filedata);
 
   std::vector<MEDPARTITIONER::ConnectZone*> cz; // to fill from filedata
-  std::vector<int*> cellglobal;
-  std::vector<int*> nodeglobal;
-  std::vector<int*> faceglobal;
-  int size = (_collection->getMesh()).size();
+  std::vector<mcIdType*> cellglobal;
+  std::vector<mcIdType*> nodeglobal;
+  std::vector<mcIdType*> faceglobal;
+  std::size_t size = _collection->getMesh().size();
   cellglobal.resize(size);
   nodeglobal.resize(size);
   faceglobal.resize(size);
-  for ( int idomain = 0; idomain < size; ++idomain )
+  for ( unsigned int idomain = 0; idomain < size; ++idomain )
     {
       cellglobal[idomain]=0;
       faceglobal[idomain]=0;
@@ -90,9 +90,9 @@ int MeshCollectionMedAsciiDriver::read(MEDCoupling::MEDFileData* filedata)
 int MeshCollectionMedAsciiDriver::read(const char* filename, ParaDomainSelector* domainSelector)
 {
   //distributed meshes
-  std::vector<int*> cellglobal;
-  std::vector<int*> nodeglobal;
-  std::vector<int*> faceglobal;
+  std::vector<mcIdType*> cellglobal;
+  std::vector<mcIdType*> nodeglobal;
+  std::vector<mcIdType*> faceglobal;
   int nbdomain;
 
   //reading ascii master file
@@ -168,12 +168,12 @@ int MeshCollectionMedAsciiDriver::read(const char* filename, ParaDomainSelector*
  */
 void MeshCollectionMedAsciiDriver::write(const char* filename, ParaDomainSelector* domainSelector) const
 {
-  int nbdomains=_collection->getMesh().size();
+  std::size_t nbdomains=_collection->getMesh().size();
   std::vector<std::string> filenames;
   filenames.resize(nbdomains);
 
   //loop on the domains
-  for (int idomain=0; idomain<nbdomains; idomain++)
+  for (unsigned idomain=0; idomain<nbdomains; idomain++)
     {
       std::string distfilename;
       std::ostringstream suffix;
@@ -183,7 +183,8 @@ void MeshCollectionMedAsciiDriver::write(const char* filename, ParaDomainSelecto
 
       if ( !domainSelector || domainSelector->isMyDomain( idomain ) )
         {
-          if ( !_collection->getMesh()[idomain]->getNumberOfCells()==0 ) continue;//empty domain
+          // [ABN] spurious test in 8.2 - fixed as I think it should be:
+          if ( _collection->getMesh()[idomain]->getNumberOfCells() == 0 ) continue;
           WriteUMesh(distfilename.c_str(),(_collection->getMesh())[idomain],true);
           //writeSubdomain(idomain, nbdomains, distfilename.c_str(), domainSelector);
         }
@@ -197,7 +198,7 @@ void MeshCollectionMedAsciiDriver::write(const char* filename, ParaDomainSelecto
       file << "#" << " " << std::endl;
       file << _collection->getMesh().size() << " " << std::endl;
 
-      for (int idomain=0; idomain<nbdomains; idomain++)
+      for (std::size_t idomain=0; idomain<nbdomains; idomain++)
         file << _collection->getName() <<" "<< idomain+1 << " "
              << (_collection->getMesh())[idomain]->getName() << " localhost "
              << filenames[idomain] << " "<< std::endl;