Skip to content
Snippets Groups Projects
Commit 3a3b14fa authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

toto

parent b0465702
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,25 @@ gmshFace::gmshFace(GModel *m, Surface *face) ...@@ -27,6 +27,25 @@ gmshFace::gmshFace(GModel *m, Surface *face)
resetMeshAttributes(); resetMeshAttributes();
} }
// a face is degenerate if
bool gmshFace::degenerate(int dim) const {
std::list<GEdge*> eds = edges();
int numNonDegenerate = 0;
std::set<GEdge*> t;
for(std::list<GEdge*>::iterator it = eds.begin(); it != eds.end(); ++it){
GEdge *e = *it;
GVertex *start = e->getBeginVertex();
GVertex *next = e->getEndVertex();
if (start != next && t.find(e) == t.end()){
numNonDegenerate++;
}
t.insert(e);
}
// printf("%d \n",numNonDegenerate);
return numNonDegenerate <= 1;
}
void gmshFace::resetNativePtr(Surface *face) void gmshFace::resetNativePtr(Surface *face)
{ {
s = face; s = face;
......
...@@ -36,6 +36,7 @@ class gmshFace : public GFace { ...@@ -36,6 +36,7 @@ class gmshFace : public GFace {
virtual SPoint2 parFromPoint(const SPoint3 &, bool onSurface=true) const; virtual SPoint2 parFromPoint(const SPoint3 &, bool onSurface=true) const;
virtual void resetMeshAttributes(); virtual void resetMeshAttributes();
void resetNativePtr(Surface *_s); void resetNativePtr(Surface *_s);
bool degenerate(int dim) const;
}; };
#endif #endif
...@@ -54,7 +54,7 @@ struct HilbertSort ...@@ -54,7 +54,7 @@ struct HilbertSort
bbox *= 1.01; bbox *= 1.01;
MVertex**pv = &v[0]; MVertex**pv = &v[0];
int depth; int depth;
MultiscaleSortHilbert(pv, (int)v.size(), 64, 0.125,&depth); MultiscaleSortHilbert(pv, (int)v.size(), 10, 0.125,&depth);
} }
}; };
...@@ -269,7 +269,7 @@ void HilbertSort::Sort(MVertex** vertices, int arraysize, int e, int d, ...@@ -269,7 +269,7 @@ void HilbertSort::Sort(MVertex** vertices, int arraysize, int e, int d,
void SortHilbert (std::vector<MVertex*>& v) void SortHilbert (std::vector<MVertex*>& v)
{ {
//HilbertSort h(1000); HilbertSort h(1000);
HilbertSort h; //HilbertSort h;
h.Apply(v); h.Apply(v);
} }
...@@ -14,3 +14,5 @@ Plane Surface(6) = {5}; ...@@ -14,3 +14,5 @@ Plane Surface(6) = {5};
//Recombine Surface {6}; //Recombine Surface {6};
//+ //+
Physical Surface(7) = {6}; Physical Surface(7) = {6};
//+
Recombine Surface {6};
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment