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

*** empty log message ***

parent 4fbec4e2
No related branches found
No related tags found
No related merge requests found
// $Id: BDS.cpp,v 1.82 2007-10-14 17:30:42 remacle Exp $ // $Id: BDS.cpp,v 1.83 2007-10-14 19:54:16 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -786,7 +786,26 @@ bool BDS_SwapEdgeTestParametric::operator () (BDS_Point *_p1,BDS_Point *_p2, ...@@ -786,7 +786,26 @@ bool BDS_SwapEdgeTestParametric::operator () (BDS_Point *_p1,BDS_Point *_p2,
double ori_t1 = gmsh::orient2d(op1, p1, op2); double ori_t1 = gmsh::orient2d(op1, p1, op2);
double ori_t2 = gmsh::orient2d(op1,op2, p2); double ori_t2 = gmsh::orient2d(op1,op2, p2);
return (ori_t1 * ori_t2 > 0); return( ori_t1 * ori_t2 > 0 ); // the quadrangle was strictly convex !
// double ori_t1 = gmsh::orient2d(p1, p2, op1);
// double ori_t2 = gmsh::orient2d(p1, p2, op2);
// double ori_t3 = gmsh::orient2d(op1, op2, p1);
// double ori_t4 = gmsh::orient2d(op1, op2, p2);
// return (ori_t1 * ori_t2 < 0 && ori_t3 * ori_t4 < 0);
// double t1 = fabs(surface_triangle_param(_p1,_p2,_q1));
// double t2 = fabs(surface_triangle_param(_p1,_p2,_q2));
// double t3 = fabs(surface_triangle_param(_q1,_q2,_p1));
// double t4 = fabs(surface_triangle_param(_q1,_q2,_p2));
// // printf("%12.5E %12.5E %12.5E %12.5E -- %12.5E so %1d\n",t1,t2,t3,t4,fabs(t1+t2-t3-t4),fabs(t1+t2-t3-t4) > 1.e-15 * (t1+t2+t3+t4));
// if (fabs(t1+t2-t3-t4) > 1.e-13*(t1+t2+t3+t4))return false;
// return true;
} }
bool BDS_Mesh::swap_edge(BDS_Edge * e, const BDS_SwapEdgeTest &theTest) bool BDS_Mesh::swap_edge(BDS_Edge * e, const BDS_SwapEdgeTest &theTest)
...@@ -1174,25 +1193,25 @@ bool BDS_Mesh::smooth_point_parametric(BDS_Point * p, GFace *gf) ...@@ -1174,25 +1193,25 @@ bool BDS_Mesh::smooth_point_parametric(BDS_Point * p, GFace *gf)
double U = 0; double U = 0;
double V = 0; double V = 0;
// double tot_length = 0; double tot_length = 0;
double LC = 0; double LC = 0;
std::list < BDS_Edge * >::iterator eit = p->edges.begin(); std::list < BDS_Edge * >::iterator eit = p->edges.begin();
while(eit != p->edges.end()) { while(eit != p->edges.end()) {
if ((*eit)->numfaces() == 1) return false; if ((*eit)->numfaces() == 1) return false;
BDS_Point *op = ((*eit)->p1 == p) ? (*eit)->p2 : (*eit)->p1; BDS_Point *op = ((*eit)->p1 == p) ? (*eit)->p2 : (*eit)->p1;
// const double l_e = (*eit)->length(); const double l_e = (*eit)->length();
U += op->u; U += op->u*l_e;
V += op->v; V += op->v*l_e;
// tot_length += l_e; tot_length += l_e;
LC += op->lc(); LC += op->lc();
++eit; ++eit;
} }
U /= (p->edges.size()); //U /= (p->edges.size());
V /= (p->edges.size()); //V /= (p->edges.size());
// U /= tot_length; U /= tot_length;
// V /= tot_length; V /= tot_length;
LC /= p->edges.size(); LC /= p->edges.size();
std::list < BDS_Face * >ts; std::list < BDS_Face * >ts;
......
// $Id: meshGFace.cpp,v 1.97 2007-10-14 17:30:42 remacle Exp $ // $Id: meshGFace.cpp,v 1.98 2007-10-14 19:54:16 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -326,10 +326,6 @@ bool edgeSwapTestDelaunay(BDS_Edge *e,GFace *gf) ...@@ -326,10 +326,6 @@ bool edgeSwapTestDelaunay(BDS_Edge *e,GFace *gf)
double p2x[3] = {e->p2->X,e->p2->Y,e->p2->Z}; double p2x[3] = {e->p2->X,e->p2->Y,e->p2->Z};
double op1x[3] = {op[0]->X,op[0]->Y,op[0]->Z}; double op1x[3] = {op[0]->X,op[0]->Y,op[0]->Z};
double op2x[3] = {op[1]->X,op[1]->Y,op[1]->Z}; double op2x[3] = {op[1]->X,op[1]->Y,op[1]->Z};
double p1u[2] = {e->p1->u,e->p1->v};
double p2u[2] = {e->p2->u,e->p2->v};
double op1u[2] = {op[0]->u,op[0]->v};
double op2u[2] = {op[1]->u,op[1]->v};
double fourth[3]; double fourth[3];
fourthPoint(p1x,p2x,op1x,fourth); fourthPoint(p1x,p2x,op1x,fourth);
double result = gmsh::insphere(p1x, p2x, op1x, fourth, op2x) * gmsh::orient3d(p1x, p2x, op1x, fourth); double result = gmsh::insphere(p1x, p2x, op1x, fourth, op2x) * gmsh::orient3d(p1x, p2x, op1x, fourth);
...@@ -393,7 +389,7 @@ void OptimizeMesh(GFace *gf, BDS_Mesh &m, const int NIT) ...@@ -393,7 +389,7 @@ void OptimizeMesh(GFace *gf, BDS_Mesh &m, const int NIT)
{ {
int result = edgeSwapTestQuality(*it,5); int result = edgeSwapTestQuality(*it,5);
if (result >= 0) if (result >= 0)
if(edgeSwapTestDelaunay(*it,gf) || result > 0) if(edgeSwapTestDelaunay(*it,gf))
m.swap_edge ( *it , BDS_SwapEdgeTestParametric()); m.swap_edge ( *it , BDS_SwapEdgeTestParametric());
} }
++it; ++it;
...@@ -545,7 +541,6 @@ void smoothVertexPass ( GFace *gf, BDS_Mesh &m, int &nb_smooth) ...@@ -545,7 +541,6 @@ void smoothVertexPass ( GFace *gf, BDS_Mesh &m, int &nb_smooth)
std::set<BDS_Point*,PointLessThan>::iterator itp = m.points.begin(); std::set<BDS_Point*,PointLessThan>::iterator itp = m.points.begin();
while (itp != m.points.end()) while (itp != m.points.end())
{ {
if(m.smooth_point_centroid(*itp,gf)) if(m.smooth_point_centroid(*itp,gf))
nb_smooth ++; nb_smooth ++;
++itp; ++itp;
...@@ -627,15 +622,15 @@ void RefineMesh ( GFace *gf, BDS_Mesh &m , const int NIT) ...@@ -627,15 +622,15 @@ void RefineMesh ( GFace *gf, BDS_Mesh &m , const int NIT)
splitEdgePass ( gf, m, maxE, nb_split); splitEdgePass ( gf, m, maxE, nb_split);
//saturateEdgePass ( gf, m, maxE, nb_split); //saturateEdgePass ( gf, m, maxE, nb_split);
clock_t t2 = clock(); clock_t t2 = clock();
swapEdgePass ( gf, m, nb_swap); // swapEdgePass ( gf, m, nb_swap);
clock_t t3 = clock(); clock_t t3 = clock();
collapseEdgePass ( gf, m, minE , MAXNP, nb_collaps); collapseEdgePass ( gf, m, minE , MAXNP, nb_collaps);
clock_t t4 = clock(); clock_t t4 = clock();
swapEdgePass ( gf, m, nb_swap); // swapEdgePass ( gf, m, nb_swap);
clock_t t5 = clock(); clock_t t5 = clock();
smoothVertexPass ( gf, m, nb_smooth); smoothVertexPass ( gf, m, nb_smooth);
clock_t t6 = clock(); clock_t t6 = clock();
swapEdgePass ( gf, m, nb_swap); // swapEdgePass ( gf, m, nb_swap);
clock_t t7 = clock(); clock_t t7 = clock();
// clean up the mesh // clean up the mesh
...@@ -653,6 +648,7 @@ void RefineMesh ( GFace *gf, BDS_Mesh &m , const int NIT) ...@@ -653,6 +648,7 @@ void RefineMesh ( GFace *gf, BDS_Mesh &m , const int NIT)
if (nb_split==0 && nb_collaps == 0)break; if (nb_split==0 && nb_collaps == 0)break;
} }
double t_total = t_spl + t_sw + t_col + t_sm; double t_total = t_spl + t_sw + t_col + t_sm;
Msg(DEBUG1," ---------------------------------------"); Msg(DEBUG1," ---------------------------------------");
Msg(DEBUG1," CPU Report "); Msg(DEBUG1," CPU Report ");
...@@ -1143,9 +1139,9 @@ bool gmsh2DMeshGenerator ( GFace *gf , int RECUR_ITER, bool debug = true) ...@@ -1143,9 +1139,9 @@ bool gmsh2DMeshGenerator ( GFace *gf , int RECUR_ITER, bool debug = true)
if (!AlgoDelaunay2D ( gf )) if (!AlgoDelaunay2D ( gf ))
{ {
RefineMesh (gf,*m, CTX.mesh.refine_steps); RefineMesh (gf,*m, CTX.mesh.refine_steps);
OptimizeMesh(gf, *m, 2); // OptimizeMesh(gf, *m, 2);
RefineMesh (gf,*m, -CTX.mesh.refine_steps); // RefineMesh (gf,*m, -CTX.mesh.refine_steps);
OptimizeMesh(gf, *m, 2); // OptimizeMesh(gf, *m, 2);
if (gf->meshAttributes.recombine) if (gf->meshAttributes.recombine)
{ {
m->recombineIntoQuads (gf->meshAttributes.recombineAngle,gf); m->recombineIntoQuads (gf->meshAttributes.recombineAngle,gf);
...@@ -1824,7 +1820,7 @@ void meshGFace::operator() (GFace *gf) ...@@ -1824,7 +1820,7 @@ void meshGFace::operator() (GFace *gf)
// temp fix until we create MEdgeLoops in gmshFace // temp fix until we create MEdgeLoops in gmshFace
Msg(DEBUG1, "Generating the mesh"); Msg(DEBUG1, "Generating the mesh");
if(gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty()){ if(gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty()){
gmsh2DMeshGenerator(gf,0, false); gmsh2DMeshGenerator(gf,0, true);
} }
else{ else{
if(!gmsh2DMeshGeneratorPeriodic(gf,false)) if(!gmsh2DMeshGeneratorPeriodic(gf,false))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment