From ed1e683df32654abd02c36122ac9b268bf24abfe Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 5 Jun 2014 05:35:48 +0000 Subject: [PATCH] fix warnings --- Mesh/Generator.cpp | 61 -------------------------------------- Mesh/meshGFaceOptimize.cpp | 14 +++++---- Numeric/MetricBasis.cpp | 26 ++++++++-------- 3 files changed, 22 insertions(+), 79 deletions(-) diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 1c02a709a9..c1fc939494 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -46,67 +46,6 @@ #include "PViewData.h" #endif -static MVertex* isEquivalentTo(std::multimap<MVertex*, MVertex*> &m, MVertex *v) -{ - std::multimap<MVertex*, MVertex*>::iterator it = m.lower_bound(v); - std::multimap<MVertex*, MVertex*>::iterator ite = m.upper_bound(v); - if (it == ite) return v; - MVertex *res = it->second; ++it; - while (it !=ite){ - res = std::min(res,it->second); ++it; - } - if (res < v) return isEquivalentTo(m, res); - return res; -} - -static void buildASetOfEquivalentMeshVertices(GFace *gf, - std::multimap<MVertex*, MVertex *> &equivalent, - std::map<GVertex*, MVertex*> &bm) -{ - // an edge is degenerated when is length is considered to be - // zero. In some cases, a model edge can be considered as too - // small an is ignored. - - // for taking that into account, we loop over the edges - // and create pairs of MVertices that are considered as - // equal. - - std::list<GEdge*> edges = gf->edges(); - std::list<GEdge*> emb_edges = gf->embeddedEdges(); - std::list<GEdge*>::iterator it = edges.begin(); - - while(it != edges.end()){ - if((*it)->isMeshDegenerated()){ - MVertex *va = *((*it)->getBeginVertex()->mesh_vertices.begin()); - MVertex *vb = *((*it)->getEndVertex()->mesh_vertices.begin()); - if (va != vb){ - equivalent.insert(std::make_pair(va, vb)); - equivalent.insert(std::make_pair(vb, va)); - bm[(*it)->getBeginVertex()] = va; - bm[(*it)->getEndVertex()] = vb; - printf("%d equivalent to %d\n", va->getNum(), vb->getNum()); - } - } - ++it; - } - - it = emb_edges.begin(); - while(it != emb_edges.end()){ - if((*it)->isMeshDegenerated()){ - MVertex *va = *((*it)->getBeginVertex()->mesh_vertices.begin()); - MVertex *vb = *((*it)->getEndVertex()->mesh_vertices.begin()); - if (va != vb){ - equivalent.insert(std::make_pair(va, vb)); - equivalent.insert(std::make_pair(vb, va)); - bm[(*it)->getBeginVertex()] = va; - bm[(*it)->getEndVertex()] = vb; - } - } - ++it; - } -} - - template<class T> static void GetQualityMeasure(std::vector<T*> &ele, double &gamma, double &gammaMin, double &gammaMax, diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp index b3bdb9290c..9263f661a3 100644 --- a/Mesh/meshGFaceOptimize.cpp +++ b/Mesh/meshGFaceOptimize.cpp @@ -911,6 +911,7 @@ static int _quadWithOneVertexOnBoundary (GFace *gf, // see paper from Bunin Guy Bunin (2006) Non-Local Topological Cleanup ,15th // International Meshing Roundtable. This is our interpretation of the // algorithm. +/* static std::vector<MVertex*> closestPathBetweenTwoDefects (v2t_cont &adj, v2t_cont :: iterator it) { @@ -963,6 +964,7 @@ static std::vector<MVertex*> closestPathBetweenTwoDefects (v2t_cont &adj, } } } +*/ static MVertex * createNewVertex (GFace *gf, SPoint2 p){ GPoint gp = gf->point(p); @@ -1654,6 +1656,7 @@ bool quadBlob::matricesDone = false; fullMatrix<double> quadBlob::M3; fullMatrix<double> quadBlob::M5; +/* static int _defectsRemovalBunin(GFace *gf, int maxCavitySize) { @@ -1703,6 +1706,7 @@ static int _defectsRemovalBunin(GFace *gf, int maxCavitySize) return iter; } +*/ // if a vertex (on boundary) is adjacent to one only quad // and if that quad is badly shaped, we split this @@ -3596,7 +3600,7 @@ static double printStats(GFace *gf,const char *message) void recombineIntoQuads(GFace *gf, bool topologicalOpti, - bool nodeRepositioning, + bool nodeRepositioning, double minqual) { double t1 = Cpu(); @@ -3630,15 +3634,15 @@ void recombineIntoQuads(GFace *gf, while(1){ // int maxCavitySize = CTX::instance()->mesh.bunin; // optistatus[0] = (ITERB == 1) ?splitFlatQuads(gf, .01, prioritory) : 0; - //optistatus[1] = + //optistatus[1] = removeTwoQuadsNodes(gf); //optistatus[4] = _defectsRemovalBunin(gf,36); - //optistatus[2] = + //optistatus[2] = removeDiamonds(gf) ; if(haveParam)laplaceSmoothing(gf,CTX::instance()->mesh.nbSmoothing,true); - //optistatus[3] = + //optistatus[3] = edgeSwapQuadsForBetterQuality(gf,minqual, prioritory); - //optistatus[5] = + //optistatus[5] = optiSmoothing(gf,CTX::instance()->mesh.nbSmoothing,true); // optistatus[5] = untangleInvalidQuads(gf, CTX::instance()->mesh.nbSmoothing); double bad = printStats(gf, "IN OPTIMIZATION"); diff --git a/Numeric/MetricBasis.cpp b/Numeric/MetricBasis.cpp index c3b072c99b..b739d0221b 100644 --- a/Numeric/MetricBasis.cpp +++ b/Numeric/MetricBasis.cpp @@ -523,7 +523,7 @@ void MetricBasis::interpolate(const MElement *el, const MetricData *md, const do int order = _bezier->getOrder(); - int dimSimplex; + int dimSimplex = 0; fullMatrix<double> exponents; double bezuvw[3]; switch (el->getType()) { @@ -1151,13 +1151,13 @@ void MetricBasis::_maxAstK(const fullMatrix<double> &coeff, while (itJ != _ineqJ2.end() && itP != _ineqP3.end()) { double num = 0, den = 0; - for (int l = 0; l < itJ->second.size(); ++l) { + for (unsigned int l = 0; l < itJ->second.size(); ++l) { const int i = itJ->second[l].i; const int j = itJ->second[l].j; num += itJ->second[l].val * jac(i) * jac(j); } num *= beta; - for (int l = 0; l < itP->second.size(); ++l) { + for (unsigned int l = 0; l < itP->second.size(); ++l) { const int i = itP->second[l].i; const int j = itP->second[l].j; const int k = itP->second[l].k; @@ -1192,13 +1192,13 @@ void MetricBasis::_maxAstK2(const fullMatrix<double> &coeff, while (itJ != _ineqJ2.end() && itP != _ineqP3.end()) { double num = 0, den = 0; - for (int l = 0; l < itJ->second.size(); ++l) { + for (unsigned int l = 0; l < itJ->second.size(); ++l) { const int i = itJ->second[l].i; const int j = itJ->second[l].j; num += itJ->second[l].val * jac(i) * jac(j); } num *= beta; - for (int l = 0; l < itP->second.size(); ++l) { + for (unsigned int l = 0; l < itP->second.size(); ++l) { const int i = itP->second[l].i; const int j = itP->second[l].j; const int k = itP->second[l].k; @@ -1225,13 +1225,13 @@ void MetricBasis::_maxAstK3(const fullMatrix<double> &coeff, while (itJ != _ineqJ2.end() && itP != _ineqP3.end()) { double num = 0; - for (int l = 0; l < itJ->second.size(); ++l) { + for (unsigned int l = 0; l < itJ->second.size(); ++l) { const int i = itJ->second[l].i; const int j = itJ->second[l].j; num -= itJ->second[l].val * jac(i) * jac(j); } num *= beta; - for (int l = 0; l < itP->second.size(); ++l) { + for (unsigned int l = 0; l < itP->second.size(); ++l) { const int i = itP->second[l].i; const int j = itP->second[l].j; const int k = itP->second[l].k; @@ -1280,7 +1280,7 @@ void MetricBasis::_maxAstK4(const fullMatrix<double> &coeff, num += itJ->second[l].val * jac(i) * jac(j); } num *= beta; - for (int l = 0; l < itP->second.size(); ++l) { + for (unsigned int l = 0; l < itP->second.size(); ++l) { const int i = itP->second[l].i; const int j = itP->second[l].j; const int k = itP->second[l].k; @@ -1320,12 +1320,12 @@ void MetricBasis::_maxKstA(const fullMatrix<double> &coeff, while (itJ != _ineqJ2.end() && itP != _ineqP3.end()) { double num = 0, den = 0; - for (int l = 0; l < itJ->second.size(); ++l) { + for (unsigned int l = 0; l < itJ->second.size(); ++l) { const int i = itJ->second[l].i; const int j = itJ->second[l].j; num -= itJ->second[l].val * jac(i) * jac(j); } - for (int l = 0; l < itP->second.size(); ++l) { + for (unsigned int l = 0; l < itP->second.size(); ++l) { const int i = itP->second[l].i; const int j = itP->second[l].j; const int k = itP->second[l].k; @@ -1360,13 +1360,13 @@ void MetricBasis::_maxKstA2(const fullMatrix<double> &coeff, while (itJ != _ineqJ2.end() && itP != _ineqP3.end()) { double num = 0, den = 0; - for (int l = 0; l < itJ->second.size(); ++l) { + for (unsigned int l = 0; l < itJ->second.size(); ++l) { const int i = itJ->second[l].i; const int j = itJ->second[l].j; num -= itJ->second[l].val * jac(i) * jac(j); } num *= beta; - for (int l = 0; l < itP->second.size(); ++l) { + for (unsigned int l = 0; l < itP->second.size(); ++l) { const int i = itP->second[l].i; const int j = itP->second[l].j; const int k = itP->second[l].k; @@ -1408,7 +1408,7 @@ void MetricBasis::_maxKstA3(const fullMatrix<double> &coeff, while (itJ != _ineqJ2.end() && itP != _ineqP3.end()) { double num = 0, den = 0; - for (int l = 0; l < itJ->second.size(); ++l) { + for (unsigned int l = 0; l < itJ->second.size(); ++l) { const int i = itJ->second[l].i; const int j = itJ->second[l].j; num -= itJ->second[l].val * jac(i) * jac(j); -- GitLab