From cc426f76f539d78f13e97d36ae61c04f1719b7e9 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 26 Aug 2010 09:44:05 +0000
Subject: [PATCH] fix boundary layers from discreteEdges/Faces

---
 Mesh/Generator.cpp         | 1 -
 Mesh/HighOrder.cpp         | 4 ++++
 Mesh/meshGEdgeExtruded.cpp | 3 ++-
 Mesh/meshGFaceExtruded.cpp | 6 ++++--
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index 963157e2f0..f8fba46418 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -437,7 +437,6 @@ 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;
     for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
       if ((*it)->geomType() == GEntity::CompoundSurface)
diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp
index a11aa2ebe5..788dbf0fef 100644
--- a/Mesh/HighOrder.cpp
+++ b/Mesh/HighOrder.cpp
@@ -899,6 +899,8 @@ static void removeHighOrderVertices(GEntity *e)
 
 void SetOrder1(GModel *m)
 {
+  Msg::StatusBar(2, true, "Meshing order 1...");
+
   m->destroyMeshCaches();
 
   // replace all elements with first order elements
@@ -923,6 +925,8 @@ void SetOrder1(GModel *m)
     removeHighOrderVertices(*it);
   for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it)
     removeHighOrderVertices(*it);
+
+  Msg::StatusBar(2, true, "Done meshing order 1");
 }
 
 void checkHighOrderTriangles(const char* cc, GModel *m, 
diff --git a/Mesh/meshGEdgeExtruded.cpp b/Mesh/meshGEdgeExtruded.cpp
index 32273b60e2..95a55f7e7c 100644
--- a/Mesh/meshGEdgeExtruded.cpp
+++ b/Mesh/meshGEdgeExtruded.cpp
@@ -67,7 +67,8 @@ int MeshExtrudedCurve(GEdge *ge)
       Msg::Error("Unknown source curve %d for extrusion", ep->geo.Source);
       return 0;
     }
-    else if(from->meshStatistics.status != GEdge::DONE){
+    else if(from->geomType() != GEntity::DiscreteCurve &&
+            from->meshStatistics.status != GEdge::DONE){
       // cannot mesh this edge yet: will do it later
       return 1;
     }
diff --git a/Mesh/meshGFaceExtruded.cpp b/Mesh/meshGFaceExtruded.cpp
index 13dbc2dddf..54c1c419b9 100644
--- a/Mesh/meshGFaceExtruded.cpp
+++ b/Mesh/meshGFaceExtruded.cpp
@@ -231,8 +231,10 @@ int MeshExtrudedSurface(GFace *gf,
       Msg::Error("Unknown source surface %d for extrusion", ep->geo.Source);
       return 0;
     }
-    else if(from->meshStatistics.status != GFace::DONE){
-      // cannot mesh this face yet: will do it later
+    else if(from->geomType() != GEntity::DiscreteSurface &&
+            from->meshStatistics.status != GFace::DONE){
+      // cannot mesh the face yet (the source face is not meshed):
+      // will do it later
       return 1;
     }
     copyMesh(from, gf, pos);
-- 
GitLab