diff --git a/Fltk/fileDialogs.cpp b/Fltk/fileDialogs.cpp index cedc9cbde5ab9704c4f7d2a37d61c0d1d2e5a5fc..627493861c94453e5e61c462f27cd46e7b527c4a 100644 --- a/Fltk/fileDialogs.cpp +++ b/Fltk/fileDialogs.cpp @@ -1496,7 +1496,7 @@ int pvtuAdaptFileDialog(const char *name) if(!dialog){ dialog = new _pvtuAdaptFileDialog; - int h = 7 * BH + 3 * WB, w = w = 2 * BBB + 3 * WB, y = WB; + int h = 7 * BH + 3 * WB, w = 2 * BBB + 3 * WB, y = WB; dialog->window = new Fl_Double_Window(w, h, "Adaptive View Options"); dialog->window->box(GMSH_WINDOW_BOX); dialog->window->set_modal(); diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 8f983b939682b5cb062cc3a9c63d0797f8b7b545..554e6f7adb14485ad51f657b996a1fdcbf3a974e 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -2824,7 +2824,7 @@ static void message_menu_search_cb(Fl_Widget *w, void *data) { graphicWindow *g = (graphicWindow*)data; g->getMessageBrowser()->clear(); - for(int i = 0; i < g->getMessages().size(); i++) + for(int i = 0; i < (int)g->getMessages().size(); i++) g->getMessageBrowser()->add(g->getMessages()[i].c_str()); } diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 9efb49be63c96ae6a2a7d26e40519e50c7a16435..be303a93e66146bdde2c3c55592e8e8f8265a41e 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1296,7 +1296,7 @@ void GModel::_storeParentsInSubElements(std::map<int, std::vector<MElement*> > & { std::map<int, std::vector<MElement*> >::const_iterator it; for(it = map.begin(); it != map.end(); ++it) - for (int i=0; i<it->second.size(); ++i) + for (unsigned int i = 0; i < it->second.size(); ++i) it->second[i]->updateParent(this); } diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index b2564396b8de1dc53df34c79254ae4234533944f..4f616bda428cf3944118d6fbd7879d211eb916f6 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -657,7 +657,7 @@ bool MakeMeshConformal(GModel *gm, int howto) } } // HEX IS ONLY SURROUNED BY COMPATIBLE ELEMENTS - if (faces.size() == e->getNumFaces()){ + if ((int)faces.size() == e->getNumFaces()){ remainingPrisms.push_back(e); } else { diff --git a/Mesh/delaunay3d.cpp b/Mesh/delaunay3d.cpp index 9462014a05419085bf208178291acbb72316e576..95b97a75213851da3567d8cc95e4bebea49c136b 100644 --- a/Mesh/delaunay3d.cpp +++ b/Mesh/delaunay3d.cpp @@ -25,8 +25,6 @@ #include "MTetrahedron.h" #include "meshGRegionLocalMeshMod.h" -const int MEASURE_BARR = 0; - #ifdef _HAVE_NUMA #include <numa.h> #endif @@ -36,8 +34,8 @@ const int MEASURE_BARR = 0; struct HilbertSortB { -// The code for generating table transgc -// from: http://graphics.stanford.edu/~seander/bithacks.html. + // The code for generating table transgc from: + // http://graphics.stanford.edu/~seander/bithacks.html. int transgc[8][3][8]; int tsb1mod3[8]; int maxDepth; @@ -58,7 +56,8 @@ struct HilbertSortB ComputeGrayCode(3); } void MultiscaleSortHilbert(Vertex** vertices, int arraysize, - int threshold, double ratio, int *depth, std::vector<int> &indices) + int threshold, double ratio, int *depth, + std::vector<int> &indices) { int middle; @@ -308,7 +307,8 @@ void SortHilbert (std::vector<Vertex*>& v, std::vector<int> &indices) h.Apply(v, indices); } -void computeAdjacencies (Tet *t, int iFace, connContainer &faceToTet){ +void computeAdjacencies (Tet *t, int iFace, connContainer &faceToTet) +{ conn c (t->getFace(iFace), iFace, t); connContainer::iterator it = std::find(faceToTet.begin(),faceToTet.end(),c); if (it == faceToTet.end()){ @@ -328,8 +328,6 @@ void computeAdjacencies (Tet *t, int iFace, connContainer &faceToTet){ ************************************************************************/ - - /*********************************************************************** Compute all tets surrounding an edge ************************************************************************/ @@ -337,8 +335,8 @@ void computeAdjacencies (Tet *t, int iFace, connContainer &faceToTet){ static int edges[6][2] = {{0,1},{0,2},{0,3},{1,2},{1,3},{2,3}}; static int efaces[6][2] = {{0,2},{0,1},{1,2},{0,3},{2,3},{1,3}}; static int faces[4][3] = {{0,1,2},{0,2,3},{0,1,3},{1,2,3}}; -static int vnofaces[4] = {3,1,2,0}; -static int vFac[4][3] = {{0,1,2},{0,2,3},{0,1,3},{1,2,3}}; +//static int vnofaces[4] = {3,1,2,0}; +//static int vFac[4][3] = {{0,1,2},{0,2,3},{0,1,3},{1,2,3}}; static void computeNeighboringTetsOfACavity(const std::vector<Tet*> &cavity, std::vector<Tet*> &outside) @@ -533,10 +531,11 @@ bool edgeSwap(Tet *tet, int iLocalEdge, tetContainer &T, int myThread) return true; } -static void edgeSwapPass (tetContainer &T) { - +/* +static void edgeSwapPass (tetContainer &T) +{ } - +*/ /* Fixing a non star shaped cavity (non delaunay triangulations) @@ -547,7 +546,8 @@ static void edgeSwapPass (tetContainer &T) { static void starShapeness (Vertex *v, connContainer &bndK, std::vector<unsigned int> &_negatives, - double threshold){ + double threshold) +{ _negatives.clear(); for (unsigned int i=0; i< bndK.size(); i++) { // no symbolic perturbation @@ -561,8 +561,8 @@ static void starShapeness (Vertex *v, connContainer &bndK, } } -static Tet* tetContainsV (Vertex *v, cavityContainer &cavity){ - +static Tet* tetContainsV (Vertex *v, cavityContainer &cavity) +{ for (unsigned int i=0; i< cavity.size(); i++) { unsigned int count = 0; for (unsigned int j=0;j<4;j++){ @@ -581,7 +581,8 @@ static Tet* tetContainsV (Vertex *v, cavityContainer &cavity){ return NULL; } -static void buildDelaunayBall (cavityContainer &cavity, connContainer &faceToTet){ +static void buildDelaunayBall (cavityContainer &cavity, connContainer &faceToTet) +{ faceToTet.clear(); for (unsigned int i=0; i< cavity.size(); i++) { Tet *t = cavity[i]; @@ -599,10 +600,12 @@ static void buildDelaunayBall (cavityContainer &cavity, connContainer &faceToTet } } +/* static bool updateCavity(Tet *containsV, cavityContainer &cavity, connContainer &bndK, - int myThread, int K){ + int myThread, int K) +{ bndK.clear(); cavityContainer cc; cc.push_back(containsV); @@ -632,12 +635,13 @@ static bool updateCavity(Tet *containsV, cavity = cc; return true; } - +*/ static bool removeIsolatedTets(Tet *containsV, cavityContainer &cavity, connContainer &bndK, - int myThread, int K){ + int myThread, int K) +{ cavityContainer cc; cc.push_back(containsV); std::stack<Tet*> _stack; @@ -662,7 +666,8 @@ static bool removeIsolatedTets(Tet *containsV, return true; } -static Tet *tetInsideCavityWithFAce (Face &f, cavityContainer &cavity){ +static Tet *tetInsideCavityWithFAce (Face &f, cavityContainer &cavity) +{ // printf("size of cavity %ld\n",cavity.size()); for (unsigned int i=0; i< cavity.size(); i++) { Tet *t = cavity[i]; @@ -675,14 +680,13 @@ static Tet *tetInsideCavityWithFAce (Face &f, cavityContainer &cavity){ return NULL; } - static bool fixDelaunayCavity (double threshold, Vertex *v, cavityContainer &cavity, connContainer &bndK, int myThread, int K, - std::vector<unsigned int> & _negatives){ - + std::vector<unsigned int> & _negatives) +{ starShapeness (v, bndK, _negatives, threshold); if (_negatives.empty())return false; @@ -722,7 +726,8 @@ static void delaunayCavity2 (Tet *t, Vertex *v, cavityContainer &cavity, connContainer &bnd, - int thread, int iPnt){ + int thread, int iPnt) +{ t->set(thread, iPnt); // Mark the triangle cavity.push_back(t); for (int iNeigh=0; iNeigh<4 ; iNeigh++){ @@ -742,7 +747,8 @@ static void delaunayCavity2 (Tet *t, } } -Tet* walk (Tet *t, Vertex *v, int maxx, double &totSearch, int thread){ +Tet* walk (Tet *t, Vertex *v, int maxx, double &totSearch, int thread) +{ while (1){ totSearch++; if (t == NULL) { @@ -775,8 +781,8 @@ Tet* walk (Tet *t, Vertex *v, int maxx, double &totSearch, int thread){ Msg::Fatal("Jump-and-Walk Failed (No neighbor)"); } - -void __print (const char *name, connContainer &conn, Vertex *v){ +void __print (const char *name, connContainer &conn, Vertex *v) +{ FILE *f = fopen(name,"w"); fprintf(f,"View \"\"{\n"); @@ -823,7 +829,8 @@ void __print (const char *name, int thread, tetContainer &T, Vertex *v){ fclose(f); } -void print (std::vector<Vertex*> &V, std::vector<Tet*> &T){ +void print (std::vector<Vertex*> &V, std::vector<Tet*> &T) +{ std::map<Vertex*,int> nums; for (unsigned int i=0;i<V.size();i++){ nums[V[i]] = i; @@ -835,8 +842,8 @@ void print (std::vector<Vertex*> &V, std::vector<Tet*> &T){ } } - -void print (const char *name, std::vector<Vertex*> &T){ +void print (const char *name, std::vector<Vertex*> &T) +{ FILE *f = fopen(name,"w"); fprintf(f,"View \"\"{\n"); for (unsigned int i=0;i<T.size()-1;i++){ @@ -852,7 +859,8 @@ void print (const char *name, std::vector<Vertex*> &T){ xxx10000 ok if all bits on my right are 0 */ -bool canWeProcessCavity (cavityContainer &cavity, unsigned int myThread, unsigned int iPt) { +bool canWeProcessCavity (cavityContainer &cavity, unsigned int myThread, unsigned int iPt) +{ unsigned int cSize = cavity.size(); for (unsigned int j=0; j<cSize; j++) { Tet *f = cavity[j]; @@ -866,7 +874,8 @@ bool canWeProcessCavity (cavityContainer &cavity, unsigned int myThread, unsigne return true; } -bool checkLocalDelaunayness(Tet* t){ +bool checkLocalDelaunayness(Tet* t) +{ if (t->V[0]){ for (int i=0;i<4;i++){ Tet *n = t->T[i]; @@ -876,7 +885,8 @@ bool checkLocalDelaunayness(Tet* t){ return true; } -int checkLocalDelaunayness(tetContainer &c, int thread, char *msg){ +int checkLocalDelaunayness(tetContainer &c, int thread, char *msg) +{ int nLoc = 0; for (unsigned int i=0; i<c.size(thread); i++) { if (!checkLocalDelaunayness(c(thread,i)))nLoc++; @@ -885,7 +895,8 @@ int checkLocalDelaunayness(tetContainer &c, int thread, char *msg){ return nLoc ; } -static Tet* randomTet (int thread, tetContainer &allocator ){ +static Tet* randomTet (int thread, tetContainer &allocator) +{ unsigned int N = allocator.size(thread); // printf("coucou random TET %d %d\n",thread,N); while(1) { @@ -901,7 +912,8 @@ void delaunayTrgl (const unsigned int numThreads, unsigned int Npts, std::vector<Vertex*> assignTo[], tetContainer &allocator, - double threshold){ + double threshold) +{ #ifdef _VERBOSE double totSearchGlob=0; double totCavityGlob=0; @@ -1086,10 +1098,10 @@ void delaunayTrgl (const unsigned int numThreads, } - static void initialCube (std::vector<Vertex*> &v, Vertex *box[8], - tetContainer & allocator){ + tetContainer & allocator) +{ SBoundingBox3d bbox ; // bbox += SPoint3(0,0,0); // bbox += SPoint3(1,1,1); @@ -1137,7 +1149,8 @@ void delaunayTriangulation (const int numThreads, const int nptsatonce, std::vector<Vertex*> &S, Vertex *box[8], - tetContainer & allocator){ + tetContainer & allocator) +{ int N = S.size(); std::vector<int> indices; @@ -1188,7 +1201,8 @@ void delaunayTriangulation (const int numThreads, void delaunayTriangulation (const int numThreads, const int nptsatonce, std::vector<MVertex*> &S, - std::vector<MTetrahedron*> &T){ + std::vector<MTetrahedron*> &T) +{ std::vector<MVertex*> _temp; std::vector<Vertex*> _vertices; unsigned int N = S.size(); diff --git a/Mesh/delaunay3d.h b/Mesh/delaunay3d.h index 6ec913bb31f07534c47b6d1e66fdef4b5d4929bf..e20921b739cba0bc79d20d5a88941a38c13f20b1 100644 --- a/Mesh/delaunay3d.h +++ b/Mesh/delaunay3d.h @@ -5,6 +5,7 @@ #ifndef _DELAUNAY3D_H_ #define _DELAUNAY3D_H_ + class MVertex; class MTetrahedron; void delaunayTriangulation (const int numThreads, diff --git a/Mesh/delaunay_refinement.cpp b/Mesh/delaunay_refinement.cpp index efac724709673c2dbc7976d99ce1bb97adb16114..4d53dd74d1eb005fd31f2791ab561c909b983e17 100644 --- a/Mesh/delaunay_refinement.cpp +++ b/Mesh/delaunay_refinement.cpp @@ -1,3 +1,8 @@ +// Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle +// +// See the LICENSE.txt file for license information. Please report all +// bugs and problems to the public mailing list <gmsh@onelab.info>. + #ifdef _OPENMP #include <omp.h> #endif @@ -112,7 +117,10 @@ double adaptiveTrapezoidalRule (SPoint3 p1 , SPoint3 p2 , } -void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &p, void *), void *data, std::stack<IPT> &temp) { +void saturateEdge (Edge &e, std::vector<Vertex*> &S, + double (*f)(const SPoint3 &p, void *), + void *data, std::stack<IPT> &temp) +{ std::vector< IPT > _result; double dl; SPoint3 p1 = e.first->point(); @@ -158,11 +166,12 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 & // exit(1); } -void saturateEdges ( edgeContainer &ec, - tetContainer &T, - int nbThreads, - std::vector<Vertex*> &S, - double (*f)(const SPoint3 &p, void *), void *data) { +void saturateEdges(edgeContainer &ec, + tetContainer &T, + int nbThreads, + std::vector<Vertex*> &S, + double (*f)(const SPoint3 &p, void *), void *data) +{ std::stack<IPT> temp; AVGSEARCH= 0; // FIXME @@ -189,8 +198,7 @@ void saturateEdges ( edgeContainer &ec, class volumePointWithExclusionRegion { public : Vertex *_v; - volumePointWithExclusionRegion (Vertex *v) : _v(v){ - } + volumePointWithExclusionRegion (Vertex *v) : _v(v) {} inline bool inExclusionZone (volumePointWithExclusionRegion *p) const { @@ -221,7 +229,6 @@ struct my_wrapper_3D { _tooclose (false), _p(sp) {} }; - bool rtree_callback(volumePointWithExclusionRegion *neighbour,void* point) { my_wrapper_3D *w = static_cast<my_wrapper_3D*>(point); @@ -233,8 +240,6 @@ bool rtree_callback(volumePointWithExclusionRegion *neighbour,void* point) return true; } - - class vertexFilter { RTree<volumePointWithExclusionRegion*,double,3,double> _rtree; public: @@ -259,8 +264,8 @@ void filterVertices (const int numThreads, vertexFilter &_filter, std::vector<Vertex*> &add, double (*f)(const SPoint3 &p, void *), - void *data) { - + void *data) +{ std::vector<int> indices; SortHilbert(add, indices); std::vector<Vertex*> _add=add; @@ -295,13 +300,14 @@ void filterVertices (const int numThreads, } } - -double _fx (const SPoint3 &p, void *){ +double _fx (const SPoint3 &p, void *) +{ return fabs(0.0125 + .02*p.x()); } - -static void _print (const char *name, std::vector<Vertex*> &T){ +/* +static void _print (const char *name, std::vector<Vertex*> &T) +{ FILE *f = fopen(name,"w"); fprintf(f,"View \"\"{\n"); for (unsigned int i=0;i<T.size();i++){ @@ -311,10 +317,12 @@ static void _print (const char *name, std::vector<Vertex*> &T){ fprintf(f,"};\n"); fclose(f); } +*/ typedef std::set<conn> connSet; -void computeAdjacencies (Tet *t, int iFace, connSet &faceToTet){ +void computeAdjacencies (Tet *t, int iFace, connSet &faceToTet) +{ conn c (t->getFace(iFace), iFace, t); connSet::iterator it = faceToTet.find(c); if (it == faceToTet.end()){ @@ -336,8 +344,8 @@ bool edgeSwaps(tetContainer &T, int myThread) void edgeBasedRefinement (const int numThreads, const int nptsatonce, - GRegion *gr) { - + GRegion *gr) +{ // fill up old Datastructures tetContainer allocator (numThreads,1000000); diff --git a/Mesh/delaunay_refinement.h b/Mesh/delaunay_refinement.h index a2c0012f1b2130128f946f65e4795ffd6bd84a1b..1911d165aa0a1baed46b2460e256660bf484301e 100644 --- a/Mesh/delaunay_refinement.h +++ b/Mesh/delaunay_refinement.h @@ -1,13 +1,20 @@ +// Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle +// +// See the LICENSE.txt file for license information. Please report all +// bugs and problems to the public mailing list <gmsh@onelab.info>. + #ifndef _DELAUNAY_REFINEMENT_H #define _DELAUNAY_REFINEMENT_H + #include "SPoint3.h" #include <vector> class Tet; class Vertex; -void delaunayRefinement (const int numThreads, - const int nptsatonce, - std::vector<Vertex*> &S, +void delaunayRefinement (const int numThreads, + const int nptsatonce, + std::vector<Vertex*> &S, std::vector<Tet*> &T, - double (*f)(const SPoint3 &p, void *), - void *data); + double (*f)(const SPoint3 &p, void *), + void *data); + #endif diff --git a/Mesh/qualityMeasuresJacobian.cpp b/Mesh/qualityMeasuresJacobian.cpp index bad7e09e038c2d0c4926517b22a1ffb5bce90930..49885ce8191875ff7c98022ee413ec959993d3f7 100644 --- a/Mesh/qualityMeasuresJacobian.cpp +++ b/Mesh/qualityMeasuresJacobian.cpp @@ -833,7 +833,7 @@ bool _CoeffDataAnisotropy::_intersectionCurveLeftCorner(double beta, double gamm double KMaximum = (beta * aMaximum*aMaximum + gamma) * aMaximum; if (aMaximum < a || KMaximum < K) { Msg::Error("Sorry but, there is no intersection"); - return -1; + return false; } } diff --git a/Mesh/simple3D.cpp b/Mesh/simple3D.cpp index 01c3e05f599bb061d7ecf644140a2b972b64e563..1507b1b3a912b88083bee82c23890909d6c7f18f 100644 --- a/Mesh/simple3D.cpp +++ b/Mesh/simple3D.cpp @@ -320,7 +320,7 @@ void Filler::treat_model() void Filler::treat_region(GRegion* gr) { - + int NumSmooth = CTX::instance()->mesh.smoothCrossField; std::cout << "NumSmooth = " << NumSmooth << std::endl ; if(NumSmooth && (gr->dim() == 3)){ @@ -406,14 +406,14 @@ void Filler::treat_region(GRegion* gr) x = boundary_vertices[i]->x(); y = boundary_vertices[i]->y(); z = boundary_vertices[i]->z(); - + node = new Node(SPoint3(x,y,z)); compute_parameters(node,gr); node->set_layer(0); - + it3 = limits.find(boundary_vertices[i]); node->set_limit(it3->second); - + rtree.Insert(node->min,node->max,node); fifo.push(node); } @@ -423,20 +423,20 @@ void Filler::treat_region(GRegion* gr) parent = fifo.front(); fifo.pop(); garbage.push_back(parent); - + if(parent->get_limit()!=-1 && parent->get_layer()>=parent->get_limit()){ continue; } - + spawns.clear(); spawns.resize(6); - + for(i=0;i<6;i++){ spawns[i] = new Node(); } - + create_spawns(gr,octree,parent,spawns); - + for(i=0;i<6;i++){ ok2 = 0; individual = spawns[i]; @@ -444,18 +444,18 @@ void Filler::treat_region(GRegion* gr) x = point.x(); y = point.y(); z = point.z(); - + if(inside_domain(octree,x,y,z)){ compute_parameters(individual,gr); individual->set_layer(parent->get_layer()+1); individual->set_limit(parent->get_limit()); - + if(far_from_boundary(octree,individual)){ wrapper.set_ok(1); wrapper.set_individual(individual); wrapper.set_parent(parent); rtree.Search(individual->min,individual->max,rtree_callback,&wrapper); - + if(wrapper.get_ok()){ fifo.push(individual); rtree.Insert(individual->min,individual->max,individual); @@ -466,22 +466,22 @@ void Filler::treat_region(GRegion* gr) } } } - + if(!ok2) delete individual; } - + if(count%100==0){ printf("%d\n",count); } count++; } - - + + int option = CTX::instance()->mesh.algo3d; CTX::instance()->mesh.algo3d = ALGO_3D_DELAUNAY; - + deleter(gr); - printf("%d vertices to add\n",new_vertices.size()); + printf("%d vertices to add\n", (int)new_vertices.size()); std::vector<GRegion*> regions; regions.push_back(gr); meshGRegion mesher(regions); //? @@ -822,4 +822,3 @@ void Filler::print_node(Node* node,std::ofstream& file) /*********static declarations*********/ std::vector<MVertex*> Filler::new_vertices; - diff --git a/Numeric/MetricBasis.cpp b/Numeric/MetricBasis.cpp index decce19cb3bf0c2bb3f17388ff5b5229c5fca25b..b13874765b628444ac19ea9c0abe3bc6128ea39c 100644 --- a/Numeric/MetricBasis.cpp +++ b/Numeric/MetricBasis.cpp @@ -724,7 +724,7 @@ bool MetricBasis::validateBezierForMetricAndJacobian() //================= - return 987; + return true; //987; //================= /*Msg::Info("Testing Bezier interpolation and subdivision " @@ -2041,7 +2041,7 @@ bool MetricBasis::_intersectionCurveLeftCorner(double beta, double c, // (i.e. the bounding curve is sufficiently sharp) if (3*beta*a*a + c < 0) { Msg::Error("The slope is negative, cannot compute the intersection"); - return -1; + return false; } const double minK = K; diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 26bf096a4beefab81a8866ce8bf4eba542ff1e09..0311486086615979d5276c4bc7a023168abf4665 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -7117,7 +7117,7 @@ yyreduce: case 179: #line 1983 "Gmsh.y" /* yacc.c:1646 */ { - GModel::current()->getGEOInternals()->addCompoundMesh ( 1 , (yyvsp[-1].l) ); + GModel::current()->getGEOInternals()->addCompoundMesh ( 1 , (yyvsp[-1].l) ); } #line 7123 "Gmsh.tab.cpp" /* yacc.c:1646 */ break; @@ -7369,7 +7369,7 @@ yyreduce: case 190: #line 2195 "Gmsh.y" /* yacc.c:1646 */ { - GModel::current()->getGEOInternals()->addCompoundMesh ( 2 , (yyvsp[-1].l) ); + GModel::current()->getGEOInternals()->addCompoundMesh ( 2 , (yyvsp[-1].l) ); } #line 7375 "Gmsh.tab.cpp" /* yacc.c:1646 */ break; @@ -7527,7 +7527,7 @@ yyreduce: case 196: #line 2334 "Gmsh.y" /* yacc.c:1646 */ { - GModel::current()->getGEOInternals()->addCompoundMesh ( 3 , (yyvsp[-1].l) ); + GModel::current()->getGEOInternals()->addCompoundMesh ( 3 , (yyvsp[-1].l) ); } #line 7533 "Gmsh.tab.cpp" /* yacc.c:1646 */ break; @@ -12355,7 +12355,7 @@ yyreduce: int j = (int)(yyvsp[-1].d); if(!gmsh_yystringsymbols.count((yyvsp[-3].c))) yymsg(0, "Unknown string variable '%s'", (yyvsp[-3].c)); - else if(j >= 0 && j < gmsh_yystringsymbols[(yyvsp[-3].c)].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[(yyvsp[-3].c)].size()) val = gmsh_yystringsymbols[(yyvsp[-3].c)][j]; else yymsg(0, "Index %d out of range", j); @@ -12373,7 +12373,7 @@ yyreduce: int j = (int)(yyvsp[-1].d); if(!gmsh_yystringsymbols.count((yyvsp[-3].c))) yymsg(0, "Unknown string variable '%s'", (yyvsp[-3].c)); - else if(j >= 0 && j < gmsh_yystringsymbols[(yyvsp[-3].c)].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[(yyvsp[-3].c)].size()) val = gmsh_yystringsymbols[(yyvsp[-3].c)][j]; else yymsg(0, "Index %d out of range", j); @@ -12391,7 +12391,7 @@ yyreduce: int j = (int)(yyvsp[-1].d); if(!gmsh_yystringsymbols.count((yyvsp[-3].c))) yymsg(0, "Unknown string variable '%s'", (yyvsp[-3].c)); - else if(j >= 0 && j < gmsh_yystringsymbols[(yyvsp[-3].c)].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[(yyvsp[-3].c)].size()) val = gmsh_yystringsymbols[(yyvsp[-3].c)][j]; else yymsg(0, "Index %d out of range", j); @@ -12409,7 +12409,7 @@ yyreduce: int j = (int)(yyvsp[-1].d); if(!gmsh_yystringsymbols.count((yyvsp[-3].c))) yymsg(0, "Unknown string variable '%s'", (yyvsp[-3].c)); - else if(j >= 0 && j < gmsh_yystringsymbols[(yyvsp[-3].c)].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[(yyvsp[-3].c)].size()) val = gmsh_yystringsymbols[(yyvsp[-3].c)][j]; else yymsg(0, "Index %d out of range", j); diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index e8b0bad4d159b66601a084960ec3c07b55f4fdb2..0a1ad9c387cde09e125c8356226f0d34f9dc234d 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1981,7 +1981,7 @@ Shape : | tCompound tLine ListOfDouble tEND { - GModel::current()->getGEOInternals()->addCompoundMesh ( 1 , $3 ); + GModel::current()->getGEOInternals()->addCompoundMesh ( 1 , $3 ); } | tCompound tLine '(' FExpr ')' tAFFECT ListOfDouble tEND @@ -2193,7 +2193,7 @@ Shape : } | tCompound tSurface ListOfDouble tEND { - GModel::current()->getGEOInternals()->addCompoundMesh ( 2 , $3 ); + GModel::current()->getGEOInternals()->addCompoundMesh ( 2 , $3 ); } | tCompound tSurface '(' FExpr ')' tAFFECT ListOfDouble tEND { @@ -2332,7 +2332,7 @@ Shape : } | tCompound tVolume ListOfDouble tEND { - GModel::current()->getGEOInternals()->addCompoundMesh ( 3 , $3 ); + GModel::current()->getGEOInternals()->addCompoundMesh ( 3 , $3 ); } | tCompound tVolume '(' FExpr ')' tAFFECT ListOfDouble tEND { @@ -5984,7 +5984,7 @@ StringExprVar : int j = (int)$3; if(!gmsh_yystringsymbols.count($1)) yymsg(0, "Unknown string variable '%s'", $1); - else if(j >= 0 && j < gmsh_yystringsymbols[$1].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[$1].size()) val = gmsh_yystringsymbols[$1][j]; else yymsg(0, "Index %d out of range", j); @@ -5998,7 +5998,7 @@ StringExprVar : int j = (int)$3; if(!gmsh_yystringsymbols.count($1)) yymsg(0, "Unknown string variable '%s'", $1); - else if(j >= 0 && j < gmsh_yystringsymbols[$1].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[$1].size()) val = gmsh_yystringsymbols[$1][j]; else yymsg(0, "Index %d out of range", j); @@ -6012,7 +6012,7 @@ StringExprVar : int j = (int)$3; if(!gmsh_yystringsymbols.count($1)) yymsg(0, "Unknown string variable '%s'", $1); - else if(j >= 0 && j < gmsh_yystringsymbols[$1].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[$1].size()) val = gmsh_yystringsymbols[$1][j]; else yymsg(0, "Index %d out of range", j); @@ -6026,7 +6026,7 @@ StringExprVar : int j = (int)$3; if(!gmsh_yystringsymbols.count($1)) yymsg(0, "Unknown string variable '%s'", $1); - else if(j >= 0 && j < gmsh_yystringsymbols[$1].size()) + else if(j >= 0 && j < (int)gmsh_yystringsymbols[$1].size()) val = gmsh_yystringsymbols[$1][j]; else yymsg(0, "Index %d out of range", j); diff --git a/Plugin/ThinLayerFixMesh.cpp b/Plugin/ThinLayerFixMesh.cpp index edb565a5ceb5ea1c45f798d46820ed3137ee424e..c61e3d935641a3c1b16bf824b4ded409e8bb1b58 100644 --- a/Plugin/ThinLayerFixMesh.cpp +++ b/Plugin/ThinLayerFixMesh.cpp @@ -980,7 +980,7 @@ void GMSH_ThinLayerFixMeshPlugin::FindNewPoint(SPoint3* CurrentPoint, int* Curre //proche d'un point //std::cout<<" Close to point"<<std::endl; double DistMinTmp = 10000000.0; - int indexMinTmp; + int indexMinTmp = 0; for (unsigned int i = 0;i < 4;i++){ double distanceTmp = sqrt(((*CurrentTet)->tet()->getVertex(i)->x() - ResultPoint.x()) * ((*CurrentTet)->tet()->getVertex(i)->x() - ResultPoint.x()) + ((*CurrentTet)->tet()->getVertex(i)->y() - ResultPoint.y()) * ((*CurrentTet)->tet()->getVertex(i)->y() - ResultPoint.y()) + ((*CurrentTet)->tet()->getVertex(i)->z() - ResultPoint.z()) * ((*CurrentTet)->tet()->getVertex(i)->z() - ResultPoint.z())); if (distanceTmp < DistMinTmp){