Commit 9b8aecee authored by Stenger, Florian's avatar Stenger, Florian
Browse files

v3.18

parent 4809e582
......@@ -1116,7 +1116,7 @@ void write_msh_file(string file, Mesh &m){
out << m.numvertices << "\n";
for(int i = 0; i < m.numvertices; ++i){
Vertex &v = m.vertices[i];
out << i << " " << v[0] << " " << v[1] << " " << v[2] << "\n";
out << i + 1 << " " << v[0] << " " << v[1] << " " << v[2] << "\n";
}
out << "$EndNodes\n";
......@@ -1128,7 +1128,7 @@ void write_msh_file(string file, Mesh &m){
Element &e = *it;
for(int b = 0; b < 3; ++b){
if(e.b[b] < 0){
pair<int, int> edge(e.v[(b + 1) % 3], e.v[(b + 2) % 3]);
pair<int, int> edge(e.v[(b + 1) % 3] + 1, e.v[(b + 2) % 3] + 1);
if(edge.first > edge.second){
int tmp = edge.first;
edge.first = edge.second;
......@@ -1148,7 +1148,7 @@ void write_msh_file(string file, Mesh &m){
for(list<Element>::iterator it = m.elements.begin(),
it_end = m.elements.end(); it != it_end; ++it){
Element &e = *it;
out << ++i << " 1 0 " << e.v[0] << " " << e.v[1] << "\n";
out << ++i << " 1 0 " << e.v[0] + 1 << " " << e.v[1] + 1 << "\n";
}
}else if(m.dim_of_elements == 2){ //triangles
//boundary-edges
......@@ -1162,7 +1162,7 @@ void write_msh_file(string file, Mesh &m){
for(list<Element>::iterator it = m.elements.begin(),
it_end = m.elements.end(); it != it_end; ++it){
Element &e = *it;
out << ++i << " 2 0 " << e.v[0] << " " << e.v[1] << " " << e.v[2] << "\n";
out << ++i << " 2 0 " << e.v[0] + 1 << " " << e.v[1] + 1 << " " << e.v[2] + 1 << "\n";
}
}
out << "$EndElements\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment