From df3e2650f7917b8940c4e84ec3314ce3232a83f4 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 13 Nov 2017 19:02:09 +0100
Subject: [PATCH] fix

---
 Mesh/BackgroundMesh.cpp   | 10 +++-------
 Mesh/BackgroundMesh2D.cpp |  8 ++++----
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/Mesh/BackgroundMesh.cpp b/Mesh/BackgroundMesh.cpp
index 381b9d7f32..02f197233c 100644
--- a/Mesh/BackgroundMesh.cpp
+++ b/Mesh/BackgroundMesh.cpp
@@ -224,7 +224,7 @@ static void propagateValuesOnFace(GFace *_gf,
 
 void backgroundMesh::propagate1dMesh(GFace *_gf)
 {
-  std::list<GEdge*> e;// = _gf->edges();
+  std::list<GEdge*> e = _gf->edges();
   std::list<GEdge*>::const_iterator it = e.begin();
   std::map<MVertex*,double> sizes;
 
@@ -278,8 +278,7 @@ crossField2d::crossField2d(MVertex* v, GEdge* ge)
 
 void backgroundMesh::propagateCrossFieldByDistance(GFace *_gf)
 {
-  std::list<GEdge*> e;
-
+  std::list<GEdge*> e = _gf->edges();
   std::list<GEdge*>::const_iterator it = e.begin();
   std::map<MVertex*,double> _cosines4,_sines4;
   std::map<MVertex*,SPoint2> _param;
@@ -437,11 +436,8 @@ void backgroundMesh::propagateCrossFieldHJ(GFace *_gf)
 void backgroundMesh::propagateCrossField(GFace *_gf, simpleFunction<double> *ONE)
 {
   std::map<MVertex*,double> _cosines4,_sines4;
-
-  std::list<GEdge*> e;
-
+  std::list<GEdge*> e = _gf->edges();
   std::list<GEdge*>::const_iterator it = e.begin();
-
   for( ; it != e.end(); ++it ){
     if (!(*it)->isSeam(_gf)){
       for(unsigned int i = 0; i < (*it)->lines.size(); i++ ){
diff --git a/Mesh/BackgroundMesh2D.cpp b/Mesh/BackgroundMesh2D.cpp
index f45c6707d1..fbf195fff7 100644
--- a/Mesh/BackgroundMesh2D.cpp
+++ b/Mesh/BackgroundMesh2D.cpp
@@ -288,7 +288,7 @@ void backgroundMesh2D::computeSizeField()
     return;
   }
 
-  list<GEdge*> e;
+  list<GEdge*> e = face->edges();
   list<GEdge*>::const_iterator it = e.begin();
   DoubleStorageType sizes;
 
@@ -391,7 +391,8 @@ void backgroundMesh2D::updateSizes()
 
 
 
-frameFieldBackgroundMesh2D::frameFieldBackgroundMesh2D(GFace *_gf):backgroundMesh2D(_gf,false)
+frameFieldBackgroundMesh2D::frameFieldBackgroundMesh2D(GFace *_gf)
+  : backgroundMesh2D(_gf, false)
 {
   reset();
 
@@ -473,13 +474,12 @@ void frameFieldBackgroundMesh2D::computeCrossField(simpleFunction<double> &eval_
 
   DoubleStorageType _cosines4,_sines4;
 
-  list<GEdge*> e;
   GFace *face = dynamic_cast<GFace*>(gf);
   if(!face){
     Msg::Error("Entity is not a face in background mesh");
     return;
   }
-
+  list<GEdge*> e = face->edges();
   list<GEdge*>::const_iterator it = e.begin();
 
   for( ; it != e.end(); ++it ){
-- 
GitLab