From 5ef5987d29698cf6a5ecdfd5d6f872f3d61c8fe9 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 18 Nov 2017 10:28:09 +0100 Subject: [PATCH] change signature of MEdgeVertex constructor : the optional lc arg should be last; this also fixes a bug in GeomMeshMatcher --- Geo/MVertex.h | 12 ++++++++---- Mesh/HighOrder.cpp | 2 +- Mesh/meshGEdge.cpp | 7 ++----- Mesh/meshGFace.cpp | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Geo/MVertex.h b/Geo/MVertex.h index df093d162a..8fe6c822ed 100644 --- a/Geo/MVertex.h +++ b/Geo/MVertex.h @@ -113,8 +113,8 @@ class MEdgeVertex : public MVertex{ public: MVertexBoundaryLayerData* bl_data; - MEdgeVertex(double x, double y, double z, GEntity *ge, double u, double lc = -1.0, - int num = 0) + MEdgeVertex(double x, double y, double z, GEntity *ge, double u, int num = 0, + double lc = -1.0) : MVertex(x, y, z, ge,num), _u(u), _lc(lc), bl_data(0) { } @@ -130,12 +130,16 @@ class MFaceVertex : public MVertex{ public : MVertexBoundaryLayerData* bl_data; - MFaceVertex(double x, double y, double z, GEntity *ge, double u, double v, int num = 0) + MFaceVertex(double x, double y, double z, GEntity *ge, double u, double v, + int num = 0) : MVertex(x, y, z, ge, num), _u(u), _v(v), bl_data(0) { } virtual ~MFaceVertex(){ if(bl_data) delete bl_data; } - virtual bool getParameter(int i, double &par) const { par = (i ? _v : _u); return true; } + virtual bool getParameter(int i, double &par) const + { + par = (i ? _v : _u); return true; + } virtual bool setParameter(int i, double par) { if(!i) diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp index fca6ece178..3fb733953b 100644 --- a/Mesh/HighOrder.cpp +++ b/Mesh/HighOrder.cpp @@ -175,7 +175,7 @@ static bool getEdgeVerticesOnGeo(GEdge *ge, MVertex *v0, MVertex *v1, MVertex *v; int count = u0<u1? j + 1 : nPts + 1 - (j + 1); GPoint pc = ge->point(US[count]); - v = new MEdgeVertex(pc.x(), pc.y(), pc.z(), ge,US[count]); + v = new MEdgeVertex(pc.x(), pc.y(), pc.z(), ge, US[count]); // this destroys the ordering of the mesh vertices on the edge ve.push_back(v); } diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index 72fbcfa2f7..4b90125a20 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -90,7 +90,6 @@ static double F_LcB(GEdge *ge, double t) /* if (blf){ double lc2 = (*blf)( p.x(), p.y(), p.z() , ge); - // printf("p %g %g lc %g\n",p.x(),p.y(),lc2); lc = std::min(lc, lc2); } */ @@ -124,7 +123,6 @@ static double F_Lc(GEdge *ge, double t) /* if (blf){ double lc2 = (*blf)( p.x(), p.y(), p.z() , ge); - // printf("p %g %g lc %g\n",p.x(),p.y(),lc2); lc_here = std::min(lc_here, lc2); } */ @@ -461,7 +459,7 @@ static void createPoints(GVertex *gv, GEdge *ge, BoundaryLayerField *blf, while (1){ if (L > blf->thickness || L > LEdge * .4) break; SPoint3 p (gv->x() + dir.x() * L, gv->y() + dir.y() * L, 0.0); - v.push_back(new MEdgeVertex(p.x(), p.y(), p.z(), ge, ge->parFromPoint(p), blf->hfar)); + v.push_back(new MEdgeVertex(p.x(), p.y(), p.z(), ge, ge->parFromPoint(p), 0, blf->hfar)); int ith = v.size() ; L += hwall * pow (blf->ratio, ith); } @@ -695,8 +693,7 @@ void meshGEdge::operator() (GEdge *ge) const double d = norm(der); double lc = d/(P1.lc + dlc / dp * (d - P1.p)); GPoint V = ge->point(t); - // printf("%d %g\n",NUMP-1,t); - mesh_vertices[NUMP - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t, lc); + mesh_vertices[NUMP - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t, 0, lc); NUMP++; } else { diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index e1ea164d64..2958b5bcee 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -481,7 +481,7 @@ static void remeshUnrecoveredEdges(std::map<MVertex*, BDS_Point*> &recoverMapInv double t = 0.5 * (t2 + t1); double lc = 0.5 * (lc1 + lc2); GPoint V = itr->ge->point(t); - MEdgeVertex * newv = new MEdgeVertex(V.x(), V.y(), V.z(), itr->ge, t, lc); + MEdgeVertex * newv = new MEdgeVertex(V.x(), V.y(), V.z(), itr->ge, t, 0, lc); newLines.push_back(new MLine(v1, newv)); newLines.push_back(new MLine(newv, v2)); delete itr->ge->lines[i]; @@ -2265,7 +2265,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true) if (mv1->onWhat()->dim() == 1) { double t; mv1->getParameter(0,t); - mv2 = new MEdgeVertex(mv1->x(),mv1->y(),mv1->z(),mv1->onWhat(), t, + mv2 = new MEdgeVertex(mv1->x(),mv1->y(),mv1->z(),mv1->onWhat(), t, 0, ((MEdgeVertex*)mv1)->getLc()); } else if (mv1->onWhat()->dim() == 0) { -- GitLab