X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_MeshCollectionMedXmlDriver.cxx;h=bcd9138cb613e052bd11caccc5f4f97385166a9b;hb=ffb8188e28b2b60ee207a8644286821bc4e8fcdc;hp=252ab0212fe6fee31b2e4afea1ec3fbcf065f08a;hpb=3c911ce36f5caa779ea60042e738fa57671a44b1;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx index 252ab0212..bcd9138cb 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 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 @@ -169,7 +169,7 @@ int MeshCollectionMedXmlDriver::read(const char* filename, ParaDomainSelector* d //to know nb of cells on each proc to compute global cell ids from locally global domainSelector->gatherNbOf(_collection->getMesh()); } - _collection->setTopology(aPT); + _collection->setTopology(aPT, true); _collection->setDomainNames(_collection->getName()); return 0; } @@ -242,10 +242,22 @@ void MeshCollectionMedXmlDriver::write(const char* filename, ParaDomainSelector* xmlNodePtr mesh_node = xmlNewChild(node, 0, BAD_CAST "mesh",0); xmlNewProp(mesh_node, BAD_CAST "name", BAD_CAST _collection->getName().c_str()); - int nbdomains= _collection->getMesh().size(); + int nbdomains= _collection->getNbOfGlobalMeshes(); //loop on the domains - std::string finalMeshName=ExtractFromDescription(MyGlobals::_General_Informations[0], "finalMeshName="); + std::string finalMeshName=""; + if (MyGlobals::_General_Informations.size()!=0) + { + std::size_t found=MyGlobals::_General_Informations[0].find("finalMeshName="); + if ((found!=std::string::npos) && (found>0)) + { + finalMeshName=ExtractFromDescription(MyGlobals::_General_Informations[0], "finalMeshName="); + } + } + if (finalMeshName.empty()) + { + finalMeshName=_collection->getName(); + } for (int idomain=nbdomains-1; idomain>=0;idomain--) { std::string distfilename; @@ -277,7 +289,7 @@ void MeshCollectionMedXmlDriver::write(const char* filename, ParaDomainSelector* node = xmlNewChild(mesh_node,0, BAD_CAST "chunk",0); xmlNewProp(node, BAD_CAST "subdomain", BAD_CAST buff); xmlNewChild(node,0,BAD_CAST "name", BAD_CAST finalMeshName.c_str()); - //xmlNewChild(node,0,BAD_CAST "name", BAD_CAST (_collection->getMesh())[idomain]->getName()); + //xmlNewChild(node,0,BAD_CAST "name", BAD_CAST ((_collection->getMesh())[idomain]->getName()).c_str()); } }