Skip to content
Snippets Groups Projects
Commit 2811c7af authored by Bastien Gorissen's avatar Bastien Gorissen
Browse files

Yesterday's commit broke mesh generation for order > 2 in some cases.

This fixes the problem.
parent bb335268
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,17 @@ void GEdge::deleteMesh()
lines.clear();
}
void GEdge::reverse()
{
GVertex* tmp=v0;
v0=v1;
v1=tmp;
for (std::vector<MLine*>::iterator line = lines.begin();
line != lines.end();
line++)
(*line)->revert();
}
unsigned int GEdge::getNumMeshElements()
{
return lines.size();
......
......@@ -45,7 +45,7 @@ class GEdge : public GEntity {
GVertex *getBeginVertex() const { return v0; }
GVertex *getEndVertex() const { return v1; }
void swapVertices() {GVertex* tmp=v0; v0=v1; v1=tmp;}
void reverse();
// add/delete a face bounded by this edge
void addFace(GFace *f);
......
......@@ -259,10 +259,9 @@ static void getEdgeVertices(GEdge *ge, MElement *ele, std::vector<MVertex*> &ve,
reparamOK &= reparamMeshVertexOnEdge(v1, ge, u1);
if(reparamOK){
if (u1 < u0) {
ge->swapVertices();
double tmp = u0;
u0 = u1;
u1 = tmp;
ge->reverse();
edge = ele->getEdge(i);
double tmp = u0; u0 = u1; u1 = tmp;
}
double relax = 1.;
while (1){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment