Skip to content
Snippets Groups Projects
Commit e46b0756 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix 2

parent afce5285
Branches
Tags
No related merge requests found
...@@ -577,6 +577,7 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b ...@@ -577,6 +577,7 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b
if(!pos.insert(vertices[i])) if(!pos.insert(vertices[i]))
unique.push_back(vertices[i]); unique.push_back(vertices[i]);
} }
vertices.clear();
std::map<MVertex *, nodeData> vertexData; std::map<MVertex *, nodeData> vertexData;
...@@ -654,9 +655,8 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b ...@@ -654,9 +655,8 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b
fprintf(fp, "3\n%d\n%d\n%d\n", ts, numComponents, size); fprintf(fp, "3\n%d\n%d\n%d\n", ts, numComponents, size);
if(forceNodeData){ if(forceNodeData){
for(unsigned int i = 0; i < vertices.size(); i++){ for(unsigned int i = 0; i < unique.size(); i++){
MVertex *v = vertices[i]; MVertex *v = unique[i];
if(v->getIndex() > 0){
fprintf(fp, "%d", v->getIndex()); fprintf(fp, "%d", v->getIndex());
int nbnod = vertexData[v].nbnod; int nbnod = vertexData[v].nbnod;
int nod = vertexData[v].nod; int nod = vertexData[v].nod;
...@@ -666,7 +666,6 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b ...@@ -666,7 +666,6 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b
d[numComponents * nbnod * ts + numComponents * nod + j]); d[numComponents * nbnod * ts + numComponents * nod + j]);
fprintf(fp, "\n"); fprintf(fp, "\n");
} }
}
fprintf(fp, "$EndNodeData\n"); fprintf(fp, "$EndNodeData\n");
} }
else{ else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment