From 93e04cb018b77e3287332c19a078cabaf23ac730 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 15 Jun 2013 11:17:30 +0000 Subject: [PATCH] fix regression with extrusions of many surfaces: order faces by tag - this allows to minimize the number of passes necessary to resolve dependencies (otherwise 10 passes is not enough!) --- Mesh/Generator.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index a07b8d964d..d87557af7d 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -467,7 +467,7 @@ static void Mesh2D(GModel *m) // and curve meshes) is global as it depends on a smooth normal // field generated from the surface mesh of the source surfaces if(!Mesh2DWithBoundaryLayers(m)){ - std::set<GFace*> cf, f; + std::set<GFace*, GEntityLessThan> cf, f; for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it) if ((*it)->geomType() == GEntity::CompoundSurface) cf.insert(*it); @@ -479,14 +479,15 @@ static void Mesh2D(GModel *m) int nIter = 0, nTot = m->getNumFaces(); while(1){ int nPending = 0; - std::vector<GFace*> _temp; _temp.insert(_temp.begin(), f.begin(), f.end()); + std::vector<GFace*> temp; + temp.insert(temp.begin(), f.begin(), f.end()); #if defined(_OPENMP) #pragma omp parallel for schedule (dynamic) #endif - for(size_t K = 0 ; K < _temp.size() ; K++){ - if (_temp[K]->meshStatistics.status == GFace::PENDING){ - meshGFace mesher (true, CTX::instance()->mesh.multiplePasses); - mesher(_temp[K]); + for(size_t K = 0 ; K < temp.size() ; K++){ + if (temp[K]->meshStatistics.status == GFace::PENDING){ + meshGFace mesher(true, CTX::instance()->mesh.multiplePasses); + mesher(temp[K]); #if defined(_OPENMP) #pragma omp critical #endif @@ -499,9 +500,10 @@ static void Mesh2D(GModel *m) #if defined(_OPENMP) #pragma omp master #endif - for(std::set<GFace*>::iterator it = cf.begin(); it != cf.end(); ++it){ + for(std::set<GFace*, GEntityLessThan>::iterator it = cf.begin(); + it != cf.end(); ++it){ if ((*it)->meshStatistics.status == GFace::PENDING){ - meshGFace mesher (true, CTX::instance()->mesh.multiplePasses); + meshGFace mesher(true, CTX::instance()->mesh.multiplePasses); mesher(*it); nPending++; } @@ -520,7 +522,8 @@ static void Mesh2D(GModel *m) smoothing smm(CTX::instance()->mesh.optimizeLloyd,6); m->writeMSH("beforeLLoyd.msh"); smm.optimize_face(*it); - //int rec = 1;//(CTX::instance()->mesh.recombineAll || (*it)->meshAttributes.recombine); + //int rec = 1;//(CTX::instance()->mesh.recombineAll || + // (*it)->meshAttributes.recombine); m->writeMSH("afterLLoyd.msh"); //if(rec) recombineIntoQuads(*it); //m->writeMSH("afterRecombine.msh"); -- GitLab