Skip to content
Snippets Groups Projects
Commit 311723f6 authored by Michel Rasquin's avatar Michel Rasquin
Browse files

Fix element numbering for partitioned meshes in case uniqueness of element ids...

Fix element numbering for partitioned meshes in case uniqueness of element ids through all partitions is requested
parent 88b599fa
No related branches found
No related tags found
No related merge requests found
...@@ -1070,7 +1070,8 @@ int GModel::writePartitionedMSH(const std::string &baseName, bool binary, ...@@ -1070,7 +1070,8 @@ int GModel::writePartitionedMSH(const std::string &baseName, bool binary,
bool saveAll, bool saveParametric, bool saveAll, bool saveParametric,
double scalingFactor) double scalingFactor)
{ {
int index = 0; int numElements;
int startNum = 0;
for(std::set<int>::iterator it = meshPartitions.begin(); for(std::set<int>::iterator it = meshPartitions.begin();
it != meshPartitions.end(); it++){ it != meshPartitions.end(); it++){
int partition = *it; int partition = *it;
...@@ -1078,11 +1079,11 @@ int GModel::writePartitionedMSH(const std::string &baseName, bool binary, ...@@ -1078,11 +1079,11 @@ int GModel::writePartitionedMSH(const std::string &baseName, bool binary,
std::ostringstream sstream; std::ostringstream sstream;
sstream << baseName << "_" << std::setw(6) << std::setfill('0') << partition; sstream << baseName << "_" << std::setw(6) << std::setfill('0') << partition;
int startNum = index ? getNumElementsMSH(this, saveAll, partition) : 0; numElements = getNumElementsMSH(this, saveAll, partition);
Msg::Info("Writing partition %d in file '%s'", partition, sstream.str().c_str()); Msg::Info("Writing partition %d in file '%s'", partition, sstream.str().c_str());
_writeMSH2(sstream.str(), 2.2, binary, saveAll, saveParametric, _writeMSH2(sstream.str(), 2.2, binary, saveAll, saveParametric,
scalingFactor, startNum, partition); scalingFactor, startNum, partition);
index++; startNum += numElements; // update for next iteration in the loop
} }
#if 0 #if 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment