X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx;h=4eb8360cba2a12b811c0785ad12a30ace2d2aae3;hb=0b187729ac99d3e9e9bb9d2be8cb8600a783be6c;hp=d5adb95153dc0b8f832c1f9282f8f5b9ed2d6568;hpb=fb512e2b77325290aaa2b4c9fd8f22d5949b6369;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx index d5adb9515..4eb8360cb 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 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 @@ -52,6 +52,40 @@ MeshCollectionMedAsciiDriver::MeshCollectionMedAsciiDriver(MeshCollection* colle *\param filename ascii file containing the list of MED v2.3 files * */ +int MeshCollectionMedAsciiDriver::read(ParaMEDMEM::MEDFileData* filedata) +{ + readMEDFileData(filedata); + + std::vector cz; // to fill from filedata + std::vector cellglobal; + std::vector nodeglobal; + std::vector faceglobal; + int size = (_collection->getMesh()).size(); + cellglobal.resize(size); + nodeglobal.resize(size); + faceglobal.resize(size); + for ( int idomain = 0; idomain < size; ++idomain ) + { + cellglobal[idomain]=0; + faceglobal[idomain]=0; + nodeglobal[idomain]=0; + if ( (_collection->getMesh())[idomain] && (_collection->getMesh())[idomain]->getNumberOfNodes() > 0 ) + _collection->setNonEmptyMesh(idomain); + } + //creation of topology from mesh and connect zones + ParallelTopology* aPT = new ParallelTopology((_collection->getMesh()), cz, cellglobal, nodeglobal, faceglobal); + _collection->setTopology(aPT,true); + + return 0; +} + +/*!reads a MED File v>=2.3 + * and mounts the corresponding meshes in memory + * the connect zones are created from the joints + * + *\param filename ascii file containing the list of MED v2.3 files + * */ + int MeshCollectionMedAsciiDriver::read(const char* filename, ParaDomainSelector* domainSelector) { //distributed meshes @@ -105,7 +139,7 @@ int MeshCollectionMedAsciiDriver::read(const char* filename, ParaDomainSelector* throw INTERP_KERNEL::Exception("domain must be written from 1 to N in ASCII file descriptor"); } if ( !domainSelector || domainSelector->isMyDomain(i)) - readSubdomain(cellglobal,faceglobal,nodeglobal, i); + readSubdomain(i); } //loop on domains } //of try @@ -116,7 +150,7 @@ int MeshCollectionMedAsciiDriver::read(const char* filename, ParaDomainSelector* //creation of topology from mesh and connect zones ParallelTopology* aPT = new ParallelTopology((_collection->getMesh()), (_collection->getCZ()), cellglobal, nodeglobal, faceglobal); - _collection->setTopology(aPT); + _collection->setTopology(aPT, true); for (int i=0; i