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

*** empty log message ***

parent d713a7c1
Branches
Tags
No related merge requests found
// $Id: 2D_Mesh.cpp,v 1.74 2005-04-15 14:32:40 remacle Exp $ // $Id: 2D_Mesh.cpp,v 1.75 2005-04-19 07:23:42 remacle Exp $
// //
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
// //
...@@ -914,7 +914,7 @@ void Maillage_Surface(void *data, void *dum) ...@@ -914,7 +914,7 @@ void Maillage_Surface(void *data, void *dum)
delete_NXE(tnxe); delete_NXE(tnxe);
} }
if(s->Recombine && CTX.mesh.algo_recombine ==1 ){ if(s->Recombine){// && CTX.mesh.algo_recombine ==1 ){
Msg(STATUS3, "Recombining surface %d", s->Num); Msg(STATUS3, "Recombining surface %d", s->Num);
Recombine(s->Vertices, s->Simplexes, s->Quadrangles, s->RecombineAngle); Recombine(s->Vertices, s->Simplexes, s->Quadrangles, s->RecombineAngle);
} }
...@@ -948,10 +948,10 @@ void Maillage_Surface(void *data, void *dum) ...@@ -948,10 +948,10 @@ void Maillage_Surface(void *data, void *dum)
ReOrientSurfaceMesh(s); ReOrientSurfaceMesh(s);
} }
if(CTX.mesh.algo_recombine ==2 ) // if(CTX.mesh.algo_recombine ==2 )
{ // {
printf("coucou\n"); // printf("coucou\n");
Recombine_All (THEM); // Recombine_All (THEM);
} //}
} }
...@@ -88,7 +88,8 @@ void BDS_Point::getTriangles (std::list<BDS_Triangle *> &t) ...@@ -88,7 +88,8 @@ void BDS_Point::getTriangles (std::list<BDS_Triangle *> &t)
std::list<BDS_Edge*>::iterator ite = edges.end(); std::list<BDS_Edge*>::iterator ite = edges.end();
while(it!=ite) while(it!=ite)
{ {
for (int i=0;i<2;++i) int NF = (*it)->numfaces();
for (int i=0;i<NF;++i)
{ {
BDS_Triangle *tt = (*it)->faces[i]; BDS_Triangle *tt = (*it)->faces[i];
if (tt) if (tt)
...@@ -481,7 +482,7 @@ bool BDS_Mesh ::split_edge ( BDS_Edge *e, double coord, const BDS_Projector &) ...@@ -481,7 +482,7 @@ bool BDS_Mesh ::split_edge ( BDS_Edge *e, double coord, const BDS_Projector &)
int nbFaces = e->numfaces(); int nbFaces = e->numfaces();
if (nbFaces == 1)return false; if (nbFaces != 2)return false;
BDS_Point *op[2]; BDS_Point *op[2];
BDS_Point *p1 = e->p1; BDS_Point *p1 = e->p1;
...@@ -569,14 +570,13 @@ bool BDS_Mesh ::swap_edge ( BDS_Edge *e) ...@@ -569,14 +570,13 @@ bool BDS_Mesh ::swap_edge ( BDS_Edge *e)
int nbFaces = e->numfaces(); int nbFaces = e->numfaces();
if (nbFaces != 2)return false;
BDS_Point *pts1[3]; BDS_Point *pts1[3];
e->faces[0]->getNodes (pts1); e->faces[0]->getNodes (pts1);
BDS_Point *pts2[3]; BDS_Point *pts2[3];
e->faces[1]->getNodes (pts2); e->faces[1]->getNodes (pts2);
if (nbFaces != 2)return false;
if (e->g && e->g->classif_degree != 2)return false; if (e->g && e->g->classif_degree != 2)return false;
BDS_Point *op[2]; BDS_Point *op[2];
...@@ -703,37 +703,44 @@ bool BDS_Mesh ::smooth_point ( BDS_Point *p, const BDS_Projector &) ...@@ -703,37 +703,44 @@ bool BDS_Mesh ::smooth_point ( BDS_Point *p, const BDS_Projector &)
void BDS_Mesh :: adapt_mesh ( double l, const BDS_Projector &proj) void BDS_Mesh :: adapt_mesh ( double l, const BDS_Projector &proj)
{ {
printf("couco1\n");
std::set<BDS_Edge*, EdgeLessThan> small_to_long; std::set<BDS_Edge*, EdgeLessThan> small_to_long;
{ {
std::set<BDS_Edge*, EdgeLessThan>::iterator it = edges.begin(); std::set<BDS_Edge*, EdgeLessThan>::iterator it = edges.begin();
std::set<BDS_Edge*, EdgeLessThan>::iterator ite = edges.end(); std::set<BDS_Edge*, EdgeLessThan>::iterator ite = edges.end();
while (it != ite) while (it != ite)
{ {
if ((*it)->numfaces()==1)printf("one face\n"); // if ((*it)->numfaces()==1)printf("one face\n");
small_to_long.insert (*it); small_to_long.insert (*it);
++it; ++it;
} }
} }
printf("couco2\n");
{ {
std::set<BDS_Edge*, EdgeLessThan>::iterator it = small_to_long.begin(); std::set<BDS_Edge*, EdgeLessThan>::iterator it = small_to_long.begin();
std::set<BDS_Edge*, EdgeLessThan>::iterator ite = small_to_long.end(); std::set<BDS_Edge*, EdgeLessThan>::iterator ite = small_to_long.end();
int nbspl = 0; int nbspl = 0;
while (it != ite) while (it != ite)
{ {
BDS_Point *op[2]; if ((*it)->numfaces()==2)
(*it)->oppositeof (op); {
double ll = sqrt((op[0]->X-op[1]->X)*(op[0]->X-op[1]->X)+ BDS_Point *op[2];
(op[0]->Y-op[1]->Y)*(op[0]->Y-op[1]->Y)+ (*it)->oppositeof (op);
(op[0]->Z-op[1]->Z)*(op[0]->Z-op[1]->Z)); double ll = sqrt((op[0]->X-op[1]->X)*(op[0]->X-op[1]->X)+
if (!(*it)->deleted && (*it)->length() > l && ll > 0.5 * l){ (op[0]->Y-op[1]->Y)*(op[0]->Y-op[1]->Y)+
(op[0]->Z-op[1]->Z)*(op[0]->Z-op[1]->Z));
if (!(*it)->deleted && (*it)->length() > l && ll > 0.5 * l){
split_edge (*it, 0.5 ,proj); split_edge (*it, 0.5 ,proj);
nbspl++; nbspl++;
}
} }
++it; ++it;
} }
printf("nbspl = %d\n",nbspl); printf("nbspl = %d\n",nbspl);
} }
// return; // return;
cleanup(); cleanup();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment