diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 7c3f6c60eb2d10963d95953e0260cb904178efff..0995f631ae8e5d56b52ba371fc4dfb1b14c0c39d 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -241,9 +241,9 @@ static bool recoverEdge(BDS_Mesh *m, GEdge *ge, // Builds An initial triangular mesh that respects the boundaries of // the domain, including embedded points and surfaces -static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, - bool repairSelfIntersecting1dMesh, - bool debug = true) +static bool meshGenerator(GFace *gf, int RECUR_ITER, + bool repairSelfIntersecting1dMesh, + bool debug = true) { BDS_GeomEntity CLASS_F(1, 2); std::map<BDS_Point*, MVertex*> recoverMap; @@ -473,7 +473,7 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, // delete the mesh delete m; if(RECUR_ITER < 10 && facesToRemesh.size() == 0) - return gmsh2DMeshGenerator + return meshGenerator (gf, RECUR_ITER + 1, repairSelfIntersecting1dMesh, debug); return false; } @@ -650,9 +650,9 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, // vertices if(algoDelaunay2D(gf)){ if(CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL) - gmshBowyerWatsonFrontal(gf); + bowyerWatsonFrontal(gf); else - gmshBowyerWatson(gf); + bowyerWatson(gf); for(int i = 0; i < CTX::instance()->mesh.nbSmoothing; i++) laplaceSmoothing(gf); } @@ -924,7 +924,7 @@ static bool buildConsecutiveListOfVertices(GFace *gf, GEdgeLoop &gel, return true; } -static bool gmsh2DMeshGeneratorPeriodic(GFace *gf, bool debug = true) +static bool meshGeneratorPeriodic(GFace *gf, bool debug = true) { std::map<BDS_Point*, MVertex*> recoverMap; @@ -1201,9 +1201,9 @@ static bool gmsh2DMeshGeneratorPeriodic(GFace *gf, bool debug = true) if(algoDelaunay2D(gf)){ if(CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL) - gmshBowyerWatsonFrontal(gf); + bowyerWatsonFrontal(gf); else - gmshBowyerWatson(gf); + bowyerWatson(gf); for(int i = 0; i < CTX::instance()->mesh.nbSmoothing; i++) laplaceSmoothing(gf); } @@ -1277,11 +1277,11 @@ void meshGFace::operator() (GFace *gf) Msg::Debug("Generating the mesh"); if(noSeam(gf) || gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty()){ - gmsh2DMeshGenerator(gf, 0, repairSelfIntersecting1dMesh, - debugSurface >= 0 || debugSurface == -100); + meshGenerator(gf, 0, repairSelfIntersecting1dMesh, + debugSurface >= 0 || debugSurface == -100); } else{ - if(!gmsh2DMeshGeneratorPeriodic + if(!meshGeneratorPeriodic (gf, debugSurface >= 0 || debugSurface == -100)) Msg::Error("Impossible to mesh face %d", gf->tag()); } diff --git a/Mesh/meshGFaceBDS.cpp b/Mesh/meshGFaceBDS.cpp index 4d2e5079329f4e231318335cf4b11635deedfa33..46e239b73d392b4b240c9b0ce226e606242c7aaa 100644 --- a/Mesh/meshGFaceBDS.cpp +++ b/Mesh/meshGFaceBDS.cpp @@ -833,8 +833,8 @@ void invalidEdgesPeriodic(BDS_Mesh &m, std::map<BDS_Point*, MVertex*> *recoverMa // if not do not allow p1 v and p2 v, split them // if p1 p2 exists and it is internal, split it -int gmshSolveInvalidPeriodic(GFace *gf, BDS_Mesh &m, - std::map<BDS_Point*, MVertex*> *recoverMap) +int solveInvalidPeriodic(GFace *gf, BDS_Mesh &m, + std::map<BDS_Point*, MVertex*> *recoverMap) { std::set<BDS_Edge*> toSplit; invalidEdgesPeriodic(m, recoverMap, toSplit); @@ -887,7 +887,7 @@ void optimizeMeshBDS(GFace *gf, BDS_Mesh &m, const int NIT, } if (recoverMap){ - while(gmshSolveInvalidPeriodic(gf, m, recoverMap)){ + while(solveInvalidPeriodic(gf, m, recoverMap)){ } } } diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp index 20fa4ce22645c2407d3ff0bba8ff506cff8f82d6..6a2b5dbe2b7d639f0950209362089855ef4bc5da 100644 --- a/Mesh/meshGFaceDelaunayInsertion.cpp +++ b/Mesh/meshGFaceDelaunayInsertion.cpp @@ -656,7 +656,7 @@ static void insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it } } -void gmshBowyerWatson(GFace *gf) +void bowyerWatson(GFace *gf) { std::set<MTri3*,compareTri3Ptr> AllTris; std::vector<double> vSizes, vSizesBGM, Us, Vs; @@ -770,7 +770,7 @@ void testTensor() printf("%12.5E %12.5E %12.5E \n",m(0,2),m(1,2),m(2,2)); } -void gmshBowyerWatsonFrontal(GFace *gf) +void bowyerWatsonFrontal(GFace *gf) { std::set<MTri3*,compareTri3Ptr> AllTris; std::set<MTri3*,compareTri3Ptr> ActiveTris; diff --git a/Mesh/meshGFaceDelaunayInsertion.h b/Mesh/meshGFaceDelaunayInsertion.h index 0eb582fd135167ebe41290843a8f2d2fbf1f452c..dd67d5a60dbae6a40865d3d3b9267d587bf02653 100644 --- a/Mesh/meshGFaceDelaunayInsertion.h +++ b/Mesh/meshGFaceDelaunayInsertion.h @@ -92,8 +92,8 @@ class compareTri3Ptr void connectTriangles(std::list<MTri3*> &); void connectTriangles(std::vector<MTri3*> &); void connectTriangles(std::set<MTri3*,compareTri3Ptr> &AllTris); -void gmshBowyerWatson(GFace *gf); -void gmshBowyerWatsonFrontal(GFace *gf); +void bowyerWatson(GFace *gf); +void bowyerWatsonFrontal(GFace *gf); struct edgeXface { diff --git a/Mesh/meshGFaceQuadrilateralize.cpp b/Mesh/meshGFaceQuadrilateralize.cpp index 0c8b0dd9e252dc264ce66d4c88121c47d51debb6..331d03afd78d8b6c3b6ab7ec46fcd5486139e3e3 100644 --- a/Mesh/meshGFaceQuadrilateralize.cpp +++ b/Mesh/meshGFaceQuadrilateralize.cpp @@ -13,7 +13,7 @@ #include "BDS.h" #include "SVector3.h" -class gmshEdgeFront { +class edgeFront { public: typedef std::set<BDS_Edge *>::const_iterator eiter; private: @@ -26,7 +26,7 @@ class gmshEdgeFront { std::set<BDS_Edge*> stat[5]; eiter begin() { return edges.begin(); } eiter end() { return edges.end(); } - gmshEdgeFront(BDS_Mesh *_m, GFace *_gf) : m(_m), gf(_gf) {} + edgeFront(BDS_Mesh *_m, GFace *_gf) : m(_m), gf(_gf) {} // initiate edges in the front i.e. // take all edges that have one neighbor // and all edges that have a quad and a triangle @@ -74,7 +74,7 @@ class gmshEdgeFront { BDS_Edge *findOptimalEdge(BDS_Point *p, BDS_Point *avoid); }; -void gmshEdgeFront::updateStatus(BDS_Edge *e) +void edgeFront::updateStatus(BDS_Edge *e) { for(int i = 0; i < 5; i++){ std::set<BDS_Edge*>::iterator it = stat[i].find(e); @@ -114,8 +114,8 @@ void recur_empty_cavity(BDS_Face *f, } } -void gmshEdgeFront::emptyCavity(BDS_Edge *bottom, BDS_Edge *top, BDS_Edge *left, - BDS_Edge *right) +void edgeFront::emptyCavity(BDS_Edge *bottom, BDS_Edge *top, BDS_Edge *left, + BDS_Edge *right) { // not optimal for now, will be improved further away BDS_Face *f = 0; @@ -140,7 +140,7 @@ void gmshEdgeFront::emptyCavity(BDS_Edge *bottom, BDS_Edge *top, BDS_Edge *left, } -SVector3 gmshEdgeFront::normal(BDS_Edge*e) const +SVector3 edgeFront::normal(BDS_Edge*e) const { BDS_Face *t = e->faces(0); if(e->numfaces() == 2 && e->faces(1)->numEdges() == 3)t=e->faces(1); @@ -180,7 +180,7 @@ SVector3 gmshEdgeFront::normal(BDS_Edge*e) const return n; } -void gmshEdgeFront::getFrontEdges(BDS_Point *p, std::vector<eiter> & fe) const +void edgeFront::getFrontEdges(BDS_Point *p, std::vector<eiter> & fe) const { for(std::list<BDS_Edge*>::iterator itp = p->edges.begin(); itp != p->edges.end(); ++ itp){ @@ -190,7 +190,7 @@ void gmshEdgeFront::getFrontEdges(BDS_Point *p, std::vector<eiter> & fe) const } } -void gmshEdgeFront::getFrontEdges(BDS_Point *p, eiter & it1, eiter & it2) const +void edgeFront::getFrontEdges(BDS_Point *p, eiter & it1, eiter & it2) const { int count = 0; for(std::list<BDS_Edge*>::iterator itp = p->edges.begin(); @@ -207,7 +207,7 @@ void gmshEdgeFront::getFrontEdges(BDS_Point *p, eiter & it1, eiter & it2) const Msg::Error("point %d is in the front but has only %d edges\n",p->iD,count); } -void gmshEdgeFront::initiate() +void edgeFront::initiate() { edges.clear(); for(int i = 0; i < 5; i++) stat[i].clear(); @@ -236,7 +236,7 @@ double angle3Points(BDS_Point *p1, BDS_Point *p2, BDS_Point *p3) return atan2(sinA, cosA); } -int gmshEdgeFront::computeStatus(BDS_Edge *e) const +int edgeFront::computeStatus(BDS_Edge *e) const { eiter it11, it12, it21,it22; getFrontEdges(e->p1, it11, it12); @@ -264,7 +264,7 @@ int gmshEdgeFront::computeStatus(BDS_Edge *e) const return 3; } -bool gmshEdgeFront::formQuad(BDS_Edge *e, BDS_Edge *left, BDS_Edge *right) +bool edgeFront::formQuad(BDS_Edge *e, BDS_Edge *left, BDS_Edge *right) { printf("e (%d,%d), l(%d,%d), r(%d,%d)\n", @@ -355,7 +355,7 @@ bool gmshEdgeFront::formQuad(BDS_Edge *e, BDS_Edge *left, BDS_Edge *right) return true; } -BDS_Edge *gmshEdgeFront::findOptimalEdge(BDS_Point *p, BDS_Point *avoid) +BDS_Edge *edgeFront::findOptimalEdge(BDS_Point *p, BDS_Point *avoid) { eiter it1, it2; getFrontEdges(p, it1, it2); @@ -444,7 +444,7 @@ BDS_Edge *gmshEdgeFront::findOptimalEdge(BDS_Point *p, BDS_Point *avoid) return 0; } -bool gmshEdgeFront::emptyFront(int tag) +bool edgeFront::emptyFront(int tag) { // front edges tagged "tag" is empty if(stat[tag].size() == 0) return true; @@ -540,7 +540,7 @@ int gmshQMorph(GFace *gf) BDS_Mesh *pm = gmsh2BDS(l); // create the front - gmshEdgeFront front(pm,gf); + edgeFront front(pm,gf); front.initiate(); int ITER = 1; diff --git a/Mesh/meshGRegionLocalMeshMod.cpp b/Mesh/meshGRegionLocalMeshMod.cpp index 48ac88822f4c99356230e04c5b32f5f59d133ad2..cf727618293313f298681d340d7f0a8f0fbb4e22 100644 --- a/Mesh/meshGRegionLocalMeshMod.cpp +++ b/Mesh/meshGRegionLocalMeshMod.cpp @@ -50,12 +50,9 @@ void computeNeighboringTetsOfACavity(const std::vector<MTet4*> &cavity, } } -bool gmshBuildEdgeCavity(MTet4 *t, - int iLocalEdge, - MVertex **v1,MVertex **v2, - std::vector<MTet4*> &cavity, - std::vector<MTet4*> &outside, - std::vector<MVertex*> &ring) +bool buildEdgeCavity(MTet4 *t, int iLocalEdge, MVertex **v1, MVertex **v2, + std::vector<MTet4*> &cavity, std::vector<MTet4*> &outside, + std::vector<MVertex*> &ring) { cavity.clear(); ring.clear(); @@ -211,7 +208,7 @@ bool edgeSwap(std::vector<MTet4 *> &newTets, std::vector<MVertex*> ring; MVertex *v1, *v2; - bool closed = gmshBuildEdgeCavity(tet, iLocalEdge, &v1, &v2, cavity, outside, ring); + bool closed = buildEdgeCavity(tet, iLocalEdge, &v1, &v2, cavity, outside, ring); if (!closed) return false; @@ -317,7 +314,7 @@ bool edgeSplit(std::vector<MTet4 *> &newTets, MTet4 *tet, MVertex *newVertex, std::vector<MVertex*> ring; MVertex *v1, *v2; - bool closed = gmshBuildEdgeCavity(tet, iLocalEdge, &v1, &v2, cavity, outside, ring); + bool closed = buildEdgeCavity(tet, iLocalEdge, &v1, &v2, cavity, outside, ring); if (!closed) return false; for(unsigned int j = 0; j < ring.size(); j++){ @@ -431,9 +428,7 @@ bool faceSwap(std::vector<MTet4 *> &newTets, MTet4 *t1, int iLocalFace, return true; } -void gmshBuildVertexCavity_recur(MTet4 *t, - MVertex *v, - std::vector<MTet4*> &cavity) +void buildVertexCavity_recur(MTet4 *t, MVertex *v, std::vector<MTet4*> &cavity) { // if (recur > 20)printf("oufti %d\n",recur); if(t->isDeleted()){ @@ -462,7 +457,7 @@ void gmshBuildVertexCavity_recur(MTet4 *t, } if(!found){ cavity.push_back(neigh); - gmshBuildVertexCavity_recur(neigh, v, cavity); + buildVertexCavity_recur(neigh, v, cavity); } } } @@ -485,7 +480,7 @@ bool sliverRemoval(std::vector<MTet4*> &newTets, MTet4 *t, int nbSwappable = 0; int iSwappable = 0; for (int i = 0; i < 6; i++){ - isClosed[i] = gmshBuildEdgeCavity(t, i, &v1, &v2, cavity, outside, ring); + isClosed[i] = buildEdgeCavity(t, i, &v1, &v2, cavity, outside, ring); if (isClosed[i]){ nbSwappable++; iSwappable = i; @@ -567,7 +562,7 @@ bool collapseVertex(std::vector<MTet4 *> &newTets, std::vector<MTet4*> cavity_v; std::vector<MTet4*> outside; cavity_v.push_back(t); - gmshBuildVertexCavity_recur(t, v, cavity_v); + buildVertexCavity_recur(t, v, cavity_v); std::vector<MTet4*> toDelete; std::vector<MTet4*> toUpdate; @@ -651,7 +646,7 @@ bool smoothVertex(MTet4 *t, int iVertex, const qualityMeasure4Tet &cr) std::vector<MTet4*> cavity; cavity.push_back(t); - gmshBuildVertexCavity_recur(t, t->tet()->getVertex(iVertex), cavity); + buildVertexCavity_recur(t, t->tet()->getVertex(iVertex), cavity); double xcg = 0, ycg = 0, zcg = 0; double vTot = 0; @@ -777,7 +772,7 @@ bool smoothVertexOptimize(MTet4 *t, int iVertex, const qualityMeasure4Tet &cr) vd.ts.push_back(t); vd.v = t->tet()->getVertex(iVertex); vd.LC = 1.0; // WRONG - gmshBuildVertexCavity_recur(t, t->tet()->getVertex(iVertex), vd.ts); + buildVertexCavity_recur(t, t->tet()->getVertex(iVertex), vd.ts); double xyzopti[3] = {vd.v->x(), vd.v->y(), vd.v->z()};