From 1519eb2f91bc1c05ccb405cac648aad3ece0bbf7 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 26 Nov 2000 18:43:48 +0000 Subject: [PATCH] *** empty log message *** --- Common/Const.h | 15 +------- Common/Context.cpp | 28 ++++++++------- Common/Context.h | 6 ++-- DataStr/List.cpp | 4 +-- DataStr/Malloc.cpp | 3 +- DataStr/Malloc.h | 3 +- DataStr/Tools.cpp | 4 +-- DataStr/Tools.h | 3 +- DataStr/Tree.cpp | 3 +- DataStr/Tree.h | 3 +- DataStr/avl.cpp | 3 +- DataStr/avl.h | 3 +- Graphics/Draw.cpp | 35 +++++++++--------- Makefile | 8 ++--- Mesh/2D_Mesh.cpp | 4 +-- Mesh/3D_Divide.cpp | 81 ++++++++++++++++++++++++++++-------------- Mesh/Interpolation.cpp | 63 ++++++++++++++++---------------- Mesh/Read_Mesh.cpp | 6 ++-- Unix/CbInput.cpp | 31 +++++++++------- Unix/Main.cpp | 6 ++-- Unix/XStatic.h | 6 +--- 21 files changed, 161 insertions(+), 157 deletions(-) diff --git a/Common/Const.h b/Common/Const.h index efe25c694b..843d71cf3a 100644 --- a/Common/Const.h +++ b/Common/Const.h @@ -1,20 +1,7 @@ -/* $Id: Const.h,v 1.4 2000-11-26 15:43:44 geuzaine Exp $ */ +/* $Id: Const.h,v 1.5 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _CONSTS_H_ #define _CONSTS_H_ -#include <stdlib.h> - -//#define RAND_LONG LC * ((rand()%1000)/1.E08) - -//RAND_LC in [0, LC] -#define RAND_LC (LC*rand()/RAND_MAX) - -//RAND_LC_MIN in [0, LC_MIN] -#define RAND_LC_MIN (LC_MIN*rand()/RAND_MAX) - -//RAND_EPS in [0, LC/1.e12] -#define EPSILON_LC (LC/1.e12*rand()/RAND_MAX) - #define TEXT_BUFFER_SIZE 1024 #define SELECTION_BUFFER_SIZE 1024 #define LABEL_STR_L 16 diff --git a/Common/Context.cpp b/Common/Context.cpp index cd2ebbd040..ed4044e142 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -1,4 +1,4 @@ -/* $Id: Context.cpp,v 1.6 2000-11-26 15:43:44 geuzaine Exp $ */ +/* $Id: Context.cpp,v 1.7 2000-11-26 18:43:48 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -152,17 +152,21 @@ void InitContext(Context_T *ctx){ ctx->range[1] = 0.0 ; ctx->range[2] = 0.0 ; - ctx->viewport[0] = 0 ; - ctx->viewport[1] = 0 ; - ctx->viewport[2] = 1 ; - ctx->viewport[3] = 1 ; - ctx->render_mode = GMSH_RENDER ; - ctx->pixel_equiv_x = 0. ; - ctx->pixel_equiv_y = 0. ; - ctx->clip_plane0[0] = 0. ; - ctx->clip_plane0[1] = 0. ; - ctx->clip_plane0[2] = 0. ; - ctx->clip_plane0[3] = 0. ; + ctx->viewport[0] = 0 ; + ctx->viewport[1] = 0 ; + ctx->viewport[2] = 1 ; + ctx->viewport[3] = 1 ; + ctx->vxmin = 0. ; + ctx->vymin = 0. ; + ctx->vxmax = 0. ; + ctx->vymax = 0. ; + ctx->render_mode = GMSH_RENDER ; + ctx->pixel_equiv_x = 0. ; + ctx->pixel_equiv_y = 0. ; + ctx->clip_plane0[0] = 0. ; + ctx->clip_plane0[1] = 0. ; + ctx->clip_plane0[2] = 0. ; + ctx->clip_plane0[3] = 0. ; ctx->font_string = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*"; ctx->colorbar_font_string = "fixed"; diff --git a/Common/Context.h b/Common/Context.h index caf22b65ad..d881e47270 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -1,4 +1,4 @@ -/* $Id: Context.h,v 1.6 2000-11-26 15:43:44 geuzaine Exp $ */ +/* $Id: Context.h,v 1.7 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _CONTEXT_H_ #define _CONTEXT_H_ @@ -82,7 +82,9 @@ typedef struct { char *colorbar_font_string; /* font for colorbar */ /* OpenGL stuff */ - int viewport[4]; + int viewport[4]; /* current viewport */ + double vxmin, vxmax, vymin, vymax; + /* current viewport in real coordinates */ float light0[4]; /* light source position */ float shine; /* specular value */ int render_mode; /* RENDER, SELECT, FEEDBACK */ diff --git a/DataStr/List.cpp b/DataStr/List.cpp index 180204c265..0b88e988c9 100644 --- a/DataStr/List.cpp +++ b/DataStr/List.cpp @@ -1,6 +1,4 @@ -/* $Id: List.cpp,v 1.5 2000-11-26 15:43:45 geuzaine Exp $ */ -#define RCSID "$Id: List.cpp,v 1.5 2000-11-26 15:43:45 geuzaine Exp $" -/* Original author: Marc UME */ +/* $Id: List.cpp,v 1.6 2000-11-26 18:43:48 geuzaine Exp $ */ #include <stdlib.h> #include <stdio.h> diff --git a/DataStr/Malloc.cpp b/DataStr/Malloc.cpp index ee71a78570..b2db54f1f3 100644 --- a/DataStr/Malloc.cpp +++ b/DataStr/Malloc.cpp @@ -1,5 +1,4 @@ -/* $Id: Malloc.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ -#define RCSID "$Id: Malloc.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $" +/* $Id: Malloc.cpp,v 1.4 2000-11-26 18:43:48 geuzaine Exp $ */ #include <stdio.h> #include <stdlib.h> #include <malloc.h> diff --git a/DataStr/Malloc.h b/DataStr/Malloc.h index d327924761..3dd52fa35f 100644 --- a/DataStr/Malloc.h +++ b/DataStr/Malloc.h @@ -1,5 +1,4 @@ -/* $Id: Malloc.h,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -/* $Id: Malloc.h,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ +/* $Id: Malloc.h,v 1.3 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _UALLOC_H_ #define _UALLOC_H_ diff --git a/DataStr/Tools.cpp b/DataStr/Tools.cpp index 4afee6c84d..a136409e50 100644 --- a/DataStr/Tools.cpp +++ b/DataStr/Tools.cpp @@ -1,5 +1,5 @@ -/* $Id: Tools.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -#define RCSID "$Id: Tools.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $" +/* $Id: Tools.cpp,v 1.3 2000-11-26 18:43:48 geuzaine Exp $ */ + #include <stdlib.h> #include <math.h> #include "Tools.h" diff --git a/DataStr/Tools.h b/DataStr/Tools.h index 54b5ccb2e5..77a58430d9 100644 --- a/DataStr/Tools.h +++ b/DataStr/Tools.h @@ -1,5 +1,4 @@ -/* $Id: Tools.h,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -/* $Id: Tools.h,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ +/* $Id: Tools.h,v 1.3 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _TOOLS_H_ #define _TOOLS_H_ diff --git a/DataStr/Tree.cpp b/DataStr/Tree.cpp index d97244e83f..c2178ebc77 100644 --- a/DataStr/Tree.cpp +++ b/DataStr/Tree.cpp @@ -1,5 +1,4 @@ -/* $Id: Tree.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ -#define RCSID "$Id: Tree.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $" +/* $Id: Tree.cpp,v 1.4 2000-11-26 18:43:48 geuzaine Exp $ */ #include <stdlib.h> #include <string.h> diff --git a/DataStr/Tree.h b/DataStr/Tree.h index 8ec64f1a00..2d37b8c305 100644 --- a/DataStr/Tree.h +++ b/DataStr/Tree.h @@ -1,5 +1,4 @@ -/* $Id: Tree.h,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -/* $Id: Tree.h,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ +/* $Id: Tree.h,v 1.3 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _TREE_H_ #define _TREE_H_ diff --git a/DataStr/avl.cpp b/DataStr/avl.cpp index 8022131558..8c3808af90 100644 --- a/DataStr/avl.cpp +++ b/DataStr/avl.cpp @@ -1,5 +1,4 @@ -/* $Id: avl.cpp,v 1.3 2000-11-26 15:43:45 geuzaine Exp $ */ -#define RCSID "$Id: avl.cpp,v 1.3 2000-11-26 15:43:45 geuzaine Exp $" +/* $Id: avl.cpp,v 1.4 2000-11-26 18:43:48 geuzaine Exp $ */ /* * This is a modified version for Gmsh (for c++, 64-bit architectures, etc.) diff --git a/DataStr/avl.h b/DataStr/avl.h index 1c04354d70..3dd3f84ef3 100644 --- a/DataStr/avl.h +++ b/DataStr/avl.h @@ -1,5 +1,4 @@ -/* $Id: avl.h,v 1.3 2000-11-26 15:43:45 geuzaine Exp $ */ -/* $Id: avl.h,v 1.3 2000-11-26 15:43:45 geuzaine Exp $ */ +/* $Id: avl.h,v 1.4 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _AVL_H_ #define _AVL_H_ diff --git a/Graphics/Draw.cpp b/Graphics/Draw.cpp index 4e510465cc..ac0ebc7d41 100644 --- a/Graphics/Draw.cpp +++ b/Graphics/Draw.cpp @@ -1,4 +1,4 @@ -/* $Id: Draw.cpp,v 1.5 2000-11-26 15:43:46 geuzaine Exp $ */ +/* $Id: Draw.cpp,v 1.6 2000-11-26 18:43:48 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -18,7 +18,6 @@ extern Widgets_T WID ; #endif extern Context_T CTX ; -extern GLdouble vxmin, vxmax, vymin, vymax; extern Mesh M; extern List_T *Post_ViewList; @@ -137,31 +136,31 @@ void Orthogonalize(int x, int y){ Wa = (CTX.max[1]-CTX.min[1]) / (CTX.max[0]-CTX.min[0]); if(Va>Wa){ - vxmin = CTX.min[0]; - vxmax = CTX.max[0]; - vymin = 0.5*(CTX.min[1]+CTX.max[1]-Va*(CTX.max[0]-CTX.min[0])); - vymax = 0.5*(CTX.min[1]+CTX.max[1]+Va*(CTX.max[0]-CTX.min[0])); + CTX.vxmin = CTX.min[0]; + CTX.vxmax = CTX.max[0]; + CTX.vymin = 0.5*(CTX.min[1]+CTX.max[1]-Va*(CTX.max[0]-CTX.min[0])); + CTX.vymax = 0.5*(CTX.min[1]+CTX.max[1]+Va*(CTX.max[0]-CTX.min[0])); } else{ - vxmin = 0.5*(CTX.min[0]+CTX.max[0]-(CTX.max[1]-CTX.min[1])/Va); - vxmax = 0.5*(CTX.min[0]+CTX.max[0]+(CTX.max[1]-CTX.min[1])/Va); - vymin = CTX.min[1]; - vymax = CTX.max[1]; + CTX.vxmin = 0.5*(CTX.min[0]+CTX.max[0]-(CTX.max[1]-CTX.min[1])/Va); + CTX.vxmax = 0.5*(CTX.min[0]+CTX.max[0]+(CTX.max[1]-CTX.min[1])/Va); + CTX.vymin = CTX.min[1]; + CTX.vymax = CTX.max[1]; } - vxmin -= (vxmax-vxmin)/3.; vxmax += 0.25*(vxmax-vxmin); - vymin -= (vymax-vymin)/3.; vymax += 0.25*(vymax-vymin); + CTX.vxmin -= (CTX.vxmax-CTX.vxmin)/3.; CTX.vxmax += 0.25*(CTX.vxmax-CTX.vxmin); + CTX.vymin -= (CTX.vymax-CTX.vymin)/3.; CTX.vymax += 0.25*(CTX.vymax-CTX.vymin); - CTX.pixel_equiv_x = (vxmax-vxmin)/(CTX.viewport[2]-CTX.viewport[0]); - CTX.pixel_equiv_y = (vymax-vymin)/(CTX.viewport[3]-CTX.viewport[1]); + CTX.pixel_equiv_x = (CTX.vxmax-CTX.vxmin)/(CTX.viewport[2]-CTX.viewport[0]); + CTX.pixel_equiv_y = (CTX.vymax-CTX.vymin)/(CTX.viewport[3]-CTX.viewport[1]); if(CTX.ortho) { - glOrtho(vxmin,vxmax,vymin,vymax,0,100*CTX.lc); + glOrtho(CTX.vxmin,CTX.vxmax,CTX.vymin,CTX.vymax,0,100*CTX.lc); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslated(0.0, 0.0, -50*CTX.lc); } else{ - glFrustum(vxmin,vxmax,vymin,vymax,CTX.lc,100*CTX.lc); + glFrustum(CTX.vxmin,CTX.vxmax,CTX.vymin,CTX.vymax,CTX.lc,100*CTX.lc); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslated(0.0, 0.0, -10*CTX.lc); @@ -394,8 +393,8 @@ void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2, xscale1 = CTX.s[0]; yscale1 = CTX.s[1]; - set_s(0, CTX.s[0] * (vxmax-vxmin)/(X2-X1)); - set_s(1, CTX.s[1] * (vymax-vymin)/(Y1-Y2)); + set_s(0, CTX.s[0] * (CTX.vxmax-CTX.vxmin)/(X2-X1)); + set_s(1, CTX.s[1] * (CTX.vymax-CTX.vymin)/(Y1-Y2)); /* bif bif bif */ set_s(2, 0.5*(CTX.s[0]+CTX.s[1])); set_t(0, CTX.t[0] * (xscale1/CTX.s[0]) - ((Xc1+Xc2)/2.)*(1.-(xscale1/CTX.s[0]))); diff --git a/Makefile b/Makefile index 48e9600b75..9ba67d1810 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.6 2000-11-26 15:43:44 geuzaine Exp $ +# $Id: Makefile,v 1.7 2000-11-26 18:43:48 geuzaine Exp $ # ---------------------------------------------------------------------- # Makefile for Gmsh # ---------------------------------------------------------------------- @@ -95,7 +95,7 @@ parser: purge: for i in "." $(GMSH_DISTRIB_DIR) $(GMSH_LIB_DIR) $(GMSH_ARCHIVE_DIR)\ - $(GMSH_DEMO_DIR) $(GMSH_DOC_DIR); \ + $(GMSH_DEMO_DIR) $(GMSH_DOC_DIR) $(GMSH_BOX_DIR); \ do (cd $$i && $(RM) $(RMFLAGS) *~ *~~); \ done @@ -269,7 +269,3 @@ hp: big_endian $(MESA_LIB) $(MOTIF_LIB) $(X_LIB) -lm strip $(GMSH_BIN_DIR)/gmsh-$(GMSH_UNAME) -comp: - tar cvf gmsh-$(GMSH_UNAME).tar $(GMSH_BIN_DIR)/gmsh-$(GMSH_UNAME) - gzip gmsh-$(GMSH_UNAME).tar - diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index 5b2bf9a6ef..e5cb6f0039 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Mesh.cpp,v 1.7 2000-11-26 15:43:46 geuzaine Exp $ */ +/* $Id: 2D_Mesh.cpp,v 1.8 2000-11-26 18:43:48 geuzaine Exp $ */ /* Maillage Delaunay d'une surface (Point insertion Technique) @@ -870,8 +870,6 @@ void Maillage_Automatique_VieuxCode (Surface * pS, Mesh * m, int ori){ cp->perturbations[j].h = CTX.mesh.rand_factor * LC2D * rand()/RAND_MAX; cp->perturbations[j].v = CTX.mesh.rand_factor * LC2D * rand()/RAND_MAX; - //cp->perturbations[j].h = RAND_LONG; - //cp->perturbations[j].v = RAND_LONG; cp->oriented_points[j].numcontour = i; cp->oriented_points[j].quality = v->lc; diff --git a/Mesh/3D_Divide.cpp b/Mesh/3D_Divide.cpp index 6bf113227f..cc6858e3f6 100644 --- a/Mesh/3D_Divide.cpp +++ b/Mesh/3D_Divide.cpp @@ -1,4 +1,5 @@ -/* $Id: 3D_Divide.cpp,v 1.5 2000-11-26 15:43:46 geuzaine Exp $ */ +/* $Id: 3D_Divide.cpp,v 1.6 2000-11-26 18:43:48 geuzaine Exp $ */ + /* Routine de division des elements tetraedriques ou triangulaires @@ -309,10 +310,12 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, s->iEnt = IENT; Tree_Add (AddedTet, &s); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s = Create_Simplex (pI->s->V[1], pI->s->V[3], pI->s->V[2], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); } @@ -320,12 +323,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, /* Verifie */ s = Create_Simplex (pI->s->V[0], pI->s->V[3], pI->s->V[2], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); s = Create_Simplex (pI->s->V[3], pI->s->V[1], pI->s->V[0], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); } @@ -333,12 +338,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, /* Verifie */ s = Create_Simplex (pI->s->V[0], pI->s->V[1], pI->s->V[3], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); s = Create_Simplex (pI->s->V[1], pI->s->V[3], pI->s->V[2], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); } @@ -346,12 +353,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, /* Verifie */ s = Create_Simplex (pI->s->V[0], pI->s->V[1], pI->s->V[2], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); s = Create_Simplex (pI->s->V[1], pI->s->V[2], pI->s->V[3], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); } @@ -359,12 +368,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, /* Verifie */ s = Create_Simplex (pI->s->V[2], pI->s->V[0], pI->s->V[1], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); s = Create_Simplex (pI->s->V[1], pI->s->V[3], pI->s->V[0], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); } @@ -372,12 +383,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, /* Verifie */ s = Create_Simplex (pI->s->V[0], pI->s->V[3], pI->s->V[2], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); s = Create_Simplex (pI->s->V[0], pI->s->V[1], pI->s->V[2], pI->VE[0]); if (PARLE) - printf ("ajout %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("ajout %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s->iEnt = IENT; Tree_Add (AddedTet, &s); } @@ -403,7 +416,8 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, else if (pI->NbEdge == 3){ EEE++; /* - printf("tet %d %d %d %d\n",pI->s->V[0]->Num,pI->s->V[1]->Num,pI->s->V[2]->Num,pI->s->V[3]->Num); + printf("tet %d %d %d %d\n", + pI->s->V[0]->Num,pI->s->V[1]->Num,pI->s->V[2]->Num,pI->s->V[3]->Num); printf("ed %d %d\n",pI->s->V[edges_tetra[pI->E[0]][0]]->Num, pI->s->V[edges_tetra[pI->E[0]][1]]->Num); printf("ed %d %d\n",pI->s->V[edges_tetra[pI->E[1]][0]]->Num, @@ -455,10 +469,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, point3 = NULL; Tree_Add (TetDel, &pI->s); if (PARLE){ - printf ("simp = %d %d %d %d\n", pI->s->V[0]->Num, pI->s->V[1]->Num, pI->s->V[2]->Num, pI->s->V[3]->Num); - printf ("are = %d %d\n", pI->VF[0]->Num, pI->VF[1]->Num); - printf ("face1 = %d %d %d\n", pI->F[0]->V[0]->Num, pI->F[0]->V[1]->Num, pI->F[0]->V[2]->Num); - printf ("face2 = %d %d %d\n", pI->F[1]->V[0]->Num, pI->F[1]->V[1]->Num, pI->F[1]->V[2]->Num); + printf ("simp = %d %d %d %d\n", + pI->s->V[0]->Num, pI->s->V[1]->Num, pI->s->V[2]->Num, pI->s->V[3]->Num); + printf ("are = %d %d\n", + pI->VF[0]->Num, pI->VF[1]->Num); + printf ("face1 = %d %d %d\n", + pI->F[0]->V[0]->Num, pI->F[0]->V[1]->Num, pI->F[0]->V[2]->Num); + printf ("face2 = %d %d %d\n", + pI->F[1]->V[0]->Num, pI->F[1]->V[1]->Num, pI->F[1]->V[2]->Num); } for (i = 0; i < 4; i++){ if (compareVertex (&pI->F[0]->V[0], &pI->s->V[i]) && @@ -478,27 +496,32 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, s->iEnt = IENT; Tree_Add (AddedTet, &s); if (PARLE) - printf ("simp = %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("simp = %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s = Create_Simplex (point1, point4, pI->VF[0], pI->VF[1]); s->iEnt = IENT; Tree_Add (AddedTet, &s); if (PARLE) - printf ("simp = %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("simp = %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s = Create_Simplex (point1, point3, pI->VF[0], pI->VF[1]); s->iEnt = IENT; Tree_Add (AddedTet, &s); if (PARLE) - printf ("simp = %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("simp = %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s = Create_Simplex (point2, point4, point1, pI->VF[0]); s->iEnt = IENT; Tree_Add (AddedTet, &s); if (PARLE) - printf ("simp = %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("simp = %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); s = Create_Simplex (point2, point3, point1, pI->VF[0]); s->iEnt = IENT; Tree_Add (AddedTet, &s); if (PARLE) - printf ("simp = %d %d %d %d\n", s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); + printf ("simp = %d %d %d %d\n", + s->V[0]->Num, s->V[1]->Num, s->V[2]->Num, s->V[3]->Num); } else if (pI->NbEdge == 2){ @@ -554,22 +577,26 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, e1 = pI->VE[0]; e2 = pI->VE[1]; - if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][0]], &pI->s->V[edges_tetra[pI->E[1]][0]])){ + if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][0]], + &pI->s->V[edges_tetra[pI->E[1]][0]])){ common = pI->s->V[edges_tetra[pI->E[0]][0]]; other1 = pI->s->V[edges_tetra[pI->E[0]][1]]; other2 = pI->s->V[edges_tetra[pI->E[1]][1]]; } - else if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][0]], &pI->s->V[edges_tetra[pI->E[1]][1]])){ + else if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][0]], + &pI->s->V[edges_tetra[pI->E[1]][1]])){ common = pI->s->V[edges_tetra[pI->E[0]][0]]; other1 = pI->s->V[edges_tetra[pI->E[0]][1]]; other2 = pI->s->V[edges_tetra[pI->E[1]][0]]; } - else if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][1]], &pI->s->V[edges_tetra[pI->E[1]][0]])){ + else if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][1]], + &pI->s->V[edges_tetra[pI->E[1]][0]])){ common = pI->s->V[edges_tetra[pI->E[0]][1]]; other1 = pI->s->V[edges_tetra[pI->E[0]][0]]; other2 = pI->s->V[edges_tetra[pI->E[1]][1]]; } - else if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][1]], &pI->s->V[edges_tetra[pI->E[1]][1]])){ + else if (!compareVertex (&pI->s->V[edges_tetra[pI->E[0]][1]], + &pI->s->V[edges_tetra[pI->E[1]][1]])){ common = pI->s->V[edges_tetra[pI->E[0]][1]]; other1 = pI->s->V[edges_tetra[pI->E[0]][0]]; other2 = pI->s->V[edges_tetra[pI->E[1]][0]]; diff --git a/Mesh/Interpolation.cpp b/Mesh/Interpolation.cpp index 365f7e4017..caf44d0006 100644 --- a/Mesh/Interpolation.cpp +++ b/Mesh/Interpolation.cpp @@ -1,4 +1,4 @@ -/* $Id: Interpolation.cpp,v 1.4 2000-11-26 15:43:47 geuzaine Exp $ */ +/* $Id: Interpolation.cpp,v 1.5 2000-11-26 18:43:48 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -472,28 +472,26 @@ Vertex InterpolateSurface (Surface * s, double u, double v, /* I n t e r p o l a t e V o l u m e */ /* ------------------------------------------------------------------------ */ -/* Interpolation transfinie sur un hexaedre - prisme (avec s1=s4=a4, s5=s8=a8, a9=a12=f4) - f(u,v) = (1-u) f4(v,w) + u f2(v,w) - + (1-v) f1(u,w) + v f3(u,w) - + (1-w) f5(u,v) + w f6(u,v) - - [ (1-u)(1-v) c9(w) + (1-u)v c12(w) + u(1-v) c10(w) + uv c11(w) ] - - [ (1-v)(1-w) c1(u) + (1-v)w c5(u) + v(1-w) c3(u) + vw c7(u) ] - - [ (1-u)(1-w) c4(v) + (1-w)u c2(v) + w(1-u) c8(v) + uw c6(v) ] - + [ (1-u)(1-v)(1-w) s1 + u(1-v)(1-w) s2 + uv(1-w) s3 + (1-u)v(1-w) s4 + - (1-u)(1-v)w s5 + u(1-v)w s6 + uvw s7 + (1-u)vw s8 ] - */ +/* Interpolation transfinie sur un hexaedre + prisme (avec s1=s4=a4, s5=s8=a8, a9=a12=f4) + f(u,v) = (1-u) f4(v,w) + u f2(v,w) + + (1-v) f1(u,w) + v f3(u,w) + + (1-w) f5(u,v) + w f6(u,v) + - [ (1-u)(1-v) c9(w) + (1-u)v c12(w) + u(1-v) c10(w) + uv c11(w) ] + - [ (1-v)(1-w) c1(u) + (1-v)w c5(u) + v(1-w) c3(u) + vw c7(u) ] + - [ (1-u)(1-w) c4(v) + (1-w)u c2(v) + w(1-u) c8(v) + uw c6(v) ] + + [ (1-u)(1-v)(1-w) s1 + u(1-v)(1-w) s2 + uv(1-w) s3 + (1-u)v(1-w) s4 + + (1-u)(1-v)w s5 + u(1-v)w s6 + uvw s7 + (1-u)vw s8 ] +*/ #define TRAN_HEX(f1,f2,f3,f4,f5,f6,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,s1,s2,s3,s4,s5,s6,s7,s8,u,v,w) (1-u)*f4+u*f2+(1-v)*f1+v*f3+(1-w)*f5+w*f6-((1-u)*(1-v)*c9+(1-u)*v*c12+u*(1-v)*c10+u*v*c11)-((1-v)*(1-w)*c1+(1-v)*w*c5+v*(1-w)*c3+v*w*c7)-((1-u)*(1-w)*c4+(1-w)*u*c2+w*(1-u)*c8+u*w*c6)+(1-u)*(1-v)*(1-w)*s1+u*(1-v)*(1-w)*s2+u*v*(1-w)*s3+(1-u)*v*(1-w)*s4+(1-u)*(1-v)*w*s5+u*(1-v)*w*s6+u*v*w*s7+(1-u)*v*w*s8 -Vertex -TransfiniteHex (Vertex f1, Vertex f2, Vertex f3, Vertex f4, Vertex f5, Vertex f6, - Vertex c1, Vertex c2, Vertex c3, Vertex c4, Vertex c5, Vertex c6, - Vertex c7, Vertex c8, Vertex c9, Vertex c10, Vertex c11, Vertex c12, - Vertex s1, Vertex s2, Vertex s3, Vertex s4, - Vertex s5, Vertex s6, Vertex s7, Vertex s8, - double u, double v, double w) -{ +Vertex TransfiniteHex (Vertex f1, Vertex f2, Vertex f3, Vertex f4, Vertex f5, Vertex f6, + Vertex c1, Vertex c2, Vertex c3, Vertex c4, Vertex c5, Vertex c6, + Vertex c7, Vertex c8, Vertex c9, Vertex c10, Vertex c11, Vertex c12, + Vertex s1, Vertex s2, Vertex s3, Vertex s4, + Vertex s5, Vertex s6, Vertex s7, Vertex s8, + double u, double v, double w){ Vertex V; V.lc = TRAN_HEX (f1.lc, f2.lc, f3.lc, f4.lc, f5.lc, f6.lc, @@ -503,21 +501,24 @@ TransfiniteHex (Vertex f1, Vertex f2, Vertex f3, Vertex f4, Vertex f5, Vertex f6 u, v, w); V.Pos.X = TRAN_HEX (f1.Pos.X, f2.Pos.X, f3.Pos.X, f4.Pos.X, f5.Pos.X, f6.Pos.X, - c1.Pos.X, c2.Pos.X, c3.Pos.X, c4.Pos.X, c5.Pos.X, c6.Pos.X, - c7.Pos.X, c8.Pos.X, c9.Pos.X, c10.Pos.X, c11.Pos.X, c12.Pos.X, - s1.Pos.X, s2.Pos.X, s3.Pos.X, s4.Pos.X, s5.Pos.X, s6.Pos.X, s7.Pos.X, s8.Pos.X, + c1.Pos.X, c2.Pos.X, c3.Pos.X, c4.Pos.X, c5.Pos.X, c6.Pos.X, + c7.Pos.X, c8.Pos.X, c9.Pos.X, c10.Pos.X, c11.Pos.X, c12.Pos.X, + s1.Pos.X, s2.Pos.X, s3.Pos.X, s4.Pos.X, + s5.Pos.X, s6.Pos.X, s7.Pos.X, s8.Pos.X, u, v, w); V.Pos.Y = TRAN_HEX (f1.Pos.Y, f2.Pos.Y, f3.Pos.Y, f4.Pos.Y, f5.Pos.Y, f6.Pos.Y, - c1.Pos.Y, c2.Pos.Y, c3.Pos.Y, c4.Pos.Y, c5.Pos.Y, c6.Pos.Y, - c7.Pos.Y, c8.Pos.Y, c9.Pos.Y, c10.Pos.Y, c11.Pos.Y, c12.Pos.Y, - s1.Pos.Y, s2.Pos.Y, s3.Pos.Y, s4.Pos.Y, s5.Pos.Y, s6.Pos.Y, s7.Pos.Y, s8.Pos.Y, + c1.Pos.Y, c2.Pos.Y, c3.Pos.Y, c4.Pos.Y, c5.Pos.Y, c6.Pos.Y, + c7.Pos.Y, c8.Pos.Y, c9.Pos.Y, c10.Pos.Y, c11.Pos.Y, c12.Pos.Y, + s1.Pos.Y, s2.Pos.Y, s3.Pos.Y, s4.Pos.Y, + s5.Pos.Y, s6.Pos.Y, s7.Pos.Y, s8.Pos.Y, u, v, w); V.Pos.Z = TRAN_HEX (f1.Pos.Z, f2.Pos.Z, f3.Pos.Z, f4.Pos.Z, f5.Pos.Z, f6.Pos.Z, - c1.Pos.Z, c2.Pos.Z, c3.Pos.Z, c4.Pos.Z, c5.Pos.Z, c6.Pos.Z, - c7.Pos.Z, c8.Pos.Z, c9.Pos.Z, c10.Pos.Z, c11.Pos.Z, c12.Pos.Z, - s1.Pos.Z, s2.Pos.Z, s3.Pos.Z, s4.Pos.Z, s5.Pos.Z, s6.Pos.Z, s7.Pos.Z, s8.Pos.Z, + c1.Pos.Z, c2.Pos.Z, c3.Pos.Z, c4.Pos.Z, c5.Pos.Z, c6.Pos.Z, + c7.Pos.Z, c8.Pos.Z, c9.Pos.Z, c10.Pos.Z, c11.Pos.Z, c12.Pos.Z, + s1.Pos.Z, s2.Pos.Z, s3.Pos.Z, s4.Pos.Z, + s5.Pos.Z, s6.Pos.Z, s7.Pos.Z, s8.Pos.Z, u, v, w); return (V); @@ -538,9 +539,7 @@ void Normal2Surface (Surface * s, double u, double v, double n[3]){ norme (n); } -void -HessianNormal2Surface (Surface * s, double u, double v, double n[3]) -{ +void HessianNormal2Surface (Surface * s, double u, double v, double n[3]){ Vertex du, dv; double t1[3], t2[3]; du = InterpolateSurface (s, u, v, 1, 1); diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index 2346ea766a..126a9952bf 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: Read_Mesh.cpp,v 1.3 2000-11-26 15:43:47 geuzaine Exp $ */ +/* $Id: Read_Mesh.cpp,v 1.4 2000-11-26 18:43:48 geuzaine Exp $ */ #include "Gmsh.h" #include "Geo.h" @@ -152,9 +152,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){ Tree_Insert(M->Simplexes, &simp) ; break; case QUA1: - /* ! Fuck, fuck, fuck */ - simp = Create_Simplex(vertsp[0], vertsp[1], vertsp[2], NULL); - simp->V[3] = vertsp[3]; + simp = Create_Quadrangle(vertsp[0], vertsp[1], vertsp[2], vertsp[3]); simp->Num = Num ; simp->iEnt = Elementary ; Tree_Insert(s->Simplexes, &simp) ; diff --git a/Unix/CbInput.cpp b/Unix/CbInput.cpp index 3939c42f2a..7774953751 100644 --- a/Unix/CbInput.cpp +++ b/Unix/CbInput.cpp @@ -1,4 +1,4 @@ -/* $Id: CbInput.cpp,v 1.6 2000-11-26 15:43:48 geuzaine Exp $ */ +/* $Id: CbInput.cpp,v 1.7 2000-11-26 18:43:48 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -19,7 +19,6 @@ extern Context_T CTX ; extern XContext_T XCTX ; extern Widgets_T WID ; extern Mesh M; -extern GLdouble vxmin, vxmax, vymin, vymax; static int Modifier=0; @@ -411,8 +410,8 @@ void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb) switch(ibut){ case 1: if(!ZoomClick && Modifier){ - xb = vxmin + ((GLdouble) x / width) * (vxmax - vxmin); - yb = vymax - ((GLdouble) y / height) * (vymax - vymin); + xb = CTX.vxmin + ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin); + yb = CTX.vymax - ((GLdouble) y / height) * (CTX.vymax - CTX.vymin); xc1 = xb/CTX.s[0] - CTX.t[0]; yc1 = yb/CTX.s[1] - CTX.t[1]; ZoomClick=1; @@ -420,8 +419,8 @@ void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb) Modifier = 0; } else if(ZoomClick){ - xe = vxmin + ((GLdouble) x / width) * (vxmax - vxmin); - ye = vymax - ((GLdouble) y / height) * (vymax - vymin); + xe = CTX.vxmin + ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin); + ye = CTX.vymax - ((GLdouble) y / height) * (CTX.vymax - CTX.vymin); xc2 = xe/CTX.s[0] - CTX.t[0]; yc2 = ye/CTX.s[1] - CTX.t[1]; ZoomClick=0; @@ -519,8 +518,10 @@ void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb) if(ZoomClick) { - xz = vxmin + ((GLdouble) event->xbutton.x / width) * (vxmax - vxmin); - yz = vymax - ((GLdouble) event->xbutton.y / height) * (vymax - vymin) ; + xz = CTX.vxmin + ((GLdouble) event->xbutton.x / width) * + (CTX.vxmax - CTX.vxmin); + yz = CTX.vymax - ((GLdouble) event->xbutton.y / height) * + (CTX.vymax - CTX.vymin) ; if(CTX.overlay) { movzx = xz - xb; movzy = yz - yb; InitOv(); @@ -564,7 +565,7 @@ void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - gluOrtho2D(vxmin, vxmax, vymin, vymax); + gluOrtho2D(CTX.vxmin, CTX.vxmax, CTX.vymin, CTX.vymax); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); @@ -620,8 +621,10 @@ void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb) } if(FirstClick){ - xc1 = ( ((GLdouble) x / width) * (vxmax - vxmin) + vxmin )/CTX.s[0] - CTX.t[0]; - yc1 = ( vymax - ((GLdouble) y / height) * (vymax - vymin))/CTX.s[1] - CTX.t[1]; + xc1 = ( ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin) + + CTX.vxmin )/CTX.s[0] - CTX.t[0]; + yc1 = ( CTX.vymax - ((GLdouble) y / height) * + (CTX.vymax - CTX.vymin))/CTX.s[1] - CTX.t[1]; xt1 = CTX.t[0]; yt1 = CTX.t[1]; xscale1 = CTX.s[0]; @@ -650,8 +653,10 @@ void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb) } break; case 3: - xc = ( ((GLdouble) x / width) * (vxmax - vxmin) + vxmin ) / CTX.s[0]; - yc = ( vymax - ((GLdouble) y / height) * (vymax - vymin)) / CTX.s[1]; + xc = ( ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin) + + CTX.vxmin ) / CTX.s[0]; + yc = ( CTX.vymax - ((GLdouble) y / height) * + (CTX.vymax - CTX.vymin)) / CTX.s[1]; set_t(0, xc-xc1); set_t(1, yc-yc1); set_t(2, 0.); diff --git a/Unix/Main.cpp b/Unix/Main.cpp index 94b8201f8a..fe453caf97 100644 --- a/Unix/Main.cpp +++ b/Unix/Main.cpp @@ -1,4 +1,4 @@ -/* $Id: Main.cpp,v 1.14 2000-11-26 15:43:48 geuzaine Exp $ */ +/* $Id: Main.cpp,v 1.15 2000-11-26 18:43:48 geuzaine Exp $ */ #include <signal.h> @@ -443,7 +443,6 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { CTX.display_lists = 0; i++; } else if(!strcmp(argv[i]+1, "geometry") || - !strcmp(argv[i]+1, "iconic") || !strcmp(argv[i]+1, "display") || !strcmp(argv[i]+1, "fg") || !strcmp(argv[i]+1, "bg")){ @@ -455,6 +454,9 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { exit(1); } } + else if(!strcmp(argv[i]+1, "iconic")){ + i++; + } else if(!strcmp(argv[i]+1, "v")){ i++; if(argv[i]!=NULL) CTX.verbosity = atoi(argv[i++]); diff --git a/Unix/XStatic.h b/Unix/XStatic.h index 1f4988fcac..2d461e0681 100644 --- a/Unix/XStatic.h +++ b/Unix/XStatic.h @@ -1,4 +1,4 @@ -/* $Id: XStatic.h,v 1.2 2000-11-23 14:11:42 geuzaine Exp $ */ +/* $Id: XStatic.h,v 1.3 2000-11-26 18:43:48 geuzaine Exp $ */ #ifndef _XSTATIC_H_ #define _XSTATIC_H_ @@ -31,8 +31,4 @@ XContext_T XCTX ; Widgets_T WID ; Pixmaps_T PIX ; -GLdouble vxmin, vxmax, vymin, vymax; - -double ClipPlane[4] = {0.0, 0.0, 0.0, 0.0}; - #endif -- GitLab