From f81e069d7d54dd5250e2d003d6a02a1750403a4c Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 23 Nov 2000 17:16:38 +0000 Subject: [PATCH] Removed unused variables --- Common/Gmsh.h | 5 ++- Common/Version.h | 6 +-- Geo/CAD.cpp | 38 ++++++++-------- Geo/StepGeomDatabase.cpp | 5 +-- Geo/Verif.cpp | 5 +-- Makefile | 2 +- Mesh/1D_Mesh.cpp | 6 +-- Mesh/3D_BGMesh.cpp | 4 +- Mesh/3D_Bricks.cpp | 4 +- Mesh/3D_Coherence.cpp | 95 ++++++++++++++++++++-------------------- 10 files changed, 83 insertions(+), 87 deletions(-) diff --git a/Common/Gmsh.h b/Common/Gmsh.h index c654ae5cc5..05c45194ae 100644 --- a/Common/Gmsh.h +++ b/Common/Gmsh.h @@ -1,4 +1,4 @@ -/* $Id: Gmsh.h,v 1.2 2000-11-23 14:11:27 geuzaine Exp $ */ +/* $Id: Gmsh.h,v 1.3 2000-11-23 17:16:37 geuzaine Exp $ */ #ifndef _GMSH_H_ #define _GMSH_H_ @@ -6,6 +6,9 @@ only if really necessary, since it will force the whole code to be rebuilt... */ +#undef bool +#define bool int + #undef true #define true 1 diff --git a/Common/Version.h b/Common/Version.h index aa73e8e230..14bbbdbfb0 100644 --- a/Common/Version.h +++ b/Common/Version.h @@ -1,7 +1,7 @@ #define GMSH_VERSION 0.995 -#define GMSH_DATE "Thu Nov 23 17:33:29 MET 2000" -#define GMSH_HOST "elap57.montefiore.ulg.ac.be" +#define GMSH_DATE "Thu Nov 23 18:15:16 CET 2000" +#define GMSH_HOST "elap20.montefiore.ulg.ac.be" #define GMSH_PACKAGER "geuzaine" -#define GMSH_OS "OSF1 V4.0" +#define GMSH_OS "IRIX64 6.5" #define GMSH_URL "http://www.geuz.org/gmsh/" #define GMSH_EMAIL "Christophe.Geuzaine@ulg.ac.be, Remacle@scorec.rpi.edu" diff --git a/Geo/CAD.cpp b/Geo/CAD.cpp index 6d462ff095..6ea9ae6768 100644 --- a/Geo/CAD.cpp +++ b/Geo/CAD.cpp @@ -1,4 +1,4 @@ -/* $Id: CAD.cpp,v 1.2 2000-11-23 14:11:30 geuzaine Exp $ */ +/* $Id: CAD.cpp,v 1.3 2000-11-23 17:16:37 geuzaine Exp $ */ #include "Gmsh.h" #include "Geo.h" @@ -240,7 +240,7 @@ static double projectPC (double u){ DSQR(c.Pos.Z -VERTEX->Pos.Z)); } -static int UFIXED=0,VFIXED=0; +static int UFIXED=0; static double FIX; static double projectPCS (double u){ //x[1] = u x[2] = v @@ -267,11 +267,10 @@ static double projectPCS (double u){ } bool ProjectPointOnCurve (Curve *c, Vertex *v, Vertex *RES, Vertex *DER){ - double x,xmin; - int check; + double xmin; CURVE = c; VERTEX = v; - x = min1d ( projectPC, &xmin); + min1d ( projectPC, &xmin); *RES = InterpolateCurve(CURVE,xmin,0); *DER = InterpolateCurve(CURVE,xmin,1); if(xmin > c->uend){ @@ -282,7 +281,6 @@ bool ProjectPointOnCurve (Curve *c, Vertex *v, Vertex *RES, Vertex *DER){ *RES = InterpolateCurve(CURVE,c->ubeg,0); *DER = InterpolateCurve(CURVE,c->ubeg,1); } - if(!check)return false; return true; } @@ -325,11 +323,10 @@ bool search_in_boundary ( Surface *s, Vertex *p, double t, int Fixu, FIX = t; UFIXED = Fixu; - VFIXED = !Fixu; - double xm,xq; + double xm; if(Fixu)xm = vmin; else xm = umin; - if(lmin > 1.e-3)xq = min1d ( projectPCS, &xm); + if(lmin > 1.e-3) min1d ( projectPCS, &xm); if(Fixu){ *uu = t; *vv = xm; @@ -555,15 +552,17 @@ Surface *DuplicateSurface (Surface *s, int addthesurf){ Surface *ps; Curve *c,*newc; Vertex *v,*newv; + int i; + ps = Create_Surface(addthesurf?MAXREG++:-MAXREG,0,0); CopySurface(s,ps); - for(int i=0;i<List_Nbr(ps->s.Generatrices);i++){ + for(i=0;i<List_Nbr(ps->s.Generatrices);i++){ List_Read(ps->s.Generatrices,i,&c); newc = DuplicateCurve(c); List_Write(ps->s.Generatrices,i,&newc); } - for(int i=0;i<List_Nbr(ps->Control_Points);i++){ + for(i=0;i<List_Nbr(ps->Control_Points);i++){ List_Read(ps->Control_Points,i,&v); newv = DuplicateVertex(v); List_Write(ps->Control_Points,i,&newv); @@ -606,12 +605,14 @@ void ApplyTransformationToPoint ( double matrix[4][4], Vertex *v ){ /* Linear Applications */ void SetTranslationMatrix (double matrix[4][4],double T[3]){ - for(int i=0;i<4;i++){ - for(int j=0;j<4;j++){ + int i, j; + + for(i=0;i<4;i++){ + for(j=0;j<4;j++){ matrix[i][j] = (i==j)? 1.0:0.0; } } - for(int i=0;i<3;i++)matrix[i][3] = T[i]; + for(i=0;i<3;i++)matrix[i][3] = T[i]; } void SetSymmetryMatrix (double matrix[4][4],double A, double B, double C, double D){ @@ -782,12 +783,13 @@ void ApplyTransformationToCurve (double matrix[4][4],Curve *c){ void ApplyTransformationToSurface (double matrix[4][4],Surface *s){ Curve *c; Vertex *v; - - for(int i=0;i<List_Nbr(s->s.Generatrices);i++){ + int i; + + for(i=0;i<List_Nbr(s->s.Generatrices);i++){ List_Read(s->s.Generatrices,i,&c); ApplyTransformationToCurve (matrix,c); } - for(int i=0;i<List_Nbr(s->Control_Points);i++){ + for(i=0;i<List_Nbr(s->Control_Points);i++){ List_Read(s->Control_Points,i,&v); ApplyTransformationToPoint (matrix,v); } @@ -1185,7 +1187,7 @@ int compareTwoCurves (const void *a, const void *b){ if(comp)return comp; // a finir pour des splines !! return 0; - return c1->Num - c2->Num; + //return c1->Num - c2->Num; } int compareAbsCurve (const void *a, const void *b){ diff --git a/Geo/StepGeomDatabase.cpp b/Geo/StepGeomDatabase.cpp index 3d683838ae..b2fc72cbe3 100644 --- a/Geo/StepGeomDatabase.cpp +++ b/Geo/StepGeomDatabase.cpp @@ -1,4 +1,4 @@ -/* $Id: StepGeomDatabase.cpp,v 1.2 2000-11-23 14:11:31 geuzaine Exp $ */ +/* $Id: StepGeomDatabase.cpp,v 1.3 2000-11-23 17:16:38 geuzaine Exp $ */ #include "Gmsh.h" #include "Geo.h" @@ -485,13 +485,12 @@ void Resolve_BREP (void){ Step_Oriented_Edge_t *poe; Step_Axis2_Placement3D_t *axs; Step_Closed_Shell_t cs; - List_T *ListInt,*ListIntBis,*ListDouble; + List_T *ListInt,*ListIntBis; double ubeg,uend,n[3],t[3],p[3],XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX,L; int fob; ListInt = List_Create(2,2,sizeof(int)); ListIntBis = List_Create(2,2,sizeof(int)); - ListDouble = List_Create(2,2,sizeof(double)); for(i=0;i<List_Nbr(BREP->AllCartesian_Points);i++){ List_Read(BREP->AllCartesian_Points,i,&cp); diff --git a/Geo/Verif.cpp b/Geo/Verif.cpp index 8db94a3e36..c0defaba35 100644 --- a/Geo/Verif.cpp +++ b/Geo/Verif.cpp @@ -1,4 +1,4 @@ -/* $Id: Verif.cpp,v 1.2 2000-11-23 14:11:31 geuzaine Exp $ */ +/* $Id: Verif.cpp,v 1.3 2000-11-23 17:16:38 geuzaine Exp $ */ #include "Gmsh.h" #include "Geo.h" @@ -13,7 +13,6 @@ extern Mesh *THEM; static Tree_T *treelink; static Tree_T *treeedges; static Tree_T *treefaces; -static List_T *listlink; typedef struct { int n,a,arbre; @@ -154,7 +153,6 @@ void CreeLiens ( void ) { } } } - listlink = Tree2List(treelink); } @@ -186,7 +184,6 @@ void CreeLiens2 ( void ) { } } List_Delete(temp); - listlink = Tree2List(treelink); } diff --git a/Makefile b/Makefile index 91c2e98678..c1682ed360 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,7 @@ sgi: tag "GL_INCLUDE=$(OPENGL_INC)" \ "MOTIF_INCLUDE=$(MOTIF_INC)" \ ); done - @for i in mesh; do (cd $$i && $(MAKE) \ + @for i in Mesh; do (cd $$i && $(MAKE) \ "CC=CC" \ "C_FLAGS=-O1 -o32" \ "RANLIB=true"\ diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index b82ce9005b..4eb191d82d 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 1D_Mesh.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 1D_Mesh.cpp,v 1.3 2000-11-23 17:16:38 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -13,7 +13,6 @@ extern Context_T CTX; extern int CurrentNodeNumber; Curve *THEC; -static Vertex *p0, *pn; double Fun (double t){ Vertex der; @@ -98,9 +97,6 @@ void Maillage_Curve (void *data, void *dummy){ List_Delete (Points); } else{ - p0 = c->beg; - pn = c->end; - Points = List_Create (10, 10, sizeof (IntPoint)); c->l = Integration (c->ubeg, c->uend, Fun, Points, 1.e-5); List_Delete (Points); diff --git a/Mesh/3D_BGMesh.cpp b/Mesh/3D_BGMesh.cpp index 9e7b0257ef..3c58773fc7 100644 --- a/Mesh/3D_BGMesh.cpp +++ b/Mesh/3D_BGMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_BGMesh.cpp,v 1.4 2000-11-23 16:07:12 geuzaine Exp $ */ +/* $Id: 3D_BGMesh.cpp,v 1.5 2000-11-23 17:16:38 geuzaine Exp $ */ #include "Gmsh.h" #include "Mesh.h" @@ -183,7 +183,7 @@ int BGMWithView (Post_View * ErrView){ Tree_Add (Pts, &v); } } - si = Create_Simplex (ver[0], ver[1], ver[2], ver[4]); + si = Create_Simplex (ver[0], ver[1], ver[2], ver[3]); Tree_Add (m.Simplexes, &si); } diff --git a/Mesh/3D_Bricks.cpp b/Mesh/3D_Bricks.cpp index 47d2f041c5..a5138cbb25 100644 --- a/Mesh/3D_Bricks.cpp +++ b/Mesh/3D_Bricks.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_Bricks.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 3D_Bricks.cpp,v 1.3 2000-11-23 17:16:38 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -110,7 +110,7 @@ void AddSimplexInGrid (Mesh * m, Simplex * s, int boule_boite){ ZmaxBox = DMAX (ZmaxBox, s->V[i]->Pos.Z); } } - else if ((boule_boite = BOULE)){ + else if (boule_boite == BOULE){ XminBox = s->Center.X - s->Radius; XmaxBox = s->Center.X + s->Radius; YminBox = s->Center.Y - s->Radius; diff --git a/Mesh/3D_Coherence.cpp b/Mesh/3D_Coherence.cpp index 6284792ea4..21c6291093 100644 --- a/Mesh/3D_Coherence.cpp +++ b/Mesh/3D_Coherence.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_Coherence.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 3D_Coherence.cpp,v 1.3 2000-11-23 17:16:38 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -166,15 +166,12 @@ void swap_quads (void *a, void *b){ void swap_quads2 (void *a, void *b){ Edge *q; - int K; Simplex *s1, *s2; q = (Edge *) a; List_Read (q->Simplexes, 0, &s1); List_Read (q->Simplexes, 1, &s2); - K = -1; - if (memesens (s1->V[0], s1->V[1], s1->V[2], q->O[0], q->O[1], q->V[0])){ s1->V[0] = q->O[0]; s1->V[1] = q->O[1]; @@ -320,10 +317,9 @@ void crEdges (Tree_T * TreeElem, Tree_T * treeedges){ void find_missing (void *a, void *b){ Edge *e; - exf_T exf; e = (Edge *) a; - exf.e1 = exf.e2 = *e; + if (!Tree_Search (EdgesTree, e)){ List_Add (Missing, e); Tree_Add (EdgesTree, e); @@ -387,11 +383,11 @@ Face *f1; int Cloture; void fillRi (void *a, void *b){ - int i, c, l; + int i, c; Simplex *s; s = *(Simplex **) a; - c = l = 0; + c = 0; for (i = 0; i < 4; i++){ if (!compareVertex (&e1, &s->V[i])) c++; @@ -615,7 +611,8 @@ Vertex *Edge_Face (Edge * e, Face * f){ Vertex *Edge_Edge (Edge * e, Vertex * v1, Vertex * v2){ Vertex *v; - int dir, dx1, dx2, dy1, dy2, dz1, dz2; + int dir; + //int dx1, dx2, dy1, dy2, dz1, dz2; double mat[2][2]; double b[3], res[3]; double XmaxS, XminS, YmaxS, YminS, ZmaxS, ZminS, lc; @@ -653,6 +650,7 @@ Vertex *Edge_Edge (Edge * e, Vertex * v1, Vertex * v2){ lc = myhypot (myhypot (XminV - XmaxV, YminV - YmaxV), ZminV - ZmaxV); + /* if (e->V[1]->Pos.X != e->V[0]->Pos.X && fabs (e->V[1]->Pos.X - e->V[0]->Pos.X) / lc > 1.e-2) dx1 = 1; @@ -685,42 +683,42 @@ Vertex *Edge_Edge (Edge * e, Vertex * v1, Vertex * v2){ else dz2 = 0; - /* - if(dx1 && dx2){ - mat[0][0] = e->V[1]->Pos.X - e->V[0]->Pos.X; - mat[0][1] = v1->Pos.X - v2->Pos.X; - b[0] = - e->V[0]->Pos.X + v1->Pos.X; - if(dy1 || dy2){ - mat[1][0] = e->V[1]->Pos.Y - e->V[0]->Pos.Y; - mat[1][1] = v1->Pos.Y - v2->Pos.Y; - b[1] = - e->V[0]->Pos.Y + v1->Pos.Y; - dir = 2; - } - else if(dz1 || dz2){ - mat[1][0] = e->V[1]->Pos.Z - e->V[0]->Pos.Z; - mat[1][1] = v1->Pos.Z - v2->Pos.Z; - b[1] = - e->V[0]->Pos.Z + v1->Pos.Z; - dir = 3; - } - } - else if (dy1 && dy2){ - mat[0][0] = e->V[1]->Pos.Y - e->V[0]->Pos.Y; - mat[0][1] = v1->Pos.Y - v2->Pos.Y; - b[0] = - e->V[0]->Pos.Y + v1->Pos.Y; - if(dy1 || dy2){ - mat[1][0] = e->V[1]->Pos.Y - e->V[0]->Pos.Y; - mat[1][1] = v1->Pos.Y - v2->Pos.Y; - b[1] = - e->V[0]->Pos.Y + v1->Pos.Y; - dir = 2; - } - else if(dz1 || dz2){ - mat[1][0] = e->V[1]->Pos.Z - e->V[0]->Pos.Z; - mat[1][1] = v1->Pos.Z - v2->Pos.Z; - b[1] = - e->V[0]->Pos.Z + v1->Pos.Z; - dir = 3; - } - } - */ + if(dx1 && dx2){ + mat[0][0] = e->V[1]->Pos.X - e->V[0]->Pos.X; + mat[0][1] = v1->Pos.X - v2->Pos.X; + b[0] = - e->V[0]->Pos.X + v1->Pos.X; + if(dy1 || dy2){ + mat[1][0] = e->V[1]->Pos.Y - e->V[0]->Pos.Y; + mat[1][1] = v1->Pos.Y - v2->Pos.Y; + b[1] = - e->V[0]->Pos.Y + v1->Pos.Y; + dir = 2; + } + else if(dz1 || dz2){ + mat[1][0] = e->V[1]->Pos.Z - e->V[0]->Pos.Z; + mat[1][1] = v1->Pos.Z - v2->Pos.Z; + b[1] = - e->V[0]->Pos.Z + v1->Pos.Z; + dir = 3; + } + } + else if (dy1 && dy2){ + mat[0][0] = e->V[1]->Pos.Y - e->V[0]->Pos.Y; + mat[0][1] = v1->Pos.Y - v2->Pos.Y; + b[0] = - e->V[0]->Pos.Y + v1->Pos.Y; + if(dy1 || dy2){ + mat[1][0] = e->V[1]->Pos.Y - e->V[0]->Pos.Y; + mat[1][1] = v1->Pos.Y - v2->Pos.Y; + b[1] = - e->V[0]->Pos.Y + v1->Pos.Y; + dir = 2; + } + else if(dz1 || dz2){ + mat[1][0] = e->V[1]->Pos.Z - e->V[0]->Pos.Z; + mat[1][1] = v1->Pos.Z - v2->Pos.Z; + b[1] = - e->V[0]->Pos.Z + v1->Pos.Z; + dir = 3; + } + } + */ + mat[0][0] = e->V[1]->Pos.X - e->V[0]->Pos.X; mat[0][1] = v1->Pos.X - v2->Pos.X; @@ -1151,7 +1149,8 @@ Simplex * Create_Simplex_MemeSens (Simplex * sold, Vertex * v1, Vertex * v2, Ver int Coherence (Volume * v, Mesh * m){ int i, j, k, Np, Nh; Surface *s; - Vertex *ver1, V1, *ver2, V2; + Vertex V1, V2 ; + //Vertex *ver1, *ver2 ; Face Face; static Edge E, *pE1, *pE2, *pE3; Simplex *simp, *simp1; @@ -1159,8 +1158,8 @@ int Coherence (Volume * v, Mesh * m){ FACE_DIMENSION = 2; - ver1 = &V1; - ver2 = &V2; + //ver1 = &V1; + //ver2 = &V2; THEVOL = v; -- GitLab