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

*** empty log message ***

parent 9cc337b1
No related branches found
No related tags found
No related merge requests found
// $Id: GEdge.cpp,v 1.28 2007-05-10 22:08:03 geuzaine Exp $ // $Id: GEdge.cpp,v 1.29 2007-05-24 14:44:06 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -134,8 +134,8 @@ SPoint2 GEdge::reparamOnFace(GFace *face, double epar,int dir) const ...@@ -134,8 +134,8 @@ SPoint2 GEdge::reparamOnFace(GFace *face, double epar,int dir) const
double GEdge::curvature(double par) const double GEdge::curvature(double par) const
{ {
double eps1 = 1.e-3; double eps1 = 1.e-5;
double eps2 = 1.e-3; double eps2 = 1.e-5;
Range<double> r = parBounds(0); Range<double> r = parBounds(0);
if (r.low() == par) eps2 = 0; if (r.low() == par) eps2 = 0;
...@@ -147,6 +147,8 @@ double GEdge::curvature(double par) const ...@@ -147,6 +147,8 @@ double GEdge::curvature(double par) const
GPoint P1 = point(par - eps1); GPoint P1 = point(par - eps1);
GPoint P2 = point(par + eps2); GPoint P2 = point(par + eps2);
double D = sqrt ((P1.x() - P2.x()) * (P1.x() - P2.x()) + double D = sqrt ((P1.x() - P2.x()) * (P1.x() - P2.x()) +
(P1.y() - P2.y()) * (P1.y() - P2.y()) + (P1.y() - P2.y()) * (P1.y() - P2.y()) +
(P1.z() - P2.z()) * (P1.z() - P2.z())); (P1.z() - P2.z()) * (P1.z() - P2.z()));
......
// $Id: GeoInterpolation.cpp,v 1.26 2007-04-22 08:46:04 geuzaine Exp $ // $Id: GeoInterpolation.cpp,v 1.27 2007-05-24 14:44:06 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -238,7 +238,7 @@ Vertex InterpolateCurve(Curve * c, double u, int derivee) ...@@ -238,7 +238,7 @@ Vertex InterpolateCurve(Curve * c, double u, int derivee)
V.u = u; V.u = u;
if(derivee) { if(derivee) {
double eps = 1.e-3; double eps = 1.e-5;
Vertex D[2]; Vertex D[2];
D[0] = InterpolateCurve(c, u, 0); D[0] = InterpolateCurve(c, u, 0);
D[1] = InterpolateCurve(c, u + eps, 0); D[1] = InterpolateCurve(c, u + eps, 0);
......
// $Id: BackgroundMesh.cpp,v 1.21 2007-04-22 08:46:04 geuzaine Exp $ // $Id: BackgroundMesh.cpp,v 1.22 2007-05-24 14:44:06 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -105,20 +105,26 @@ double LC_MVertex_CURV(GEntity *ge, double U, double V) ...@@ -105,20 +105,26 @@ double LC_MVertex_CURV(GEntity *ge, double U, double V)
case 1: case 1:
{ {
GEdge *ged = (GEdge *)ge; GEdge *ged = (GEdge *)ge;
//Crv = ged->curvature(U); Crv = ged->curvature(U);
Crv = max_surf_curvature(ged, U); // printf("coucou %12.5E %d\n",Crv,CTX.mesh.min_circ_points);
//Crv = max_surf_curvature(ged, U);
} }
break; break;
case 2: case 2:
{ {
GFace *gf = (GFace *)ge; // GFace *gf = (GFace *)ge;
Crv = gf->curvature(SPoint2(U, V)); // Crv = gf->curvature(SPoint2(U, V));
} }
break; break;
} }
if(Crv > 0) return 2*M_PI / Crv / CTX.mesh.min_circ_points; double lc = Crv > 0 ? 2*M_PI / Crv / CTX.mesh.min_circ_points : MAX_LC;
else return MAX_LC;
// double lc_min = CTX.lc /300;
return lc;
} }
...@@ -166,7 +172,9 @@ double BGM_MeshSize(GEntity *ge, double U, double V, double X, double Y, double ...@@ -166,7 +172,9 @@ double BGM_MeshSize(GEntity *ge, double U, double V, double X, double Y, double
l2 = LC_MVertex_PNTS(ge, U, V); l2 = LC_MVertex_PNTS(ge, U, V);
if(CTX.mesh.lc_from_curvature && ge->dim() < 3) if(CTX.mesh.lc_from_curvature && ge->dim() < 3)
l1 = std::max(l3 / 100., LC_MVertex_CURV(ge, U, V)); l1 = LC_MVertex_CURV(ge, U, V);
// printf("l1 = %12.5E l2 = %12.5E\n",l1,l2);
double lc = std::min(std::min(std::min(l1, l2), l3), l4); double lc = std::min(std::min(std::min(l1, l2), l3), l4);
return lc * CTX.mesh.lc_factor; return lc * CTX.mesh.lc_factor;
......
// $Id: meshGFace.cpp,v 1.78 2007-05-07 11:40:02 remacle Exp $ // $Id: meshGFace.cpp,v 1.79 2007-05-24 14:44:06 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -314,7 +314,7 @@ void RefineMesh ( GFace *gf, BDS_Mesh &m , const int NIT) ...@@ -314,7 +314,7 @@ void RefineMesh ( GFace *gf, BDS_Mesh &m , const int NIT)
if (l<L && (*it)->g && (*it)->g->classif_degree == 1)L=l; if (l<L && (*it)->g && (*it)->g->classif_degree == 1)L=l;
++it; ++it;
} }
(*itp)->lc() = std::max(L,(*itp)->lc()); (*itp)->lc() = std::min(L,(*itp)->lc());
++itp; ++itp;
} }
} }
...@@ -900,7 +900,7 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true) ...@@ -900,7 +900,7 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true)
m->del_point(m->find_point(-4)); m->del_point(m->find_point(-4));
// start mesh generation // start mesh generation
// if (CTX.mesh.algo2d == ALGO_2D_MESHADAPT) if (CTX.mesh.algo2d == ALGO_2D_MESHADAPT || gf->geomType() != GEntity::Plane)
{ {
RefineMesh (gf,*m,10); RefineMesh (gf,*m,10);
OptimizeMesh(gf, *m, 2); OptimizeMesh(gf, *m, 2);
...@@ -960,10 +960,12 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true) ...@@ -960,10 +960,12 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true)
// the delaunay algo is based directly on internal gmsh structures // the delaunay algo is based directly on internal gmsh structures
// BDS mesh is passed in order not to recompute local coordinates // BDS mesh is passed in order not to recompute local coordinates
// of vertices // of vertices
// if (CTX.mesh.algo2d == ALGO_2D_DELAUNAY || CTX.mesh.algo2d == ALGO_2D_DELAUNAY) if ((CTX.mesh.algo2d == ALGO_2D_DELAUNAY || CTX.mesh.algo2d == ALGO_2D_DELAUNAY) &&
// { gf->geomType() == GEntity::Plane)
// insertVerticesInFace (gf,m) ; {
// } printf("coucou\n");
insertVerticesInFace (gf,m) ;
}
// delete the mesh // delete the mesh
......
// $Id: meshGFaceDelaunayInsertion.cpp,v 1.1 2007-01-12 13:16:59 remacle Exp $ // $Id: meshGFaceDelaunayInsertion.cpp,v 1.2 2007-05-24 14:44:06 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -197,11 +197,11 @@ int inCircumCircle ( MTri3 *t , const double *p , const gmsh2dMetric &metric ) ...@@ -197,11 +197,11 @@ int inCircumCircle ( MTri3 *t , const double *p , const gmsh2dMetric &metric )
int MTri3::inCircumCircle ( const double *p ) const int MTri3::inCircumCircle ( const double *p ) const
{ {
// double pa[2] = {base->getVertex(0)->x(),base->getVertex(0)->y()}; double pa[2] = {base->getVertex(0)->x(),base->getVertex(0)->y()};
// double pb[2] = {base->getVertex(1)->x(),base->getVertex(1)->y()}; double pb[2] = {base->getVertex(1)->x(),base->getVertex(1)->y()};
// double pc[2] = {base->getVertex(2)->x(),base->getVertex(2)->y()}; double pc[2] = {base->getVertex(2)->x(),base->getVertex(2)->y()};
// double result = gmsh::incircle(pa, pb, pc, (double*)p) * gmsh::orient2d(pa, pb, pc); double result = gmsh::incircle(pa, pb, pc, (double*)p) * gmsh::orient2d(pa, pb, pc);
// return (result > 0) ? 1 : 0; return (result > 0) ? 1 : 0;
double eps, d1, d2, x[2]; double eps, d1, d2, x[2];
......
...@@ -73,3 +73,5 @@ Plane Surface(22) = {21}; ...@@ -73,3 +73,5 @@ Plane Surface(22) = {21};
Line Loop(23) = {11,-12,13,14,1,2,-3,4,5,6,7,-8,9,10}; Line Loop(23) = {11,-12,13,14,1,2,-3,4,5,6,7,-8,9,10};
Plane Surface(24) = {23,21}; Plane Surface(24) = {23,21};
Physical Line(25) = {9,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,10};
Physical Surface(26) = {22,24};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment