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

one more fix to make 2D meshes reproductible (this deserves a couple of beers ;-)

parent 164b5be9
No related branches found
No related tags found
No related merge requests found
...@@ -159,18 +159,23 @@ struct edgeXface ...@@ -159,18 +159,23 @@ struct edgeXface
{ {
v[0] = t1->tri()->getVertex(iFac == 0 ? 2 : iFac-1); v[0] = t1->tri()->getVertex(iFac == 0 ? 2 : iFac-1);
v[1] = t1->tri()->getVertex(iFac); v[1] = t1->tri()->getVertex(iFac);
std::sort(v, v + 2); if(v[0]->getNum() > v[1]->getNum()){
MVertex *tmp = v[0];
v[0] = v[1];
v[1] = tmp;
}
} }
inline bool operator < ( const edgeXface &other) const inline bool operator < ( const edgeXface &other) const
{ {
if(v[0] < other.v[0]) return true; if(v[0]->getNum() < other.v[0]->getNum()) return true;
if(v[0] > other.v[0]) return false; if(v[0]->getNum() > other.v[0]->getNum()) return false;
if(v[1] < other.v[1]) return true; if(v[1]->getNum() < other.v[1]->getNum()) return true;
return false; return false;
} }
inline bool operator == ( const edgeXface &other) const inline bool operator == ( const edgeXface &other) const
{ {
if(v[0] == other.v[0] && v[1] == other.v[1]) return true; if(v[0]->getNum() == other.v[0]->getNum() &&
v[1]->getNum() == other.v[1]->getNum()) return true;
return false; return false;
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment