From 4038020f794707dd9e69d9993c4239715ebd850f Mon Sep 17 00:00:00 2001
From: Jean-Francois Remacle <jean-francois.remacle@uclouvain.be>
Date: Fri, 1 Feb 2002 14:34:05 +0000
Subject: [PATCH] *** empty log message ***

---
 Graphics/Mesh.cpp              | 22 ++++++++++++++++------
 Mesh/2D_Mesh.cpp               |  4 ++--
 Mesh/Metric.cpp                | 11 +++++++++--
 Mesh/Read_Mesh.cpp             | 10 +++++-----
 benchmarks/2d/Square-Attr1.geo | 11 +++++++----
 benchmarks/2d/Square-Attr3.geo |  2 ++
 benchmarks/3d/cube.geo         |  7 +++++--
 benchmarks/3d/p19.geo          |  5 ++++-
 8 files changed, 50 insertions(+), 22 deletions(-)

diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp
index e0ee337b09..3859e5644d 100644
--- a/Graphics/Mesh.cpp
+++ b/Graphics/Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Mesh.cpp,v 1.45 2001-12-03 08:41:43 geuzaine Exp $
+// $Id: Mesh.cpp,v 1.46 2002-02-01 14:34:05 remacle Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -518,11 +518,6 @@ void Draw_Simplex_Surfaces (void *a, void *b){
 
   if(CTX.mesh.surfaces){
 
-    if (CTX.mesh.hidden) { 
-      glBegin(GL_POLYGON);
-      for(i=0 ; i<K*(1+L) ; i++) glVertex3d(pX[i], pY[i], pZ[i]);
-      glEnd();
-    }
     
     if(CTX.mesh.lines){
       if(CTX.mesh.color_carousel && ! (CTX.mesh.hidden || CTX.mesh.shade))
@@ -536,6 +531,21 @@ void Draw_Simplex_Surfaces (void *a, void *b){
       glEnd();    
     }
 
+    if(CTX.mesh.color_carousel)
+      ColorSwitch(iColor);
+    else{
+      if(K==3)
+	glColor4ubv((GLubyte*)&CTX.color.mesh.triangle);
+      else
+	glColor4ubv((GLubyte*)&CTX.color.mesh.quadrangle);
+    }
+    if (CTX.mesh.hidden) { 
+      glBegin(GL_POLYGON);
+      for(i=0 ; i<K*(1+L) ; i++) glVertex3d(pX[i], pY[i], pZ[i]);
+      glEnd();
+    }
+
+
   }
   
   if(CTX.mesh.normals) {
diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp
index b632e02f8a..9ef24919d0 100644
--- a/Mesh/2D_Mesh.cpp
+++ b/Mesh/2D_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Mesh.cpp,v 1.38 2001-11-01 09:41:32 geuzaine Exp $
+// $Id: 2D_Mesh.cpp,v 1.39 2002-02-01 14:34:05 remacle Exp $
 
 /*
    Maillage Delaunay d'une surface (Point insertion Technique)
@@ -924,7 +924,7 @@ void Maillage_Surface (void *data, void *dum){
   Tree_Action (THEM->Points, Freeze_Vertex);
   Tree_Action (s->Vertices, Freeze_Vertex);
   Tree_Action (THEM->Points, Projette_Plan_Moyen);
-  Tree_Action (s->Vertices, Projette_Plan_Moyen);
+  Tree_Action (s->Vertices , Projette_Plan_Moyen);
   Tree_Action (THEM->Curves, ActionEndTheCurve);
   s->Typ = MSH_SURF_PLAN;
   End_Surface (s);
diff --git a/Mesh/Metric.cpp b/Mesh/Metric.cpp
index 8cd744aa9a..5638cf9e9b 100644
--- a/Mesh/Metric.cpp
+++ b/Mesh/Metric.cpp
@@ -1,4 +1,4 @@
-// $Id: Metric.cpp,v 1.8 2001-12-16 05:16:37 remacle Exp $
+// $Id: Metric.cpp,v 1.9 2002-02-01 14:34:05 remacle Exp $
 #include <time.h>
 #include "Gmsh.h"
 #include "Numeric.h"
@@ -354,7 +354,14 @@ setSimplexQuality (Simplex * s, Surface * surf)
       s->Quality = DMAX (DMAX (q1, q2), q3) / (RacineDeTrois);
     }
   else
-    {      
+    { 
+      /*
+      Matrix3x3 myOldMetric (0.,m);
+      Identity();
+      Local_Metric_Of_Attractors (s->V[0]->Pos.X,s->V[0]->Pos.Y,s->V[0]->Pos.Z,0);
+      Local_Metric_Of_Attractors (s->V[1]->Pos.X,s->V[1]->Pos.Y,s->V[1]->Pos.Z,0);
+      Local_Metric_Of_Attractors (s->V[2]->Pos.X,s->V[2]->Pos.Y,s->V[2]->Pos.Z,0);
+      */
       s->Center_Ellipsum_2D (m);
       s->Quality = 3. * s->Radius / (s->V[0]->lc + s->V[1]->lc + s->V[2]->lc);
     }
diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp
index 06a51a1afe..6734e58142 100644
--- a/Mesh/Read_Mesh.cpp
+++ b/Mesh/Read_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Read_Mesh.cpp,v 1.37 2001-12-12 14:04:11 geuzaine Exp $
+// $Id: Read_Mesh.cpp,v 1.38 2002-02-01 14:34:05 remacle Exp $
 
 #include "Gmsh.h"
 #include "Geo.h"
@@ -121,14 +121,14 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){
 
         for (j = 0 ; j < Nbr_Nodes ; j++)
           fscanf(File_GEO, "%d", &verts[j].Num) ;
-        
-	if(Elementary >= 0){
+        // why ????
+	if(1 || Elementary >= 0){
 
 	  switch(Type){
 	  case LGN1: case LGN2:
-	    c = &C; c->Num = Elementary;
+	    c = &C; c->Num = abs(Elementary);
 	    if(!(cc = (Curve**)Tree_PQuery(M->Curves, &c))){
-	      c = Create_Curve(Elementary, MSH_SEGM_LINE, 0, NULL,
+	      c = Create_Curve(abs(Elementary), MSH_SEGM_LINE, 0, NULL,
 			       NULL, -1, -1, 0., 1.);
 	      c->Dirty=1;
 	      Tree_Add(M->Curves, &c);
diff --git a/benchmarks/2d/Square-Attr1.geo b/benchmarks/2d/Square-Attr1.geo
index 877312bdac..70dd36b7ab 100644
--- a/benchmarks/2d/Square-Attr1.geo
+++ b/benchmarks/2d/Square-Attr1.geo
@@ -12,9 +12,12 @@ Line(3) = {1,4};
 Line(4) = {4,3};                    
 Line Loop(5) = {1,2,3,4};                    
 Plane Surface(6) = {5};      
-Point(11) = {0.5,0.5,0,lc};                    
-Point(22) = {0.5,0.5,1,lc};                    
+Point(11) = {0 ,0.,0,lc};                    
+Point(22) = {0.,0.,1,lc};                    
 Line(5) = {11,22};                    
-//Attractor Point{1,2,3,4,11} = {.01,.01,7};                             
-Attractor Line{1,2,3,4} = {1,.1,7};                             
+//Attractor Point{1,2,3,4,11} = {.0001,.0001,17};                             
+Attractor Line{5} = {.01,1,18};                             
 Mesh.Algorithm = 2;
+Translate {0,0,1} {
+  Duplicata { Surface{6}; }
+}
diff --git a/benchmarks/2d/Square-Attr3.geo b/benchmarks/2d/Square-Attr3.geo
index a71a2146de..db9048528b 100644
--- a/benchmarks/2d/Square-Attr3.geo
+++ b/benchmarks/2d/Square-Attr3.geo
@@ -14,5 +14,7 @@ Line Loop(5) = {1,2,3,4};
 Plane Surface(6) = {5};      
 Line(5) = {3,1};                    
 Attractor Line{5} = {1,0.01,3};                             
+Attractor Line{1,3} = {1,0.01,3};                             
+Attractor Line{2} =   {.1,0.1,3};                             
 Mesh.Algorithm = 2;
 
diff --git a/benchmarks/3d/cube.geo b/benchmarks/3d/cube.geo
index 77a067c3d9..5e6f3d3c89 100644
--- a/benchmarks/3d/cube.geo
+++ b/benchmarks/3d/cube.geo
@@ -1,8 +1,8 @@
 /****************************  
 cube meshed uniformly  
 ****************************/  
-Point(1) = {0.0,0.0,0.0,.025};         
-Point(2) = {1,0.0,0.0,.025};         
+Point(1) = {0.0,0.0,0.0,.4};         
+Point(2) = {1,0.0,0.0,.4};         
 Point(3) = {1,1,0.0,.4};         
 Point(4) = {0,1,0.0,.4};         
 Line(1) = {4,3};         
@@ -15,3 +15,6 @@ Extrude Surface { 6, {0,0.0,1} };
     
 Surface Loop(29) = {23,6,15,19,28,27};   
 Complex Volume(30) = {29};   
+
+Mesh.Algorithm = 2;
+Attractor Line {1,2,3,4} = {.1,.1,3};
\ No newline at end of file
diff --git a/benchmarks/3d/p19.geo b/benchmarks/3d/p19.geo
index 4e363a9ca1..e8946cf4d6 100644
--- a/benchmarks/3d/p19.geo
+++ b/benchmarks/3d/p19.geo
@@ -1,4 +1,7 @@
-fact     = 0.1 ;
+// This factor has to be modified in
+// order to control mesh size
+fact     = .1 ;
+
 rondelle = fact * 0.01;
 iris     = fact * 0.004;
 size     = fact * 0.01;
-- 
GitLab