From 5ed4b9b015767585ea82c59e7a84a2edb925e7e7 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 15 Jul 2016 19:22:24 +0000 Subject: [PATCH] don't complain for generatrices of compounds not in old GEO db --- Geo/GFace.h | 4 ++-- Geo/Geo.cpp | 25 +++++++++++++++---------- Parser/Gmsh.y | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Geo/GFace.h b/Geo/GFace.h index 2a3c020442..f394f44fbe 100644 --- a/Geo/GFace.h +++ b/Geo/GFace.h @@ -44,7 +44,7 @@ class GFace : public GEntity{ mean_plane meanPlane; std::list<GEdge *> embedded_edges; std::list<GVertex *> embedded_vertices; - GFaceCompound *compound; // this model edge belongs to a compound + GFaceCompound *compound; // this model face belongs to a compound // replace edges (for gluing) for specific modelers, we have to // re-create internal data @@ -316,7 +316,7 @@ class GFace : public GEntity{ int getCurvatureControlParameter () const; void setCurvatureControlParameter(int); virtual double getMeshSize() const { return meshAttributes.meshSize; } - + struct { mutable GEntity::MeshGenerationStatus status; double worst_element_shape, best_element_shape, average_element_shape; diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 83d29b6388..52b56e0b8e 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -479,12 +479,14 @@ void End_Curve(Curve *c) break; } } - if (tmp.size() == nbCurrent) Msg::Error("Could not order compound edge %d to find begin and end vertex", c->Num); + if (tmp.size() == nbCurrent) + Msg::Error("Could not order compound edge %d to find begin and end vertex", + c->Num); } c->beg = vtcs.first; c->end = vtcs.second; c->compound.clear(); - c->compound.insert(c->compound.end(),ordered.begin(),ordered.end()); + c->compound.insert(c->compound.end(), ordered.begin(), ordered.end()); } } @@ -1657,7 +1659,8 @@ Curve *CreateReversedCurve(Curve *c) } if(c->Typ == MSH_SEGM_COMPOUND) { - newc->compound.insert(newc->compound.end(),c->compound.rbegin(),c->compound.rend()); + newc->compound.insert(newc->compound.end(), c->compound.rbegin(), + c->compound.rend()); } if(c->Typ == MSH_SEGM_CIRC) @@ -2324,29 +2327,30 @@ static List_T *GetCompoundUniqueEdges(Surface *ps) std::map<int, unsigned int> count_map; - for( int i = 0; i < num_surfs; i++ ){ + for(int i = 0; i < num_surfs; i++){ Surface *s = FindSurface(std::abs(comp_surfs[i])); if(!s){ - Msg::Error("Unknown surface %d", std::abs(comp_surfs[i]) ); + // don't complain: some compound surfaces are not in old GEO database + //Msg::Warning("Unknown surface %d", std::abs(comp_surfs[i]) ); List_Delete(bnd_c); return 0; } int num_in_surf = List_Nbr(s->Generatrices); - for( int m = 0; m < num_in_surf; m++ ){ + for(int m = 0; m < num_in_surf; m++){ Curve *c=0; List_Read(s->Generatrices, m, &c); if(!c){ - Msg::Error("Unknown curve"); + Msg::Warning("Unknown curve"); List_Delete(bnd_c); return 0; } if(!FindCurve(-c->Num)) { - Msg::Error("Unknown curve %d", -c->Num ); + Msg::Warning("Unknown curve %d", -c->Num); List_Delete(bnd_c); return 0; } int abs_Num = std::abs(c->Num) ; - if( count_map.find( abs_Num ) == count_map.end() ) + if(count_map.find( abs_Num ) == count_map.end()) count_map[ abs_Num ] = 1; else count_map[ abs_Num ]++; @@ -4668,7 +4672,8 @@ void setSurfaceGeneratrices(Surface *s, List_T *loops) if(s->Typ == MSH_SURF_COMPOUND){ s->Generatrices = GetOrderedUniqueEdges(s); if(!List_Nbr(s->Generatrices)){ - Msg::Warning("Could not make generatrices list for compound surface %d", s->Num); + // don't complain: compounds can be not in old GEO database + //Msg::Warning("Could not make generatrices list for compound surface %d", s->Num); return; } } diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index ca4a681c06..4bc2a3f48e 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -2207,7 +2207,7 @@ Shape : s->compound.push_back((int)*(double*)List_Pointer($7, i)); } // Added by Trevor Strickler - setSurfaceGeneratrices(s, (List_T*) 0 ); + setSurfaceGeneratrices(s, (List_T*) 0); Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s); } List_Delete($7); -- GitLab