diff --git a/Adapt/Adapt.h b/Adapt/Adapt.h index a89cd0bfab1cda0edbb54feb743a44c14ba4cd0b..ca4bd3c8302a38a3677d2947547f47adc15c699b 100644 --- a/Adapt/Adapt.h +++ b/Adapt/Adapt.h @@ -1,4 +1,4 @@ -/* $Id: Adapt.h,v 1.2 2000-11-23 14:11:24 geuzaine Exp $ */ +/* $Id: Adapt.h,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ #ifndef _ADAPT_H_ #define _ADAPT_H_ @@ -7,15 +7,12 @@ #define ADAPT_H1 3 #define ADAPT_H2 4 -double optimesh ( - int N, /* Nombre d'elements a traiter */ - int method, /* H1 , P1 , H2 ou P2 */ - int dim, /* 2 pour 2D et 3 pour 3D */ - double *err, /* erreurs elementaires */ - double *h, /* tailles de mailles elementaires */ - double *p, /* exposante elementaires */ - double e0, /* erreur prescrite par l'utilisateur */ - double N0 /* nbre d'elements ds le maillage opt */ - ); +double AdaptMesh (int N, /* Number of elements */ + int method, /* ADAPT_H1, ADAPT_H2, ADAPT_P1 or ADAPT_P2 */ + int dim, /* 2 or 3 */ + double *err, /* elementary errors */ + double *h, /* elementary mesh sizes */ + double *p, /* elementary exponents */ + double e0 /* prescribed error or number of elements */); #endif diff --git a/Adapt/Makefile b/Adapt/Makefile index 72d804da10716b8144b03982c81550e38dee3efb..9841b0972c476c7d44feb43324888bacfa109dca 100644 --- a/Adapt/Makefile +++ b/Adapt/Makefile @@ -18,10 +18,10 @@ INCLUDE = -I../Common -I../DataStr CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(INCLUDE) -SRC = brent.cpp \ +SRC = Adapt.cpp \ mnbrak.cpp \ + brent.cpp \ nrutil.cpp \ - optimesh.cpp \ dsvdcmp.cpp \ newt.cpp \ fmin.cpp \ diff --git a/Adapt/optimesh.cpp b/Adapt/optimesh.cpp deleted file mode 100644 index 4c54dd8cba83d5f2ae78b8cf17b953c29cd1150a..0000000000000000000000000000000000000000 --- a/Adapt/optimesh.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* $Id: optimesh.cpp,v 1.2 2000-11-23 14:11:24 geuzaine Exp $ */ - -#include "Gmsh.h" -#include "Adapt.h" -#include "nrutil.h" - -#define TOL 1.e-08 -#define MAXDEG 999 - -void frprmn(double p[], int n, double ftol, int *iter, double *fret, - double (*func)(double []), void (*dfunc)(double [], double [])); - -extern void SetError(char *, char *); - -static int NN,METHOD; -static double MINH , *ERR , *HH , *PP , E0, DIM ; - -/* METODE H VERSION 1 : MINIMISER LE NOMBRE D'ELEMENTS - TOUT EN GARDANT UNE ERREUR GLOBALE DONNEE. ON MODIFIE - ICI LE VECTEUR TAILLE DE MAILLE -*/ - -double fH1 ( double l ){ - - int i; - double val1,val2; - - val1 = 0.0; - - for(i=1;i<=NN;i++){ - val1 += pow(2.*l*DSQR(ERR[i])*PP[i]/DIM,(DIM/(2.*PP[i]+DIM))); - } - val2 = 0.0; - for(i=1;i<=NN;i++){ - val2 += DSQR(ERR[i])*pow(2.*l*DSQR(ERR[i])*PP[i]/DIM,(-2.*PP[i]/(2.*PP[i]+DIM))); - } - return -(val1 + l * ( val2 - DSQR(E0))); -} - -/* METODE H VERSION 2 : MINIMISER L'ERREUR - TOUT EN GARDANT UN NOMBRE D'ELEMENTS DONNE. ON MODIFIE - ICI LE VECTEUR TAILLE DE MAILLE -*/ - -double fH2 ( double l ){ - - int i; - double val1,val2,qi; - - val1 = val2 = 0.0; - for(i=1;i<=NN;i++){ - qi = pow((DIM*l)/(2.*PP[i] * DSQR(ERR[i])) - ,-DIM/(DIM+2.*PP[i])); - val1 += DSQR(ERR[i]) * pow(qi,-2.*PP[i]/DIM); - val2 += qi; - } -/* - printf( "%12.5e %12.5e\n",l,val1 + l * ( val2 - E0)); -*/ - return -(val1 + l * ( val2 - E0)); -} - - -/* METODE P VERSION 1 : MINIMISER LE NOMBRE D'ELEMENTS - TOUT EN GARDANT UNE ERREUR GLOBALE DONNEE. ON MODIFIE - ICI LE VECTEUR DEGRE D'INTERPOLATION -*/ - -double fP1 ( double l ){ - - int i; - double val1,val2,qi,e; - - val1 = val2 = 0.0; - for(i=1;i<=NN;i++){ - e = ERR[i]; - if(e==0.0)e=1.e-12; - qi = - log (2. * l * log (HH[i]/MINH) * DSQR(e)) / log (HH[i]/MINH); - val1 -= .5 * qi; - val2 += pow(HH[i]/MINH,qi) * DSQR(e); - } -/* - printf( "%12.5e %12.5e\n",l,val1 + l * ( val2 - DSQR(E0))); -*/ - return -(val1 + l * ( val2 - DSQR(E0))); -} - - -double min1d ( double (*funct)(double), double *xmin){ - double brent(double ax, double bx, double cx, - double (*f)(double), double tol, double *xmin); - void mnbrak(double *ax, double *bx, double *cx, double *fa, double *fb, - double *fc, double (*func)(double)); - double xx,fx,fb,fa,bx,ax; - - switch(METHOD){ - case ADAPT_H1: - case ADAPT_P1: - ax=1.e-12; - xx=1.e2; - break; - default: - ax=1.e-15; - xx=1.e-12; - break; - } - mnbrak(&ax,&xx,&bx,&fa,&fx,&fb,funct); - return brent(ax,xx,bx,funct,TOL,xmin); -} - - -/* optimesh renvoie la contrainte (N0 ou e0) pour le probleme optimise */ - -double optimesh (int N, /* Nombre d'elements a traiter */ - int method, /* ADAPT_H1 , ADAPT_P1 , ADAPT_H2 ou ADAPT_P2 */ - int dim, /* 2 pour 2D et 3 pour 3D */ - double *err, /* erreurs elementaires */ - double *h, /* tailles de mailles elementaires */ - double *p, /* exposante elementaires */ - double e0, /* erreur prescrite par l'utilisateur */ - double N0 /* nbre d'elements ds le maillage opt */ - ) -{ - - int i; - double contr,pivrai,lambda,minf,qi,ri,pi,obj,obj2,minri,maxri; - double errmin,errmax; - - - Msg(INFOS, "N=%d Meth=%d dim=%d err[1]=%g err[2]=%g p[1]=%g p[2]=%g prescr=%g", - N,method,dim,err[1],err[2],p[1],p[2],e0); - - METHOD = method; - - h[N+1] = 1.0; - p[N+1] = 1.0; - - NN = N; - ERR = err; - HH = h; - PP = p; - NN = N; - E0 = e0; - DIM = (double)dim; - - - for(i=1;i<=N;i++){ - if(i==1){ - errmin=errmax=err[i]; - } - else{ - errmin = DMIN(errmin,err[i]); - errmax = DMAX(errmax,err[i]); - } - } - - switch (method) { - case ADAPT_H1 : - - minf = min1d (fH1,&lambda); - obj = 0.0; - for(i=1;i<=N;i++){ - qi = pow(2.*lambda*DSQR(err[i])*p[i]/DIM,DIM/(2.*p[i]+DIM)); - ri = pow(qi,1./DIM); - if(i==1){ - minri=maxri=ri; - } - if(err[i]==0.0)ri = .5; - - minri = DMIN(minri,ri); - maxri = DMAX(maxri,ri); - obj += DSQR(err[i]) * pow(ri,-2.*p[i]) ; - h[i-1] = sqrt(2.) * h[i]/ri; - p[i-1] = ri; - } - - contr = fabs(minf); - - Msg(INFOS, "Constraint : asked %g <==> obtained %g",e0,sqrt(obj)); - Msg(INFOS, "Objective function (Nb. of elements) : %g",-minf); - Msg(INFOS, "Minimum reduction factor : %g maximum : %g",minri,maxri); - break; - - case ADAPT_P1 : - MINH=h[1]; - for(i=1;i<=N;i++){ - MINH =DMIN(h[i],MINH); - } - MINH/=2.; - - minf = min1d (fP1,&lambda); - obj = obj2 = 0.0; - for(i=1;i<=N;i++){ - qi = -log(2.*lambda*DSQR(err[i])*log(h[i]/MINH))/log(h[i]/MINH); - pi = p[i] - .5 * qi; - pivrai = DMIN(DMAX(1.,(double)(int)(pi+.99)),MAXDEG); - obj2 += pow(h[i]/MINH,2.*(p[i]-pivrai))*DSQR(err[i]); - obj += DSQR(err[i]) * pow(h[i]/MINH,qi) ; - h[i-1] = h[i]; - p[i-1] = pi; - } - Msg(INFOS, "Constraint : %g = %g ==> %g",e0,sqrt(obj),sqrt(obj2)); - Msg(INFOS, "Objective function : %g",minf); - contr = fabs(minf); - break; - - case ADAPT_H2 : - minf = min1d (fH2,&lambda); - obj = 0.0; - for(i=1;i<=N;i++){ - qi = pow((DIM*lambda)/(2.*DSQR(err[i])*p[i]) - ,-DIM/(DIM+2.*p[i])); - ri = pow(qi,1./DIM); - if(i==1){ - minri=maxri=ri; - } - minri = DMIN(minri,ri); - maxri = DMAX(maxri,ri); - obj += pow(ri,DIM) ; - h[i-1] = h[i]/ri; - p[i-1] = p[i]; - } - - Msg(INFOS, "Constraint : %g = %g",e0,obj); - Msg(INFOS, "Objective function (Error in %%) : %g", 100. * sqrt(fabs(minf))); - Msg(INFOS, "Minri : %g maximum %g",minri,maxri); - contr = sqrt(fabs(minf)); - break; - - case ADAPT_P2 : - minf = min1d (fH1,&lambda); - break; - - default : - Msg(WARNING, "Unknown mesh optimisation method"); - } - - return contr; -} diff --git a/Box/Box.cpp b/Box/Box.cpp index 7f01e91dedf66be06e797861c4c6c9e067ca9f82..31475922d476377efa6766d5879c5af7c858733e 100644 --- a/Box/Box.cpp +++ b/Box/Box.cpp @@ -1,4 +1,4 @@ -/* $Id: Box.cpp,v 1.4 2000-11-23 16:51:27 geuzaine Exp $ */ +/* $Id: Box.cpp,v 1.5 2000-11-23 23:20:34 geuzaine Exp $ */ #include <signal.h> @@ -55,6 +55,34 @@ void ZeroHighlight(Mesh *){;} void AddView(int, char *, int){;} void draw_polygon_2d (double, double, double, int, double *, double *, double *){;} +/* ------------------------------------------------------------------------ */ +/* I n f o */ +/* ------------------------------------------------------------------------ */ + +void Info (int level, char *arg0){ + switch(level){ + case 0 : + fprintf(stderr, "%s\n", gmsh_progname); + fprintf(stderr, "%s\n", gmsh_copyright); + fprintf(stderr, gmsh_help, arg0); + exit(1); + case 1: + fprintf(stderr, "%g\n", GMSH_VERSION); + exit(1) ; + case 2: + fprintf(stderr, "%s%g\n", gmsh_version, GMSH_VERSION); + fprintf(stderr, "%s\n", gmsh_os); + fprintf(stderr, "%s\n", gmsh_date); + fprintf(stderr, "%s\n", gmsh_host); + fprintf(stderr, "%s\n", gmsh_packager); + fprintf(stderr, "%s\n", gmsh_email); + fprintf(stderr, "%s\n", gmsh_url); + exit(1) ; + default : + break; + } +} + /* ------------------------------------------------------------------------ */ /* p a r s e */ /* ------------------------------------------------------------------------ */ @@ -64,7 +92,7 @@ void ParseFile(char *f){ yyerrorstate=0; yylineno=1; if(!(yyin = fopen(yyname,"r"))){ - Msg(INFO, "File '%s' dos not exist", f); + Msg(INFOS, "File '%s' dos not exist", f); return; } while(!feof(yyin)) yyparse(); @@ -163,12 +191,12 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { if(argv[i]!=NULL){ CTX.mesh.degree = atoi(argv[i]); i++; if(CTX.mesh.degree != 1 || CTX.mesh.degree != 2){ - fprintf(stderr, "Error: Wrong degree\n"); + fprintf(stderr, ERROR_STR "Wrong degree\n"); exit(1); } } else { - fprintf(stderr, "Error: Missing Number\n"); + fprintf(stderr, ERROR_STR "Missing Number\n"); exit(1); } } @@ -182,13 +210,13 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { else if(!strcmp(argv[i],"gref")) CTX.mesh.format = FORMAT_GREF ; else{ - fprintf(stderr, "Error: Unknown mesh format\n"); + fprintf(stderr, ERROR_STR "Unknown mesh format\n"); exit(1); } i++; } else { - fprintf(stderr, "Error: Missing format\n"); + fprintf(stderr, ERROR_STR "Missing format\n"); exit(1); } } @@ -200,13 +228,13 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { else if(!strcmp(argv[i],"aniso")) CTX.mesh.algo = DELAUNAY_NEWALGO ; else{ - fprintf(stderr, "Error: Unknown mesh algorithm\n"); + fprintf(stderr, ERROR_STR "Unknown mesh algorithm\n"); exit(1); } i++; } else { - fprintf(stderr, "Error: Missing algorithm\n"); + fprintf(stderr, ERROR_STR "Missing algorithm\n"); exit(1); } } @@ -220,7 +248,7 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { Info(0,argv[0]); } else{ - fprintf(stderr, "Warning: Unknown option '%s'\n", argv[i]); + fprintf(stderr, WARNING_STR "Unknown option '%s'\n", argv[i]); Info(0,argv[0]); } } @@ -230,7 +258,7 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { TheFileNameTab[(*nbfiles)++] = argv[i++]; } else{ - fprintf(stderr, "Error: Too many input files\n"); + fprintf(stderr, ERROR_STR "Too many input files\n"); exit(1); } } @@ -270,7 +298,7 @@ int main(int argc, char *argv[]){ Create_BgMesh(TYPBGMESH,.2,THEM); } else{ - fprintf(stderr, "Error: invalid BGM (no view)\n"); exit(1); + fprintf(stderr, ERROR_STR "Invalid BGM (no view)\n"); exit(1); } } if(CTX.interactive > 0){ @@ -283,36 +311,6 @@ int main(int argc, char *argv[]){ } - -/* ------------------------------------------------------------------------ */ -/* I n f o */ -/* ------------------------------------------------------------------------ */ - -void Info (int level, char *arg0){ - switch(level){ - case 0 : - fprintf(stderr, "%s\n", gmsh_progname); - fprintf(stderr, "%s\n", gmsh_copyright); - fprintf(stderr, gmsh_help, arg0); - exit(1); - case 1: - fprintf(stderr, "%g\n", GMSH_VERSION); - exit(1) ; - case 2: - fprintf(stderr, "%s%g\n", gmsh_version, GMSH_VERSION); - fprintf(stderr, "%s\n", gmsh_os); - fprintf(stderr, "%s\n", gmsh_date); - fprintf(stderr, "%s\n", gmsh_host); - fprintf(stderr, "%s\n", gmsh_packager); - fprintf(stderr, "%s\n", gmsh_email); - fprintf(stderr, "%s\n", gmsh_url); - exit(1) ; - default : - break; - } -} - - /* ------------------------------------------------------------------------ */ /* S i g n a l */ /* ------------------------------------------------------------------------ */ @@ -321,10 +319,10 @@ void Info (int level, char *arg0){ void Signal (int sig_num){ switch (sig_num){ - case SIGSEGV : Msg(ERROR, "Segmentation Violation (invalid memory reference)"); break; - case SIGFPE : Msg(ERROR, "Floating point exception (division by zero?)"); break; - case SIGINT : Msg(ERROR, "Interrupt (generated from terminal special char)"); break; - default : Msg(ERROR, "Unknown signal"); break; + case SIGSEGV : Msg(FATAL, "Segmentation Violation (Invalid Memory Reference)"); break; + case SIGFPE : Msg(FATAL, "Floating Point Exception (Division by Zero?)"); break; + case SIGINT : Msg(FATAL, "Interrupt (Generated from Terminal Special Char)"); break; + default : Msg(FATAL, "Unknown Signal"); break; } } @@ -342,30 +340,42 @@ void Msg(int level, char *fmt, ...){ switch(level){ - case PARSER_ERROR : - fprintf(stderr, "Parse Error: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); - break ; - - case PARSER_INFO : - if(VERBOSE){ - fprintf(stderr, "Parse Info: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); - } + case FATAL : + fprintf(stderr, FATAL_STR); + vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + abort = 1 ; break ; case ERROR : - fprintf(stderr, "Error: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + fprintf(stderr, ERROR_STR); + vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); abort = 1 ; break ; case WARNING : - fprintf(stderr, "Warning: "); vfprintf(stderr, fmt,args); fprintf(stderr, "\n"); + fprintf(stderr, WARNING_STR); + vfprintf(stderr, fmt,args); fprintf(stderr, "\n"); break; + case PARSER_ERROR : + fprintf(stderr, PARSER_ERROR_STR); + vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + break ; + + case PARSER_INFO : + if(VERBOSE){ + fprintf(stderr, PARSER_INFO_STR); + vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + } + break ; + + case DEBUG : case INFOS : case INFO : case SELECT : case STATUS : if(VERBOSE){ + fprintf(stderr, INFO_STR); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); } break; diff --git a/Common/Message.h b/Common/Message.h index db4a5ace37e4a02505a9e31147e1f65d462bbbf2..60aedc19e287f44d3db3b5f59a53548736ebe306 100644 --- a/Common/Message.h +++ b/Common/Message.h @@ -1,22 +1,37 @@ -/* $Id: Message.h,v 1.2 2000-11-23 14:11:28 geuzaine Exp $ */ +/* $Id: Message.h,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ #ifndef _MESSAGE_H_ #define _MESSAGE_H_ #include <stdarg.h> -#define ERROR 0 -#define WARNING 1 -#define INFO 2 -#define INFOS 3 -#define SELECT 4 -#define STATUS 5 -#define PARSER_ERROR 6 -#define PARSER_INFO 7 +#define FATAL 0 // Fatal error (causes Gmsh to exit) +#define ERROR 1 // Error +#define WARNING 2 // Warning +#define INFOS 3 // Long informations +#define INFO 4 // Small information in status bar +#define SELECT 5 // Small interaction message in status bar, e.g. for select +#define STATUS 6 // Gmsh status in status bar +#define PARSER_ERROR 7 // Error during syntax parsing +#define PARSER_INFO 8 // Info during syntax parsing +#define DEBUG 9 // Long debug information + +#define FATAL_STR "Fatal Error : " +#define ERROR_STR "Error : " +#define WARNING_STR "Warning : " +#define INFOS_STR "Info : " +#define INFO_STR "Info : " +#define SELECT_STR "Info : " +#define STATUS_STR "Status : " +#define PARSER_ERROR_STR "Parse Error : " +#define PARSER_INFO_STR "Parse Info : " +#define DEBUG_STR "Debug : " + +#define WHITE_STR " " -void Info (int level, char *arg0); void Signal (int signum); void Msg (int level, char *fmt, ...); double Cpu (void); void Progress(int); +void AddALineInTheEditGeometryForm (char* line); #endif diff --git a/DataStr/List.cpp b/DataStr/List.cpp index 45c909d57424cb445e53b547f9714503c20985d6..3de4d326fd33f1b224d02bf3a1e081949cf57005 100644 --- a/DataStr/List.cpp +++ b/DataStr/List.cpp @@ -1,5 +1,5 @@ -/* $Id: List.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -#define RCSID "$Id: List.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $" +/* $Id: List.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ +#define RCSID "$Id: List.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $" /* Original author: Marc UME */ #include <stdlib.h> @@ -98,7 +98,7 @@ int List_Replace(List_T *liste, void *data, void List_Read(List_T *liste, int index, void *data) { if ((index < 0) || (index >= liste->n)) - Msg(ERROR, "Wrong List Index in List_Read"); + Msg(FATAL, "Wrong List Index in List_Read"); memcpy(data,&liste->array[index * liste->size],liste->size); } @@ -106,21 +106,25 @@ void List_Write(List_T *liste, int index, void *data) { if ((index < 0) || (index >= liste->n)) Msg(ERROR, "Wrong List Index in List_Write"); - liste->isorder = 0; - memcpy(&liste->array[index * liste->size],data,liste->size); + else{ + liste->isorder = 0; + memcpy(&liste->array[index * liste->size],data,liste->size); + } } void List_Put(List_T *liste, int index, void *data) { if (index < 0) Msg(ERROR, "Wrong List Index in List_Put"); - - if (index >= liste->n) { - liste->n = index + 1; - List_Realloc(liste,liste->n); - List_Write(liste,index,data); - } else { - List_Write(liste,index,data); + else{ + if (index >= liste->n) { + liste->n = index + 1; + List_Realloc(liste,liste->n); + List_Write(liste,index,data); + } + else { + List_Write(liste,index,data); + } } } @@ -132,8 +136,8 @@ void List_Pop(List_T *liste) void *List_Pointer(List_T *liste, int index) { if ((index < 0) || (index >= liste->n)) - Msg(ERROR, "Wrong List Index in List_Pointer"); - + Msg(FATAL, "Wrong List Index in List_Pointer"); + liste->isorder = 0; /* getdp: a examiner... */ return(&liste->array[index * liste->size]); } @@ -141,7 +145,7 @@ void *List_Pointer(List_T *liste, int index) void *List_Pointer_NoChange(List_T *liste, int index) { if ((index < 0) || (index >= liste->n)) - Msg(ERROR, "Wrong List Index in List_Pointer_NoChange"); + Msg(FATAL, "Wrong List Index in List_Pointer_NoChange"); return(&liste->array[index * liste->size]); } diff --git a/DataStr/Malloc.cpp b/DataStr/Malloc.cpp index af0fa14203cb6cb6c6c919005b25fbf4b51c9ee4..ee71a785706f5690d948028a700bce60056ba059 100644 --- a/DataStr/Malloc.cpp +++ b/DataStr/Malloc.cpp @@ -1,5 +1,5 @@ -/* $Id: Malloc.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -#define RCSID "$Id: Malloc.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $" +/* $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 $" #include <stdio.h> #include <stdlib.h> #include <malloc.h> @@ -14,7 +14,7 @@ void *Malloc(size_t size) if (!size) return(NULL); ptr = malloc(size); if (ptr == NULL) - Msg(ERROR, "Out of Memory in Malloc"); + Msg(FATAL, "Out of Memory in Malloc"); return(ptr); } @@ -25,7 +25,7 @@ void *Calloc(size_t num, size_t size) if (!size) return(NULL); ptr = calloc(num, size); if (ptr == NULL) - Msg(ERROR, "Out of Memory in Calloc"); + Msg(FATAL, "Out of Memory in Calloc"); return(ptr); } @@ -34,7 +34,7 @@ void *Realloc(void *ptr, size_t size) if (!size) return(NULL); ptr = realloc(ptr,size); if (ptr == NULL) - Msg(ERROR, "Out of Memory in Realloc"); + Msg(FATAL, "Out of Memory in Realloc"); return(ptr); } diff --git a/DataStr/Tree.cpp b/DataStr/Tree.cpp index c616db1d8fe08ca1b34675f37e5514c4302bb36c..d97244e83fc4c6ed33354b8786b11d838f539234 100644 --- a/DataStr/Tree.cpp +++ b/DataStr/Tree.cpp @@ -1,5 +1,5 @@ -/* $Id: Tree.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $ */ -#define RCSID "$Id: Tree.cpp,v 1.2 2000-11-23 14:11:29 geuzaine Exp $" +/* $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 $" #include <stdlib.h> #include <string.h> @@ -33,9 +33,11 @@ void Tree_Add(Tree_T *tree, void *data) if(!tree) Msg(ERROR, "Impossible to Add in Unallocated Tree"); - ptr = Malloc(tree->size); - memcpy(ptr,data,tree->size); - avl_insert(tree->root, ptr, ptr); + else{ + ptr = Malloc(tree->size); + memcpy(ptr,data,tree->size); + avl_insert(tree->root, ptr, ptr); + } } void * Tree_AddP(Tree_T *tree, void *data) @@ -43,7 +45,7 @@ void * Tree_AddP(Tree_T *tree, void *data) void *ptr; if(!tree) - Msg(ERROR, "Impossible to Add in Unallocated Tree"); + Msg(FATAL, "Impossible to Add in Unallocated Tree"); ptr = Malloc(tree->size); memcpy(ptr,data,tree->size); avl_insert(tree->root, ptr, ptr); @@ -67,8 +69,10 @@ int Tree_Replace(Tree_T *tree, void *data) void *ptr; int state; - if(!tree) + if(!tree) { Msg(ERROR, "Impossible to Replace in Unallocated Tree"); + return(0); + } state = avl_lookup(tree->root, data, &ptr); if (state == 0) { Tree_Add(tree,data); diff --git a/Geo/CAD.cpp b/Geo/CAD.cpp index 6ea9ae6768697dbffdb0bc1de0449c84529d22c0..041a2d16e66222c756f46fad146aa4bc3ff542ae 100644 --- a/Geo/CAD.cpp +++ b/Geo/CAD.cpp @@ -1,4 +1,4 @@ -/* $Id: CAD.cpp,v 1.3 2000-11-23 17:16:37 geuzaine Exp $ */ +/* $Id: CAD.cpp,v 1.4 2000-11-23 23:20:34 geuzaine Exp $ */ #include "Gmsh.h" #include "Geo.h" @@ -190,7 +190,7 @@ SurfaceLoop *FindSurfaceLoop(int inum, Mesh *M){ static Curve *CURVE, *CURVE_2; static Surface *SURFACE; static Vertex *VERTEX; -extern double min1d ( double (*funct)(double), double *xmin); +extern double min1d (int, double (*funct)(double), double *xmin); extern void newt(float x[], int n, int *check, void (*vecfunc)(int, float [], float [])); @@ -270,7 +270,7 @@ bool ProjectPointOnCurve (Curve *c, Vertex *v, Vertex *RES, Vertex *DER){ double xmin; CURVE = c; VERTEX = v; - min1d ( projectPC, &xmin); + min1d (0, projectPC, &xmin); *RES = InterpolateCurve(CURVE,xmin,0); *DER = InterpolateCurve(CURVE,xmin,1); if(xmin > c->uend){ @@ -326,7 +326,7 @@ bool search_in_boundary ( Surface *s, Vertex *p, double t, int Fixu, double xm; if(Fixu)xm = vmin; else xm = umin; - if(lmin > 1.e-3) min1d ( projectPCS, &xm); + if(lmin > 1.e-3) min1d (0, projectPCS, &xm); if(Fixu){ *uu = t; *vv = xm; @@ -799,10 +799,10 @@ void ApplyTransformationToSurface (double matrix[4][4],Surface *s){ void printCurve(Curve *c){ Vertex *v; int N = List_Nbr(c->Control_Points); - Msg(INFO,"Curve %d %d cp (%d->%d)",c->Num,N,c->beg->Num,c->end->Num); + Msg(INFOS,"Curve %d %d cp (%d->%d)",c->Num,N,c->beg->Num,c->end->Num); for(int i=0;i<N;i++){ List_Read(c->Control_Points,i,&v); - Msg(INFO,"Vertex %d (%f %f %f %f)",v->Num,v->Pos.X,v->Pos.Y,v->Pos.Z,v->lc); + Msg(INFOS,"Vertex %d (%f %f %f %f)",v->Num,v->Pos.X,v->Pos.Y,v->Pos.Z,v->lc); } } @@ -865,7 +865,7 @@ void Extrude_ProtudePoint(int ep, int ip, double A, double B, double C, SetTranslationMatrix(matrix,T); ApplyTransformationToPoint(matrix,chapeau); List_Reset(ListOfTransformedPoints); - Msg(INFO,"Angle %f point %f %f %f axe %f %f %f",alpha,X,Y,Z,A,B,C); + Msg(INFOS,"Angle %g Point (%g,%g,%g) Axis (%g,%g,%g)",alpha,X,Y,Z,A,B,C); } c = Create_Curve(MAXREG++,(ep)?MSH_SEGM_LINE:MSH_SEGM_CIRC,1,NULL,NULL,-1,-1,0.,1.); @@ -910,7 +910,7 @@ void printSurface(Surface*s){ Curve *c; int N = List_Nbr(s->s.Generatrices); - Msg(INFO,"Surface %d %d generatrices",s->Num,N); + Msg(INFOS,"Surface %d, %d generatrices",s->Num,N); for(int i=0;i<N;i++){ List_Read(s->s.Generatrices,i,&c); printCurve(c); @@ -933,17 +933,15 @@ Surface *Extrude_ProtudeCurve(int ep, int ic, pc = FindCurve(ic,THEM); revpc = FindCurve(-ic,THEM); - if(!pc || !revpc){ - return NULL; - } + if(!pc || !revpc) return NULL; + chapeau = DuplicateCurve(pc); chapeau->Extrude = new ExtrudeParams(COPIED_ENTITY); chapeau->Extrude->fill(ep,A,B,C,X,Y,Z,alpha); chapeau->Extrude->geo.Source = pc->Num; - if(e)chapeau->Extrude->mesh = e->mesh; + if(e) chapeau->Extrude->mesh = e->mesh; - ReverseChapeau = FindCurve(-chapeau->Num,THEM); if(ep){ T[0] = A; T[1] = B; T[2] = C; SetTranslationMatrix(matrix,T); @@ -977,17 +975,14 @@ Surface *Extrude_ProtudeCurve(int ep, int ic, s->Extrude = new ExtrudeParams; s->Extrude->fill(ep,A,B,C,X,Y,Z,alpha); s->Extrude->geo.Source = pc->Num; - if(e)s->Extrude->mesh = e->mesh; - - if(!pc) - Msg(INFO,"zarbi 1"); - if(!CurveEnd) - Msg(INFO,"zarbi 2"); - if(!ReverseChapeau) - Msg(INFO,"zarbi 3"); - if(!ReverseBeg) - Msg(INFO,"zarbi 4"); + if(e) s->Extrude->mesh = e->mesh; + ReverseChapeau = FindCurve(-chapeau->Num,THEM); + + if(!CurveEnd || !ReverseBeg || !CurveEnd || !ReverseEnd || !ReverseChapeau){ + return NULL; + } + List_Add(s->s.Generatrices,&pc); List_Add(s->s.Generatrices,&CurveEnd); List_Add(s->s.Generatrices,&ReverseChapeau); @@ -1027,12 +1022,14 @@ void Extrude_ProtudeSurface(int ep, int is, chapeau->Extrude = new ExtrudeParams(COPIED_ENTITY); chapeau->Extrude->fill(ep,A,B,C,X,Y,Z,alpha); chapeau->Extrude->geo.Source = ps->Num; - if(e)chapeau->Extrude->mesh = e->mesh; + if(e) chapeau->Extrude->mesh = e->mesh; for(i=0;i<List_Nbr(chapeau->s.Generatrices);i++) { List_Read(ps->s.Generatrices,i,&c2); List_Read(chapeau->s.Generatrices,i,&c); - if(c->Num<0)c = FindCurve(-c->Num,THEM); + if(c->Num<0) + if(!(c = FindCurve(-c->Num,THEM))) + Msg(FATAL, "Unknown Curve %d", -c->Num); c->Extrude = new ExtrudeParams(COPIED_ENTITY); c->Extrude->fill(ep,A,B,C,X,Y,Z,alpha); c->Extrude->geo.Source = abs(c2->Num); @@ -1144,7 +1141,7 @@ bool IntersectAllSegmentsTogether (void) { List_Read(TempList,j,&c2); if(c1->Num > 0 && c2->Num >0 && i!=j && intersectionfound == false){ if(IntersectCurves(c1,c2,&c11,&c12,&c21,&c22,&v)){ - Msg(INFO, "Intersection curve %d %d",c1->Num,c2->Num); + Msg(INFOS, "Intersection Curve %d->%d",c1->Num,c2->Num); intersectionfound = true; DeleteCurve(c1->Num); DeleteCurve(c2->Num); @@ -1226,7 +1223,7 @@ void ReplaceAllDuplicates ( Mesh *m ){ /*Creation de points uniques*/ Tree_T *allNonDulpicatedPoints; allNonDulpicatedPoints = Tree_Create(sizeof(Vertex*),comparePosition); - Msg(INFO, "Beginning with %d points",List_Nbr(All)); + Msg(INFOS, "Beginning with %d Points", List_Nbr(All)); for(i=0;i<List_Nbr(All);i++){ List_Read(All,i,&v); if(!Tree_Search(allNonDulpicatedPoints,&v)){ @@ -1238,12 +1235,12 @@ void ReplaceAllDuplicates ( Mesh *m ){ } List_Delete(All); - Msg(INFO, "Ending with %d points",Tree_Nbr(m->Points)); + Msg(INFOS, "Ending with %d Points", Tree_Nbr(m->Points)); /*Remplacement dans les courbes*/ All = Tree2List(m->Curves); - Msg(INFO, "Beginning with %d curves",List_Nbr(All)); + Msg(INFOS, "Beginning with %d Curves", List_Nbr(All)); for(i=0;i<List_Nbr(All);i++){ List_Read(All,i,&c); Tree_Query( allNonDulpicatedPoints,&c->beg); @@ -1276,19 +1273,21 @@ void ReplaceAllDuplicates ( Mesh *m ){ if(c->Num > 0){ if(!Tree_Search(allNonDulpicatedCurves,&c)){ Tree_Insert(allNonDulpicatedCurves,&c); - c2 = FindCurve(-c->Num,m); + if(!(c2 = FindCurve(-c->Num,m))) + Msg(FATAL, "Unknown Curve %d", -c->Num); Tree_Insert(allNonDulpicatedCurves,&c2); } else{ Tree_Suppress(m->Curves,&c); - c2 = FindCurve(-c->Num,m); + if(!(c2 = FindCurve(-c->Num,m))) + Msg(FATAL, "Unknown Curve %d", -c->Num); Tree_Suppress(m->Curves,&c2); } } } List_Delete(All); - Msg(INFO, "Ending with %d curves",Tree_Nbr(m->Curves)); + Msg(INFOS, "Ending with %d Curves", Tree_Nbr(m->Curves)); /*Remplacement dans les surfaces*/ All = Tree2List(m->Surfaces); @@ -1302,7 +1301,7 @@ void ReplaceAllDuplicates ( Mesh *m ){ } /*Creation de surfaces uniques*/ - Msg(INFO, "Beginning with %d surfaces",List_Nbr(All)); + Msg(INFOS, "Beginning with %d Surfaces",List_Nbr(All)); Tree_T *allNonDulpicatedSurfaces; allNonDulpicatedSurfaces = Tree_Create(sizeof(Curve*),compareTwoSurfaces); @@ -1319,7 +1318,7 @@ void ReplaceAllDuplicates ( Mesh *m ){ } } List_Delete(All); - Msg(INFO, "Ending with %d surfaces",Tree_Nbr(m->Surfaces)); + Msg(INFOS, "Ending with %d Surfaces",Tree_Nbr(m->Surfaces)); /*Remplacement dans les volumes*/ All = Tree2List(m->Volumes); @@ -1438,7 +1437,8 @@ void CopyShape(int Type, int Num, int *New){ switch(Type){ case MSH_POINT: - v = FindVertex(Num,THEM); + if(!(v = FindVertex(Num,THEM))) + Msg(FATAL, "Unknown Vertex %d", Num); newv = DuplicateVertex(v); *New = newv->Num; break; @@ -1447,7 +1447,8 @@ void CopyShape(int Type, int Num, int *New){ case MSH_SEGM_CIRC: case MSH_SEGM_ELLI: case MSH_SEGM_NURBS: - c = FindCurve(Num,THEM); + if(!(c = FindCurve(Num,THEM))) + Msg(FATAL, "Unknown Curve %d", Num); newc = DuplicateCurve(c); *New = newc->Num; break; @@ -1455,7 +1456,8 @@ void CopyShape(int Type, int Num, int *New){ case MSH_SURF_TRIC: case MSH_SURF_REGL: case MSH_SURF_PLAN: - s = FindSurface(Num,THEM); + if(!(s = FindSurface(Num,THEM))) + Msg(FATAL, "Unknown Surface %d", Num); news = DuplicateSurface(s,1); *New = news->Num; break; @@ -1467,7 +1469,7 @@ void CopyShape(int Type, int Num, int *New){ void DeletePoint(int ip){ Vertex *v = FindVertex(ip,THEM); - if(!v)return; + if(!v) return; List_T *Curves = Tree2List(THEM->Curves); for(int i=0;i<List_Nbr(Curves);i++){ Curve *c; @@ -1482,7 +1484,7 @@ void DeletePoint(int ip){ void DeleteCurve(int ip){ Curve *c = FindCurve(ip,THEM); - if(!c)return; + if(!c) return; List_T *Surfs = Tree2List(THEM->Surfaces); for(int i=0;i<List_Nbr(Surfs);i++){ Surface *s; @@ -1500,7 +1502,7 @@ void DeleteSurf( int is ){ // Il faut absolument coder une // structure coherente pour les volumes. Surface *s = FindSurface(is,THEM); - if(!s)return; + if(!s) return; List_T *Vols = Tree2List(THEM->Volumes); for(int i=0;i<List_Nbr(Vols);i++){ Volume *v; diff --git a/Geo/DataBase.cpp b/Geo/DataBase.cpp index e53e513e05b6f2533a17ab65a9f77d276ee2f357..945a9857091e87b3ddd3d85c7a91aa81cc9a9219 100644 --- a/Geo/DataBase.cpp +++ b/Geo/DataBase.cpp @@ -1,4 +1,4 @@ -/* $Id: DataBase.cpp,v 1.2 2000-11-23 14:11:30 geuzaine Exp $ */ +/* $Id: DataBase.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -114,12 +114,12 @@ void AddQuadricSurfaceInDataBase (int Typ, int NumQuadric, double zaxis[3], for(i=0;i<NbLoop;i++){ List_Read(loops,i,&iLoop); if(!(el = FindEdgeLoop(iLoop,THEM))) - Msg(ERROR, "Unknown Loop %d", iLoop); + Msg(FATAL, "Unknown Loop %d", iLoop); else{ for(j=0;j<List_Nbr(el->Curves);j++){ List_Read(el->Curves,j,&ic); if(!(c = FindCurve(ic,THEM))) - Msg(ERROR, "Unknown Curve %d", ic); + Msg(FATAL, "Unknown Curve %d", ic); else List_Add (s->s.Generatrices, &c); } @@ -148,12 +148,12 @@ void CreateSurfaceFromOldCrappyDatabase (int izon, int typzon, int o1, int o2, for(i=0;i<NbLoop;i++){ List_Read(loops,i,&iLoop); if(!(el = FindEdgeLoop(iLoop,THEM))) - Msg(ERROR, "Unknown Line Loop %d", iLoop); + Msg(FATAL, "Unknown Line Loop %d", iLoop); else{ for(j=0;j<List_Nbr(el->Curves);j++){ List_Read(el->Curves,j,&ic); if(!(c = FindCurve(ic,THEM))) - Msg(ERROR, "Unknown Curve %d", ic); + Msg(FATAL, "Unknown Curve %d", ic); else List_Add (s->s.Generatrices, &c); } @@ -196,12 +196,12 @@ void CreateVolumeFromOldCrappyDatabase (int izon, List_T *loops, Mesh *M){ for(i=0;i<List_Nbr(loops);i++){ List_Read(loops,i,&iLoop); if(!(sl = FindSurfaceLoop(iLoop,THEM))) - Msg(ERROR, "Unknown Surface Loop %d", iLoop); + Msg(FATAL, "Unknown Surface Loop %d", iLoop); else{ for(j=0;j<List_Nbr(sl->Surfaces);j++){ List_Read(sl->Surfaces,j,&is); if(!(s = FindSurface(abs(is),THEM))) - Msg(ERROR, "Unknown Surface %d", is); + Msg(FATAL, "Unknown Surface %d", is); else List_Add (v->Surfaces, &s); } @@ -276,7 +276,7 @@ void CreateNurbsSurfaceSupport (int Num , int Order1, int Order2 , Cdbz101(Num,MSH_SURF_NURBS,Order1,Order2,Nv,Nu,0,ListCP,NULL,NULL); if(!(s = FindSurface(Num,THEM))) - Msg(ERROR, "Unknown Surface Loop %d", Num); + Msg(FATAL, "Unknown Surface Loop %d", Num); else{ s->ku = (float*)malloc(List_Nbr(ku)*sizeof(float)); s->kv = (float*)malloc(List_Nbr(kv)*sizeof(float)); @@ -348,7 +348,7 @@ void CreateNurbsSurface (int Num , int Order1 , int Order2 , List_T *List, Loop[0] = NEWREG(); Cdbseg101(Loop[0],TypLine,Order1,ListOfDouble_L,NULL,-1,-1,kumin,kumax,NULL,NULL,NULL); if(!(cc = FindCurve(Loop[0],THEM))) - Msg(ERROR, "Unknown Curve %d", Loop[0]); + Msg(FATAL, "Unknown Curve %d", Loop[0]); else{ cc->k = (float*)malloc(4*List_Nbr(ku)*sizeof(float)); for(i=0;i<List_Nbr(ku);i++){ @@ -371,7 +371,7 @@ void CreateNurbsSurface (int Num , int Order1 , int Order2 , List_T *List, Loop[2] = NEWREG(); Cdbseg101(Loop[2],TypLine,Order1,ListOfDouble_L,NULL,-1,-1,kumin,kumax,NULL,NULL,NULL); if(!(cc = FindCurve(Loop[2],THEM))) - Msg(ERROR, "Unknown Curve %d", Loop[2]); + Msg(FATAL, "Unknown Curve %d", Loop[2]); else{ cc->k = (float*)malloc(4*List_Nbr(ku)*sizeof(float)); for(i=0;i<List_Nbr(ku);i++){ @@ -402,7 +402,7 @@ void CreateNurbsSurface (int Num , int Order1 , int Order2 , List_T *List, Loop[1] = NEWREG(); Cdbseg101(Loop[1],TypLine,Order2,List1,NULL,-1,-1,kvmin,kvmax,NULL,NULL,NULL); if(!(cc = FindCurve(Loop[1],THEM))) - Msg(ERROR, "Unknown Curve %d", Loop[1]); + Msg(FATAL, "Unknown Curve %d", Loop[1]); else{ cc->k = (float*)malloc(4*List_Nbr(kv) * sizeof(float)); for(i=0;i<List_Nbr(kv);i++){ @@ -424,7 +424,7 @@ void CreateNurbsSurface (int Num , int Order1 , int Order2 , List_T *List, Loop[3] = NEWREG(); Cdbseg101(Loop[3],TypLine,Order2,List2,NULL,-1,-1,kvmin,kvmax,NULL,NULL,NULL); if(!(cc = FindCurve(Loop[3],THEM))) - Msg(ERROR, "Unknown Curve %d", Loop[3]); + Msg(FATAL, "Unknown Curve %d", Loop[3]); else{ cc->k = (float*)malloc(4*List_Nbr(kv)*sizeof(float)); for(i=0;i<List_Nbr(kv);i++){ diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 8d280d331026a68b1818efac66e3ea9d33f3b763..74ba3b12b05068b16b9de4d1bc07ebfd08ae33ae 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,4 +1,4 @@ -/* $Id: Geo.cpp,v 1.2 2000-11-23 14:11:30 geuzaine Exp $ */ +/* $Id: Geo.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -53,10 +53,6 @@ double evaluate_scalarfunction (char *var, double val, char *funct){ return TheSymbol.val; } -#ifndef _UNIX -extern AddALineInTheEditGeometryForm (char* line); -#endif - void add_infile(char *text, char *fich){ FILE *file; @@ -71,9 +67,7 @@ void add_infile(char *text, char *fich){ fclose(yyin); fprintf(file,"%s\n",text); fclose(file); -#ifndef _UNIX AddALineInTheEditGeometryForm (text); -#endif } void del_pnt(int p1, char *fich){ diff --git a/Graphics/Geom.cpp b/Graphics/Geom.cpp index c42f3c0271af7189f28a220e99473ba91192a517..2d52ac22213fa5dab46798f639de3438db6be899 100644 --- a/Graphics/Geom.cpp +++ b/Graphics/Geom.cpp @@ -1,4 +1,4 @@ -/* $Id: Geom.cpp,v 1.2 2000-11-23 14:11:32 geuzaine Exp $ */ +/* $Id: Geom.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -339,7 +339,7 @@ void Plan_SurfPlane (void *data,void *dum){ res[2] = 1.; } else { - printf("erreur Plan_SurfPlane\n"); + Msg(ERROR, "Draw Geometry (Plan_SurfPlane)"); } } } @@ -485,7 +485,7 @@ void Draw_Plane_Surface (Surface *s){ } } if(k)List_Add(s->Orientations,&vv); - fprintf(stderr, "Surface %d %d points\n",s->Num,List_Nbr(s->Orientations)); + Msg(INFO, "Surface %d (%d points)",s->Num,List_Nbr(s->Orientations)); } if(CTX.geom.surfaces){ diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp index f6be396d839379dc8462d80e3eaf92e79fb5dbce..8fed01a402a6136dade29db5b0f7f403c0cbc858 100644 --- a/Graphics/Post.cpp +++ b/Graphics/Post.cpp @@ -1,4 +1,4 @@ -/* $Id: Post.cpp,v 1.2 2000-11-23 14:11:32 geuzaine Exp $ */ +/* $Id: Post.cpp,v 1.3 2000-11-23 23:20:34 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -129,7 +129,7 @@ void Draw_Post (void) { if(CTX.display_lists){ if(glIsList(v->Num)) glDeleteLists(v->Num,1); - // printf("new dl\n"); + //Msg(INFO, "New Display List"); glNewList(v->Num, GL_COMPILE_AND_EXECUTE); } diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index 4eb191d82d6305493dd3606ac660e62cdf2b241f..e3abe561e2a62c56576d45f41fe0c33b4ccd4b39 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 1D_Mesh.cpp,v 1.3 2000-11-23 17:16:38 geuzaine Exp $ */ +/* $Id: 1D_Mesh.cpp,v 1.4 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -89,7 +89,7 @@ void Maillage_Curve (void *data, void *dummy){ if (c->Num < 0) return; - Msg(INFO, "Meshing Curve %d ", c->Num); + Msg(INFO, "Meshing Curve %d", c->Num); if (c->Method != TRANSFINI && Extrude_Mesh (c)){ Points = List_Create (10, 10, sizeof (IntPoint)); diff --git a/Mesh/2D_BGMesh.cpp b/Mesh/2D_BGMesh.cpp index 21ca220887dabd6e5c247c30ccd694b17648601d..467a4aa9810288237de937f3ad1503579209ee76 100644 --- a/Mesh/2D_BGMesh.cpp +++ b/Mesh/2D_BGMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_BGMesh.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_BGMesh.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -19,8 +19,10 @@ double find_quality (MPoint center, DocRecord * BGMESH){ double qual, q1, q2, q3, X[3], Y[3], u, v, det, Xp, Yp; double Exp = 2., r, deno, nume; - if ((del = Find_Triangle (center, BGMESH, BOF)) == NULL) - Msg(WARNING, "Point X=%g Y=%g out of Mesh\n", center.v, center.h); + if ((del = Find_Triangle (center, BGMESH, BOF)) == NULL){ + Msg(ERROR, "Exterior Point (%g,%g)", center.v, center.h); + return 1.e-15; + } pPointArray = BGMESH->points; diff --git a/Mesh/2D_Bowyer.cpp b/Mesh/2D_Bowyer.cpp index 7deadf71ef2e6f5c5690897991e44944235f0701..770ff930a87f0e791d6fc52a40642c3575ea83f7 100644 --- a/Mesh/2D_Bowyer.cpp +++ b/Mesh/2D_Bowyer.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Bowyer.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_Bowyer.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* A L G O R I T H M E D E B O W Y E R - W A T S O N @@ -86,9 +86,8 @@ int PE_Del_Triangle (Delaunay *del , MPoint pt, DListPeek *ListEdges , rslt = DListInsert(ListEdges,pt,a); rslt &= DListInsert(ListEdges,pt,b); rslt &= DListInsert(ListEdges,pt,c); - if(!rslt){ - Msg(ERROR, "List insert error"); - } + if(!rslt) + Msg(ERROR, "List Insert Failed in Boyer Watson"); } else { @@ -147,28 +146,22 @@ int PE_Del_Triangle (Delaunay *del , MPoint pt, DListPeek *ListEdges , if (de1->v.voisin1 == del )de1->v.voisin1 = NULL; else if (de1->v.voisin2 == del )de1->v.voisin2 = NULL; else if (de1->v.voisin3 == del )de1->v.voisin3 = NULL; - else { - Msg(ERROR, "Bad Link"); - exit(1); - } + else + Msg(ERROR, "Bad Link in Boyer Watson"); } if(de2 != NULL){ if (de2->v.voisin1 == del )de2->v.voisin1 = NULL; else if (de2->v.voisin2 == del )de2->v.voisin2 = NULL; else if (de2->v.voisin3 == del )de2->v.voisin3 = NULL; - else { - Msg(ERROR," Bad Link"); - exit(1); - } + else + Msg(ERROR, "Bad Link in Boyer Watson"); } if(de3 != NULL){ if (de3->v.voisin1 == del )de3->v.voisin1 = NULL; else if (de3->v.voisin2 == del )de3->v.voisin2 = NULL; else if (de3->v.voisin3 == del )de3->v.voisin3 = NULL; - else { - Msg(ERROR," Bad Link"); - exit(1); - } + else + Msg(ERROR, "Bad Link in Boyer Watson"); } del->v.voisin1 = NULL ; diff --git a/Mesh/2D_Cylindrical.cpp b/Mesh/2D_Cylindrical.cpp index 072db109a888a6c61c54c9364eacda9e5583a23b..145e79b6cd1b1e3ea5d3cb04d6b099b9b2f4aed9 100644 --- a/Mesh/2D_Cylindrical.cpp +++ b/Mesh/2D_Cylindrical.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Cylindrical.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_Cylindrical.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -17,9 +17,9 @@ void ChangePi (void *a, void *dum){ v = *(Vertex **) a; if ((v->Pos.X / SURF->Cyl.radius1) >= TETAMIN + .99999 * Pi){ - Msg(INFO, "%g -> ", v->Pos.X / SURF->Cyl.radius1); + Msg(INFOS, "%g -> ", v->Pos.X / SURF->Cyl.radius1); v->Pos.X -= (2. * Pi) * SURF->Cyl.radius1; - Msg(INFO, "%g -> ", v->Pos.X / SURF->Cyl.radius1); + Msg(INFOS, "%g -> ", v->Pos.X / SURF->Cyl.radius1); } } @@ -92,7 +92,7 @@ void XYZtoTZ (void *a, void *dum){ prosca (o, x, &C); prosca (o, y, &S); teta = atan2 (S, C); - Msg(INFO, "pt %d %g %g", v->Num, ZRepere, teta); + Msg(DEBUG, "pt %d %g %g", v->Num, ZRepere, teta); v->Pos.X = teta * SURF->Cyl.radius1; v->Pos.Y = ZRepere; @@ -175,7 +175,7 @@ void XYZtoCone (void *a, void *dum){ v->Pos.X = ract * cos (teta); v->Pos.Y = ract * sin (teta); v->Pos.Z = 0.0; - Msg (INFO, "%g %g", ZRepere, v->Pos.X); + Msg (DEBUG, "%g %g", ZRepere, v->Pos.X); } void ConetoXYZ (void *a, void *dum){ @@ -235,9 +235,9 @@ int MeshCylindricalSurface (Surface * s){ if (s->Typ == MSH_SURF_TORUS) return 1; - Msg (INFO, "z %d : %12.5E %12.5E %12.5E", s->Num, s->Cyl.zaxis[0], + Msg (DEBUG, "z %d : %12.5E %12.5E %12.5E", s->Num, s->Cyl.zaxis[0], s->Cyl.zaxis[1], s->Cyl.zaxis[2]); - Msg(INFO, "x %d : %12.5E %12.5E %12.5E", s->Num, s->Cyl.xaxis[0], + Msg(DEBUG, "x %d : %12.5E %12.5E %12.5E", s->Num, s->Cyl.xaxis[0], s->Cyl.xaxis[1], s->Cyl.xaxis[2]); SURF = s; @@ -259,7 +259,7 @@ int MeshCylindricalSurface (Surface * s){ else if (s->Typ == MSH_SURF_CONE) Tree_Action (s->Vertices, XYZtoCone); - Msg(INFO, "%12.5E %12.5E", TETAMAX, TETAMIN); + Msg(DEBUG, "%12.5E %12.5E", TETAMAX, TETAMIN); if ((s->Typ == MSH_SURF_CYLNDR) && (TETAMAX - TETAMIN > Pi * 1.01)) Tree_Action (s->Vertices, ChangePi); diff --git a/Mesh/2D_DivAndConq.cpp b/Mesh/2D_DivAndConq.cpp index b083962709eb0f441928f864f853e3071c34e02e..2540f7c7ef12aa1b9ad737bf6770a38f78658656 100644 --- a/Mesh/2D_DivAndConq.cpp +++ b/Mesh/2D_DivAndConq.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_DivAndConq.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_DivAndConq.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* A L G O R I T H M E D I V I D E A N D C O N Q U E R @@ -163,7 +163,7 @@ int Qtest(PointNumero h,PointNumero i,PointNumero j,PointNumero k){ double xc,yc,rcarre,distca; if ((h == i) && (h == j) && (h == k)){ - Msg(WARNING, "3 points identical"); + Msg(WARNING, "3 Points Identical in Qtest"); return(0); /* returning 1 will cause looping for ever */ } if (CircumCircle( (double) pPointArray[h].where.h, @@ -343,7 +343,7 @@ int CircumCircle(double x1,double y1,double x2,double y2,double x3,double y3, d = 2. * (double)(y1*(x2-x3)+y2*(x3-x1)+y3*(x1-x2)); if (d == 0.0){ - Msg(WARNING, "Points colinear"); + Msg(WARNING, "Points Colinear in CircumCircle"); *xc = *yc = -99999.; return(0); } @@ -354,9 +354,8 @@ int CircumCircle(double x1,double y1,double x2,double y2,double x3,double y3, *xc = (double) ((a1*(y3-y2) + a2*(y1-y3) + a3*(y2-y1)) / d); *yc = (double) ((a1*(x2-x3) + a2*(x3-x1) + a3*(x1-x2)) / d); - if(fabs(d) < EPSILON_LC){ - Msg(WARNING, "Points almost colinear d = %g (xc = %g, yc = %g)",d,*xc,*yc); - } + if(fabs(d) < EPSILON_LC) + Msg(WARNING, "Points Almost Colinear in CircumCircle (d = %g)", d); return(1); } diff --git a/Mesh/2D_InitMesh.cpp b/Mesh/2D_InitMesh.cpp index d5d2b7e9290ea89021ef43537a3923e21069b16d..529d2ee7aede7cac9f90cbe55663b9345b361273 100644 --- a/Mesh/2D_InitMesh.cpp +++ b/Mesh/2D_InitMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_InitMesh.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_InitMesh.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* Generation du maillage initial 2D @@ -233,7 +233,7 @@ void SwapED ( void *data , void *dummy){ void SuppressInETree( void *data , void *dummy){ if(!Tree_Suppress(ETree,data)) - Msg(WARNING, "Cannot suppress in ETree"); + Msg(WARNING, "Cannot Suppress in ETree"); } void AddInETree( void *data , void *dummy){ @@ -348,7 +348,7 @@ void verify_edges (List_T *ListDelaunay, ContourRecord **ListContour, if(!ok){ return; } - Msg(WARNING, "Swapping : %d missing edges",ok); + Msg(INFOS, "Swapping (%d Missing Edge(s))", ok); EDToSwap = NULL; if(EDToSwap)Tree_Delete(EDToSwap); @@ -373,7 +373,7 @@ void verify_edges (List_T *ListDelaunay, ContourRecord **ListContour, } } - Msg(WARNING, "Elimination : %d swaps", Tree_Nbr(EDToSwap)); + Msg(INFOS, "Elimination (%d Swaps)", Tree_Nbr(EDToSwap)); Tree_Action (EDToSwap , SuppressInETree); Tree_Action (EDToSwap , SwapED); diff --git a/Mesh/2D_Links.cpp b/Mesh/2D_Links.cpp index 2e7f8ee5d79eb8612d566e8f4635a82afcbdefb3..bc70258737a6ab7c26b1b5a5e8bca7c0f3c8137e 100644 --- a/Mesh/2D_Links.cpp +++ b/Mesh/2D_Links.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Links.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_Links.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -196,10 +196,8 @@ int CreateLinks(List_T * ListDelaunay , int NumDelaunay, del_Pi->v.voisin2 = del_Pj; else if (del_Pi->v.voisin3 == NULL) del_Pi->v.voisin3 = del_Pj; - else { - Msg(ERROR, "Bad Link"); - exit(1); - } + else + Msg(ERROR, "Bad Link in CreateLinks"); if (del_Pj->v.voisin1 == NULL) del_Pj->v.voisin1 = del_Pi; @@ -207,10 +205,8 @@ int CreateLinks(List_T * ListDelaunay , int NumDelaunay, del_Pj->v.voisin2 = del_Pi; else if (del_Pj->v.voisin3 == NULL) del_Pj->v.voisin3 = del_Pi; - else { - Msg(ERROR, "Bad Link"); - exit(1); - } + else + Msg(ERROR, "Bad Link in CreateLinks"); } i+=2; } diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index 6f7e6e56cc6f93ebaa455341cea08ea2b306e860..3f7f384e8c009f43251238f76818a83e67822f2a 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Mesh.cpp,v 1.3 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_Mesh.cpp,v 1.4 2000-11-23 23:20:35 geuzaine Exp $ */ /* Maillage Delaunay d'une surface (Point insertion Technique) @@ -37,7 +37,6 @@ double qual, newqual, L; int is_3D = 0, UseBGMesh; static Surface *THESURFACE, *THESUPPORT; -static int DEBUG = 0; void ProjetteSurface (void *a, void *b){ Vertex *v; @@ -144,8 +143,7 @@ void Plan_Moyen (void *data, void *dum){ s->d = X; res[0] = 1.; res[1] = res[2] = 0.0; - if (DEBUG) - Msg(INFO, "Plan de type x = c"); + Msg(DEBUG, "Plan Type x = c"); } /* y = Y */ @@ -154,8 +152,7 @@ void Plan_Moyen (void *data, void *dum){ s->d = Y; res[1] = 1.; res[0] = res[2] = 0.0; - if (DEBUG) - Msg(INFO, "Plan de type y = c"); + Msg(DEBUG, "Plan Type y = c"); } /* z = Z */ @@ -180,8 +177,7 @@ void Plan_Moyen (void *data, void *dum){ res[0] = 1.; res[1] = r2[0]; res[2] = r2[1]; - if (DEBUG) - Msg(INFO, "Plan de type by + cz = -x"); + Msg(DEBUG, "Plan Type by + cz = -x"); } /* ax + cz = -y */ @@ -198,8 +194,7 @@ void Plan_Moyen (void *data, void *dum){ res[0] = r2[0]; res[1] = 1.; res[2] = r2[1]; - if (DEBUG) - Msg(INFO, "Plan de type ax + cz = -y"); + Msg(DEBUG, "Plan Type ax + cz = -y"); } /* ax + by = -z */ @@ -216,8 +211,7 @@ void Plan_Moyen (void *data, void *dum){ res[0] = r2[0]; res[1] = r2[1]; res[2] = 1.; - if (DEBUG) - Msg(INFO, "Plan de type ax + by = -z"); + Msg(DEBUG, "Plan Type ax + by = -z"); } else{ Msg(ERROR, "Mean Plane"); @@ -262,12 +256,14 @@ void Plan_Moyen (void *data, void *dum){ for (i = 0; i < 3; i++) s->plan[2][i] = res[i]; - if (DEBUG){ - Msg(INFO, "plan : (%g x + %g y + %g z = %g)", s->a, s->b, s->c, s->d); - Msg(INFO, "normale : (%g , %g , %g )", res[0], res[1], res[2]); - Msg(INFO, "t1 : (%g , %g , %g )", t1[0], t1[1], t1[2]); - Msg(INFO, "t2 : (%g , %g , %g )", t2[0], t2[1], t2[2]); - } + Msg(DEBUG, "Plan : (%g x + %g y + %g z = %g)\n" + WHITE_STR "Normal : (%g , %g , %g )\n" + WHITE_STR "t1 : (%g , %g , %g )\n" + WHITE_STR "t2 : (%g , %g , %g )", + s->a, s->b, s->c, s->d, + res[0], res[1], res[2], + t1[0], t1[1], t1[2], + t2[0], t2[1], t2[2]); /* Matrice orthogonale */ @@ -585,7 +581,7 @@ int mesh_domain (ContourPeek * ListContours, int numcontours, list = NULL; if (!PE_Del_Triangle (del, pt, &list, kill_L, del_L, &numlink, &numkil)){ - Msg(WARNING, "Triangle Non Delete"); + Msg(WARNING, "Triangle Non Deleted"); Delete_Triangle (root, del); Delete_Triangle (root_w, del); del->t.quality_value /= 10.; @@ -644,7 +640,7 @@ int mesh_domain (ContourPeek * ListContours, int numcontours, } if ((volume_old - volume_new) / (volume_old + volume_new) > 1.e-6){ - Msg(WARNING, "Volume has changed : %g -> %g", volume_old, volume_new); + Msg(WARNING, "Volume has Changed (%g->%g)", volume_old, volume_new); Delete_Triangle (root, del); Delete_Triangle (root_w, del); del->t.quality_value /= 10.; @@ -894,7 +890,7 @@ void Maillage_Automatique_VieuxCode (Surface * pS, Mesh * m, int ori){ } else{ err = 1; - Msg(ERROR, "Unknown Vertex %d\n", ver[j]->Num); + Msg(ERROR, "Unknown Vertex %d", ver[j]->Num); } } if (ori && !err) @@ -1103,11 +1099,6 @@ void Maillage_Surface (void *data, void *dum){ End_Surface (s->Support); End_Surface (s); - if (DEBUG){ - Msg (INFO, "Nombre de triangles : %d", Tree_Nbr(s->Simplexes)); - Msg (INFO, "Nombre de points : %d", Tree_Nbr(s->Vertices)); - } - if (CTX.mesh.degree == 2) Degre2 (THEM->Vertices, THEM->VertexEdges, s->Simplexes, NULL, THESUPPORT); diff --git a/Mesh/2D_Mesh_Aniso.cpp b/Mesh/2D_Mesh_Aniso.cpp index 50a1b58f62569e9f00c7ff744d39091fef462a9e..e73c4b0d7b7874618b4b6a38abb9e12215cdb114 100644 --- a/Mesh/2D_Mesh_Aniso.cpp +++ b/Mesh/2D_Mesh_Aniso.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Mesh_Aniso.cpp,v 1.5 2000-11-23 16:07:12 geuzaine Exp $ */ +/* $Id: 2D_Mesh_Aniso.cpp,v 1.6 2000-11-23 23:20:35 geuzaine Exp $ */ /* Jean-Francois Remacle @@ -300,11 +300,11 @@ void Recover_Edge (Surface * s, Edge * e, EdgesContainer & Edges){ coquille = List_Create (3, 3, sizeof (Edge *)); /*On cherche la coquille */ Tree_Action (Edges.AllEdges, putaindecoquille_2D); - Msg(INFO, "edge (%d %d) %d intersect", + Msg(INFOS, "Edge %d->%d, %d Intersections", e->V[0]->Num, e->V[1]->Num, List_Nbr (coquille)); if(List_Nbr(coquille)==1){ - Msg(WARNING, "Unable to swap edge"); + Msg(WARNING, "Unable to Swap Edge"); List_Delete (coquille); return; } @@ -328,6 +328,8 @@ void Recover_Edge (Surface * s, Edge * e, EdgesContainer & Edges){ } List_Delete (coquille); + + Msg(INFOS, "Edge Recovered"); /*On swappe */ } @@ -373,7 +375,7 @@ void missing_edges_2d (Surface * s){ e.V[0] = v1; e.V[1] = v2; if (!EdgesOnSurface.Search (v1, v2)) { - Msg(INFO, "Missing edge %d-%d", v1->Num, v2->Num); + Msg(INFOS, "Missing Edge %d->%d", v1->Num, v2->Num); Recover_Edge (s, &e, EdgesOnSurface); } } @@ -456,7 +458,7 @@ void CrSi_2D (void *a, void *b){ List_Add (Simplexes_New, &s); } else if (S->NumFaceSimpl != 2){ - Msg(WARNING, "GROSSE PANIQUE ..."); + Msg(ERROR, "Panic in CrSi_2D..."); } } @@ -474,7 +476,7 @@ void NewSimplexes_2D (Surface * s, List_T * Sim, List_T * news){ ZONEELIMINEE = S->iEnt; else{ if (S->iEnt != ZONEELIMINEE){ - Msg(WARNING, "Bizzare, l'elimination est foireuse %d %d\n", + Msg(WARNING, "Huh! The Elimination Failed %d %d", S->iEnt, ZONEELIMINEE); } } @@ -631,7 +633,7 @@ bool Bowyer_Watson_2D (Surface * sur, Vertex * v, Simplex * S, int force){ List_Read (Simplexes_Destroyed, i, &s); draw_simplex2d (sur, s, 0); if (!Tree_Suppress (sur->Simplexes, &s)){ - Msg(WARNING, "aie aie aie"); + Msg(WARNING, "Failed to Suppress Simplex %d", s->Num); } Free (s); } @@ -674,7 +676,7 @@ void Convex_Hull_Mesh_2D (List_T * Points, Surface * s){ } */ if (!THES){ - Msg(ERROR, "Vertex %12.5E %12.5E %12.5E in no simplex\n", + Msg(ERROR, "Vertex (%g,%g,%g) in no Simplex", THEV->Pos.X, THEV->Pos.Y, THEV->Pos.Z); THEV->Pos.X += 10 * RAND_LONG; THEV->Pos.Y += 10 * RAND_LONG; @@ -845,7 +847,7 @@ void Restore_Surface (Surface * s){ iSurface = isListaSurface (ListCurves, s); N = Tree_Nbr (keep); - Msg (INFO, "volume %d maillage initial %d simplexes %d/%d courbes %d fac", + Msg (INFOS, "Initial Mesh of Surface %d: %d Simplices, %d/%d Curves, %d Faces", iSurface, N, List_Nbr (ListCurves), List_Nbr (ListAllCurves), Tree_Nbr (FacesTree)); @@ -1040,7 +1042,7 @@ int AlgorithmeMaillage2DAnisotropeModeJF (Surface * s){ List_Delete (Suppress); if(!Tree_Right (s->Simplexes, &simp)) - Msg(WARNING, "No Simplex left"); + Msg(WARNING, "No Simplex Left"); else{ i = 0; while ( simp->Quality > CONV_VALUE){ @@ -1069,9 +1071,9 @@ int AlgorithmeMaillage2DAnisotropeModeJF (Surface * s){ if (i % n == n - 1){ volume = 0.0; Tree_Action (s->Simplexes, VSIM_2D); - Msg(STATUS, "%d Nodes, %d Elements", + Msg(STATUS, "Nod=%d Elm=%d", Tree_Nbr (s->Vertices), Tree_Nbr (s->Simplexes)); - Msg(SELECT, "Vol(%.6e) Conv(%g->%.1f)", volume, simp->Quality, CONV_VALUE); + Msg(SELECT, "Vol(%g) Conv(%g->%g)", volume, simp->Quality, CONV_VALUE); } Bowyer_Watson_2D (s, newv, simp, 0); Tree_Right (s->Simplexes, &simp); diff --git a/Mesh/2D_SMesh.cpp b/Mesh/2D_SMesh.cpp index fd483fa9837c7e8febcb63f2308fc45a9d11b50b..4d0e1c26ef833390d62db250c34f227d03972482 100644 --- a/Mesh/2D_SMesh.cpp +++ b/Mesh/2D_SMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_SMesh.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_SMesh.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* Maillage transfini surfacique *s2 @@ -69,7 +69,7 @@ int MeshTransfiniteSurface (Surface *sur) { pV = &V; if((vexist = (Vertex**)Tree_PQuery(THEM->Vertices,&pV)) == NULL) { Msg(WARNING, "Unknown Control Point %d in Transfinite Surface %d", - V.Num,sur->Num); + V.Num,sur->Num); return(0); } else{ @@ -105,8 +105,8 @@ int MeshTransfiniteSurface (Surface *sur) { for(i=0;i<nb;i++) if(G[i] == NULL) { - Msg(WARNING, "Wrong definition of Transfinite Surface(%d)", - sur->Num); + Msg(WARNING, "Wrong definition of Transfinite Surface %d", + sur->Num); return(0); } diff --git a/Mesh/2D_Util.cpp b/Mesh/2D_Util.cpp index efca7e18360b8f53743ef8bbe5a71026abd8ddf1..69a7d9f94b3f4fac413ad3b5fb2459bd44fb0670 100644 --- a/Mesh/2D_Util.cpp +++ b/Mesh/2D_Util.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Util.cpp,v 1.3 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 2D_Util.cpp,v 1.4 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -231,7 +231,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) { b = del->t.b; } else{ - Msg(ERROR, "vor insert 1"); + Msg(ERROR, "Voronoi Insert 1"); } } else if(v2 != NULL) { @@ -248,7 +248,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) { b = del->t.c; } else { - Msg(ERROR,"vor insert 2"); + Msg(ERROR,"Voronoi Insert 2"); } } else if(v3 != NULL) { @@ -265,7 +265,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) { b = del->t.c; } else { - Msg(ERROR, "vor insert 3"); + Msg(ERROR, "Voronoi Insert 3"); } } } @@ -274,7 +274,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) { else if( v2->t.position == ACCEPTED )del2 = v2; else if( v3->t.position == ACCEPTED )del2 = v3; else { - Msg(ERROR,"coherence"); + Msg(ERROR,"Coherence in Localize"); } if((del->t.a != del2->t.a) && (del->t.a != del2->t.b) && (del->t.a != del2->t.c)){ @@ -290,7 +290,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) { b = del->t.b; } else{ - Msg(ERROR,"vor insert"); + Msg(ERROR,"Voronoi Insert"); } } diff --git a/Mesh/3D_BGMesh.cpp b/Mesh/3D_BGMesh.cpp index 3c58773fc721abd44acaa759a282948a6e3c16c8..8dbacc380d046fb2015aedc0158b90370e2f9c24 100644 --- a/Mesh/3D_BGMesh.cpp +++ b/Mesh/3D_BGMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_BGMesh.cpp,v 1.5 2000-11-23 17:16:38 geuzaine Exp $ */ +/* $Id: 3D_BGMesh.cpp,v 1.6 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Mesh.h" @@ -104,7 +104,7 @@ double Lc_XYZ (double X, double Y, double Z, Mesh * m){ else if (Pt_In_Volume (X, Y, Z, m, &l, 0.2)); else if (Pt_In_Volume (X, Y, Z, m, &l, 0.5)); else{ - Msg(WARNING, "Exterior Point"); + Msg(ERROR, "Exterior Point (%g,%g,%g)", X, Y, Z); l = 1.e-25; } break; @@ -205,8 +205,8 @@ int BGMWithView (Post_View * ErrView){ Tree_Action (m.Simplexes, AIG); - Msg(INFO, "Background Mesh Loaded (%d Nodes, %d Elements)", - Tree_Nbr(m.Vertices), Tree_Nbr(m.Simplexes)); + Msg(INFOS, "Background Mesh Loaded (%d Nodes, %d Elements)", + Tree_Nbr(m.Vertices), Tree_Nbr(m.Simplexes)); return (1); } @@ -307,7 +307,7 @@ int CreateBGM (Post_View * ErrView, int OptiMethod, double Degree, j++; } - *ObjFunct = optimesh (j, OptiMethod, dim, e, h, p, OptiValue, OptiValue); + *ObjFunct = AdaptMesh (j, OptiMethod, dim, e, h, p, OptiValue); f = fopen (OutFile, "w"); @@ -335,7 +335,7 @@ int CreateBGM (Post_View * ErrView, int OptiMethod, double Degree, fprintf (f, "};\n"); fclose (f); - Msg(INFO,"Wrote background mesh in '%s'", OutFile); + Msg(INFOS, "Background Mesh Wriiten in '%s'", OutFile); return 1; } diff --git a/Mesh/3D_Coherence.cpp b/Mesh/3D_Coherence.cpp index 827c0e8febc81d604d5ab7c438f3db4732c0900a..c96b7930026d6bb890de4cfd05a36047d71ae947 100644 --- a/Mesh/3D_Coherence.cpp +++ b/Mesh/3D_Coherence.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_Coherence.cpp,v 1.4 2000-11-23 17:18:50 geuzaine Exp $ */ +/* $Id: 3D_Coherence.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -16,7 +16,6 @@ static Volume *THEVOL; static Edge *TheEdge; static Face *TheFace; static List_T *Teti; -static int DEBUG = 0; List_T *Missing, *MissingF, *MissingS; Tree_T *EdgesTree, *FacesTree, *swaps; @@ -572,39 +571,27 @@ Vertex *Edge_Face (Edge * e, Face * f){ if (res[0] == 1.0 || res[2] == 0.0 || res[0] == 0.0 || - res[1] == 1. - res[0] || res[1] == 0.0 || res[0] == 1.0){ - Msg(INFO, "facette p1 %12.5E %12.5E %12.5E\n", - f->V[0]->Pos.X, f->V[0]->Pos.Y, f->V[0]->Pos.Z); - Msg(INFO, "facette p2 %12.5E %12.5E %12.5E\n", - f->V[1]->Pos.X, f->V[1]->Pos.Y, f->V[1]->Pos.Z); - Msg(INFO, "facette p3 %12.5E %12.5E %12.5E\n", - f->V[2]->Pos.X, f->V[2]->Pos.Y, f->V[2]->Pos.Z); - Msg(INFO, "edge e2 %12.5E %12.5E %12.5E\n", - e->V[0]->Pos.X, e->V[0]->Pos.Y, e->V[0]->Pos.Z); - Msg(INFO, "edge e3 %12.5E %12.5E %12.5E\n", - e->V[1]->Pos.X, e->V[1]->Pos.Y, e->V[1]->Pos.Z); - Msg(INFO, "%22.15E %22.15E %22.15E \n", res[0], res[1], res[2]); - } - + res[1] == 1. - res[0] || res[1] == 0.0 || res[0] == 1.0) + Msg(DEBUG, "Face p1 %g %g %g\n" + WHITE_STR "facette p2 %g %g %g\n" + WHITE_STR "facette p3 %g %g %g\n" + WHITE_STR "edge e2 %g %g %g\n" + WHITE_STR "edge e3 %g %g %g\n" + WHITE_STR "%g %g %g", + f->V[0]->Pos.X, f->V[0]->Pos.Y, f->V[0]->Pos.Z, + f->V[1]->Pos.X, f->V[1]->Pos.Y, f->V[1]->Pos.Z, + f->V[2]->Pos.X, f->V[2]->Pos.Y, f->V[2]->Pos.Z, + e->V[0]->Pos.X, e->V[0]->Pos.Y, e->V[0]->Pos.Z, + e->V[1]->Pos.X, e->V[1]->Pos.Y, e->V[1]->Pos.Z, + res[0], res[1], res[2]); - /* - printf("u v w = %22.15e %22.15e %22.15e\n",res[0],res[1],res[2]); - */ v = Create_Vertex (++CurrentNodeNumber, (1. - res[2]) * e->V[0]->Pos.X + res[2] * e->V[1]->Pos.X, (1. - res[2]) * e->V[0]->Pos.Y + res[2] * e->V[1]->Pos.Y, (1. - res[2]) * e->V[0]->Pos.Z + res[2] * e->V[1]->Pos.Z, (1. - res[2]) * e->V[0]->lc + res[2] * e->V[1]->lc, 0.0); v->ListSurf = List_Create (1, 1, sizeof (Surface *)); - if (DEBUG){ - Msg(INFO, "facette p1 %12.5E %12.5E %12.5E\n", - f->V[0]->Pos.X, f->V[0]->Pos.Y, f->V[0]->Pos.Z); - Msg(INFO,"facette p2 %12.5E %12.5E %12.5E\n", - f->V[1]->Pos.X, f->V[1]->Pos.Y, f->V[1]->Pos.Z); - Msg(INFO,"facette p3 %12.5E %12.5E %12.5E\n", - f->V[2]->Pos.X, f->V[2]->Pos.Y, f->V[2]->Pos.Z); - Msg(INFO,"Newv = %12.5E %12.5E %12.5E\n", v->Pos.X, v->Pos.Y, v->Pos.Z); - } + return v; } @@ -739,13 +726,13 @@ Vertex *Edge_Edge (Edge * e, Vertex * v1, Vertex * v2){ /* SEGMENTS PARALLELES */ /* printf("systeme singulier\n"); printf("arete %d -> %d\n",v1->Num,v2->Num); - printf("arete %12.5E %12.5E %12.5E --> %12.5E %12.5E %12.5E\n", + printf("arete %g %g %g --> %g %g %g\n", v1->Pos.X,v1->Pos.Y,v1->Pos.Z,v2->Pos.X,v2->Pos.Y,v2->Pos.Z); - printf("arete %12.5E %12.5E %12.5E --> %12.5E %12.5E %12.5E\n", + printf("arete %g %g %g --> %g %g %g\n", e->V[0]->Pos.X,e->V[0]->Pos.Y,e->V[0]->Pos.Z, e->V[1]->Pos.X,e->V[1]->Pos.Y,e->V[1]->Pos.Z); - printf("%12.5E %12.5E\n",mat[0][0],mat[0][1]); - printf("%12.5E %12.5E\n",mat[1][0],mat[1][1]); + printf("%g %g\n",mat[0][0],mat[0][1]); + printf("%g %g\n",mat[1][0],mat[1][1]); getchar(); */ return NULL; @@ -1183,11 +1170,13 @@ int Coherence (Volume * v, Mesh * m){ volume = 0; Tree_Action (v->Simplexes, VSIM); - Msg(INFO, "Volume == %12.5E", volume); + Msg(INFOS, "Volume = %g", volume); + + Msg(INFOS, "===================================================\n" + WHITE_STR "(1) Number of Missing Edges = %d\n" + WHITE_STR "===================================================", + List_Nbr (Missing)); - Msg(INFO, " ==================================="); - Msg(INFO, " (1) Nombre d'aretes manquantes %3d", List_Nbr (Missing)); - Msg(INFO, " ==================================="); for (i = 0; i < List_Nbr (Missing); i++){ pE1 = (Edge *) List_Pointer (Missing, i); @@ -1216,32 +1205,32 @@ int Coherence (Volume * v, Mesh * m){ } } */ - Msg(INFO, "Traitement de %d -> %d", pE1->V[0]->Num, pE1->V[1]->Num); - Msg(INFO, "=> %d divisions", List_Nbr (NewPoints)); + Msg(INFOS, "Edge %d->%d => %d Division(s)", + pE1->V[0]->Num, pE1->V[1]->Num, List_Nbr(NewPoints)); - if (!List_Nbr (NewPoints)){ - Msg(INFO, "%g %g %g", pE1->V[0]->Pos.X, pE1->V[0]->Pos.Y, pE1->V[0]->Pos.Z); - Msg(INFO, "%g %g %g", pE1->V[1]->Pos.X, pE1->V[1]->Pos.Y, pE1->V[1]->Pos.Z); - Msg(ERROR, "Missing Edge Without Any Intersection"); - } + if (!List_Nbr (NewPoints)) + Msg(ERROR, "Missing Edge Without Any Intersection (%g,%g,%g) (%g,%g,%g)", + pE1->V[0]->Pos.X, pE1->V[0]->Pos.Y, pE1->V[0]->Pos.Z, + pE1->V[1]->Pos.X, pE1->V[1]->Pos.Y, pE1->V[1]->Pos.Z); } + Msg(STATUS, "Boundary Faces Recovery"); volume = 0; Tree_Action (v->Simplexes, VSIM); - Msg(INFO, "Volume == %12.5E", volume); - Msg(STATUS, "Boundary Faces Recovery"); + Msg(INFOS, "Volume = %g", volume); /* Missing Faces */ - Msg(INFO, " ==================================="); - Msg(INFO, " (1) Nombre de facettes manquantes %3d", List_Nbr (MissingFaces)); - Msg(INFO, " ==================================="); + Msg(INFOS, "===================================================\n" + WHITE_STR "(1) Number of Missing Faces = %d\n" + WHITE_STR "===================================================", + List_Nbr (MissingFaces)); for (i = 0; i < List_Nbr (MissingS); i++){ List_Read (MissingS, i, &simp); TheFace = &simp->F[0]; - Msg(INFO, "missing face %6d %6d %6d", simp->F[0].V[0]->Num, + Msg(INFOS, "Face %d %d %d", simp->F[0].V[0]->Num, simp->F[0].V[1]->Num, simp->F[0].V[2]->Num); E.V[0] = simp->F[0].V[0]; E.V[1] = simp->F[0].V[1]; @@ -1300,7 +1289,7 @@ int Coherence (Volume * v, Mesh * m){ if (1 || List_Nbr (ListFaces) == 2 * (Np - 1) - Nh){ - Msg(INFO, "La face est recuperable (%d <--> %d=2*(%d-1)-%d)*****", + Msg(INFOS, "Recoverable Face (%d <--> %d=2*(%d-1)-%d)", List_Nbr (ListFaces), 2 * (Np - 1) - Nh, Np, Nh); for (j = 0; j < List_Nbr (v->Surfaces); j++){ @@ -1322,19 +1311,19 @@ int Coherence (Volume * v, Mesh * m){ } } else{ - Msg(INFO, "***** La face est irrecuperable (%d <--> %d=2*(%d-1)-%d)*****", + Msg(ERROR, "*Unrecoverable* Face (%d <--> %d=2*(%d-1)-%d)", List_Nbr (ListFaces), 2 * (Np - 1) - Nh, Np, Nh); for (k = 0; k < List_Nbr (ListFaces); k++){ List_Read (ListFaces, k, &Face); - Msg(INFO, "face %d %d %d", Face.V[0]->Num, Face.V[1]->Num, Face.V[2]->Num); + Msg(INFO, "Face %d %d %d", Face.V[0]->Num, Face.V[1]->Num, Face.V[2]->Num); } - Msg(ERROR, "Unable To Recover One Face"); Tree_Action (v->Simplexes, findEdges); } } + volume = 0; Tree_Action (v->Simplexes, VSIM); - Msg(INFO, "Volume apres la recup === %12.5E", volume); + Msg(INFOS, "Volume after Edge/Face Recovering = %g", volume); /* Missing Edges */ create_Edges (v); @@ -1344,8 +1333,8 @@ int Coherence (Volume * v, Mesh * m){ create_Faces (v); MissingFaces = Missing_Faces (v); - Msg(INFO, "Verification finale : %d edges manquantes", List_Nbr (MissingEdges)); - Msg(INFO, "Verification finale : %d faces manquantes", List_Nbr (MissingFaces)); + Msg(INFOS, "Final Check : Missing %d Edges, %d Faces", + List_Nbr(MissingEdges), List_Nbr(MissingFaces)); Impression_Resultats (); @@ -1510,7 +1499,7 @@ void Restore_Volume (Volume * v){ for (i = 0; i < List_Nbr (ListSurfaces); i++){ List_Read (ListSurfaces, i, &j); - Msg(INFO, "surf : %d ", j); + Msg(INFO, "Surface %d", j); } iVolume = 0; @@ -1537,11 +1526,11 @@ void Restore_Volume (Volume * v){ for (i = 0; i < List_Nbr (ListSurfaces); i++){ List_Read (ListSurfaces, i, &j); - Msg(INFO, "surf : %d ", j); + Msg(INFO, "Surface %d", j); } N = Tree_Nbr (keep); - Msg(INFO, "volume %d maillage initial %d simplexes", iVolume, N); + Msg(INFOS, "Initial Mesh of Volume %d: %d Simplices", iVolume, N); Tree_Action (keep, attribueVolume); Tree_Delete (keep); List_Reset (ListSurfaces); diff --git a/Mesh/3D_Divide.cpp b/Mesh/3D_Divide.cpp index 374542bb9926f376ccd1a6146863dc8265f84f86..ca610a8ecf1eff17f24feb8c58a4eff53e4f09f4 100644 --- a/Mesh/3D_Divide.cpp +++ b/Mesh/3D_Divide.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_Divide.cpp,v 1.2 2000-11-23 14:11:34 geuzaine Exp $ */ +/* $Id: 3D_Divide.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* Routine de division des elements tetraedriques ou triangulaires @@ -54,11 +54,12 @@ void Remise_A_Zero (void){ } void Impression_Resultats (void){ - Msg(INFOS,"==============================================="); - Msg(INFOS," Surface coherence results: intersections:"); - Msg(INFOS," %d EV, %d EE, %d FV, %d FF, %d FE, %d EEE, %d EEEE", - EV,EE,FV,FF,FE,EEE,EEEE); - Msg(INFOS,"==============================================="); + + Msg(INFOS, "===================================================\n" + WHITE_STR "Surface Coherence Results (Number of Intersections)\n" + WHITE_STR "%d EV, %d EE, %d FV, %d FF, %d FE, %d EEE, %d EEEE\n" + WHITE_STR "===================================================", + EV, EE, FV, FF, FE, EEE, EEEE); } int PARLE = 0; @@ -70,7 +71,7 @@ void cut_prism (Vertex * v1, Vertex * v2, Vertex * v3, Simplex *news; Vertex *e1; - Msg (INFOS, "Prism Cut"); + Msg(INFOS, "Prism Cut"); /* test des meilleures aretes a creer */ /* @@ -210,14 +211,15 @@ void cut_prism (Vertex * v1, Vertex * v2, Vertex * v3, else if (are_exists (v6, v1) && are_exists (v5, v3) && are_exists (v4, v2)) { - Msg(INFOS, "Steiner Prism 1 found !"); + Msg(INFOS, "Found Steiner Prism 1!"); - e1 = Create_Vertex (++CurrentNodeNumber, - (v1->Pos.X + v2->Pos.X + v3->Pos.X + v4->Pos.X + v5->Pos.X + v6->Pos.X) / 6., - (v1->Pos.Y + v2->Pos.Y + v3->Pos.Y + v4->Pos.Y + v5->Pos.Y + v6->Pos.Y) / 6., - (v1->Pos.Z + v2->Pos.Z + v3->Pos.Z + v4->Pos.Z + v5->Pos.Z + v6->Pos.Z) / 6., - (v1->lc + v2->lc + v3->lc + v4->lc + v5->lc + v6->lc) / 6., - 0.0); + e1 = Create_Vertex + (++CurrentNodeNumber, + (v1->Pos.X + v2->Pos.X + v3->Pos.X + v4->Pos.X + v5->Pos.X + v6->Pos.X) / 6., + (v1->Pos.Y + v2->Pos.Y + v3->Pos.Y + v4->Pos.Y + v5->Pos.Y + v6->Pos.Y) / 6., + (v1->Pos.Z + v2->Pos.Z + v3->Pos.Z + v4->Pos.Z + v5->Pos.Z + v6->Pos.Z) / 6., + (v1->lc + v2->lc + v3->lc + v4->lc + v5->lc + v6->lc) / 6., + 0.0); Tree_Add (newpoints, &e1); news = Create_Simplex (e1, v6, v1, v4); news->iEnt = IENT; @@ -242,14 +244,15 @@ void cut_prism (Vertex * v1, Vertex * v2, Vertex * v3, else if (are_exists (v4, v3) && are_exists (v6, v2) && are_exists (v5, v1)){ - Msg(INFOS, "Steiner Prism 2 found !"); - - e1 = Create_Vertex (++CurrentNodeNumber, - (v1->Pos.X + v2->Pos.X + v3->Pos.X + v4->Pos.X + v5->Pos.X + v6->Pos.X) / 6., - (v1->Pos.Y + v2->Pos.Y + v3->Pos.Y + v4->Pos.Y + v5->Pos.Y + v6->Pos.Y) / 6., - (v1->Pos.Z + v2->Pos.Z + v3->Pos.Z + v4->Pos.Z + v5->Pos.Z + v6->Pos.Z) / 6., - (v1->lc + v2->lc + v3->lc + v4->lc + v5->lc + v6->lc) / 6., - 0.0); + Msg(INFOS, "Found Steiner Prism 2!"); + + e1 = Create_Vertex + (++CurrentNodeNumber, + (v1->Pos.X + v2->Pos.X + v3->Pos.X + v4->Pos.X + v5->Pos.X + v6->Pos.X) / 6., + (v1->Pos.Y + v2->Pos.Y + v3->Pos.Y + v4->Pos.Y + v5->Pos.Y + v6->Pos.Y) / 6., + (v1->Pos.Z + v2->Pos.Z + v3->Pos.Z + v4->Pos.Z + v5->Pos.Z + v6->Pos.Z) / 6., + (v1->lc + v2->lc + v3->lc + v4->lc + v5->lc + v6->lc) / 6., + 0.0); Tree_Add (newpoints, &e1); news = Create_Simplex (e1, v4, v3, v6); news->iEnt = IENT; @@ -272,7 +275,7 @@ void cut_prism (Vertex * v1, Vertex * v2, Vertex * v3, } else{ - Msg (ERROR, "Uncoherent prism !"); + Msg(ERROR, "Uncoherent Prism"); } } @@ -437,7 +440,7 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, v7 = pI->s->V[3]; } else{ - Msg (ERROR, "Tree Edges Cut Without Common Point"); + Msg(ERROR, "Three Edges Cut Without Common Point!"); return; } @@ -689,7 +692,7 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel, v8 = pI->VE[3]; } else{ - Msg(ERROR, "Incoherent intersection EEEE"); + Msg(ERROR, "Incoherent 4 Edges Intersection"); return; } cut_prism (v8, v4, v6, v7, v3, v5, newpoints, AddedTet); diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 7f7979c1d309eb7259f78b51f9bd0604abfaa38c..a07eb5c866c95a5c33ccaebf7146d472944b9f60 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_Mesh.cpp,v 1.4 2000-11-23 17:16:38 geuzaine Exp $ */ +/* $Id: 3D_Mesh.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ /* J-F Remacle 1995 @@ -400,7 +400,7 @@ void CrSi (void *a, void *b){ List_Add (Simplexes_New, &s); } else if (S->NumFaceSimpl != 2){ - Msg(WARNING, "GROSSE PANIQUE ...\n"); + Msg(WARNING, "Huh! Panic in CrSi"); } } @@ -419,7 +419,7 @@ void NewSimplexes (Mesh * m, List_T * Sim, List_T * news){ ZONEELIMINEE = S->iEnt; else { if (S->iEnt != ZONEELIMINEE){ - Msg(WARNING, "Bizzare, l'elimination est foireuse %d %d\n", + Msg(WARNING, "Huh! The Elimination Failed %d %d", S->iEnt, ZONEELIMINEE); } } @@ -552,7 +552,7 @@ bool Bowyer_Watson (Mesh * m, Vertex * v, Simplex * S, int force){ for (i = 0; i < List_Nbr (Simplexes_Destroyed); i++){ List_Read (Simplexes_Destroyed, i, &s); if (!Tree_Suppress (m->Simplexes, &s)) - printf ("Error : Impossible to Delete Simplex\n"); + Msg(ERROR, "Impossible to Delete Simplex"); Free (s); } @@ -606,8 +606,8 @@ void Convex_Hull_Mesh (List_T * Points, Mesh * m){ Msg(STATUS, "Vol=%g",volume); } if (!THES){ - Msg(WARNING, "Vertex %12.5E %12.5E %12.5E in no simplex", - THEV->Pos.X,THEV->Pos.Y,THEV->Pos.Z); + Msg(WARNING, "Vertex (%g,%g,%g) in no Simplex", + THEV->Pos.X,THEV->Pos.Y,THEV->Pos.Z); THEV->Pos.X += 10 * RAND_LONG; THEV->Pos.Y += 10 * RAND_LONG; THEV->Pos.Z += 10 * RAND_LONG; @@ -632,7 +632,8 @@ void Convex_Hull_Mesh (List_T * Points, Mesh * m){ if(count > 5){ N++; List_Add(POINTS,&THEV); - Msg(WARNING,"UNABLE TO ADD THE POINT %d... WILL DO IT LATER",THEV->Num); + Msg(WARNING, "Unable to Add Point %d (Will do it Later)", + THEV->Num); break; } } @@ -815,9 +816,9 @@ void Maillage_Volume (void *data, void *dum){ if (i % n == n - 1){ volume = 0.0; Tree_Action (LOCAL->Simplexes, VSIM); - Msg(STATUS, "%d Nodes, %d Elements", + Msg(STATUS, "Nod=%d Elm=%d", Tree_Nbr (LOCAL->Vertices), Tree_Nbr (LOCAL->Simplexes)); - Msg(SELECT, "Vol(%.6e) Conv(%g->%.1f)", volume, simp->Quality, CONV_VALUE); + Msg(SELECT, "Vol(%g) Conv(%g->%g)", volume, simp->Quality, CONV_VALUE); double adv = 100. * (CONV_VALUE / simp->Quality); Progress ((int) adv); } diff --git a/Mesh/3D_SMesh.cpp b/Mesh/3D_SMesh.cpp index e2fd2a9c0b2a1ea9cdc214b23307c2bb4a40a21e..26e8fc6ecc4be1b67bbf50e4151ef800d583b25e 100644 --- a/Mesh/3D_SMesh.cpp +++ b/Mesh/3D_SMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_SMesh.cpp,v 1.2 2000-11-23 14:11:35 geuzaine Exp $ */ +/* $Id: 3D_SMesh.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* Maillage transfini volumique @@ -142,7 +142,7 @@ int MeshTransfiniteVolume (Volume *vol) { V.Num = vol->ipar[i]; pV = &V; if((vexist = (Vertex**)Tree_PQuery(THEM->Vertices,&pV)) == NULL) { - Msg(WARNING, "Unknown Control Point %d in Transfinite Volume %d\n", + Msg(WARNING, "Unknown Control Point %d in Transfinite Volume %d", V.Num,vol->Num); return(0); } @@ -176,7 +176,7 @@ int MeshTransfiniteVolume (Volume *vol) { V.Num = GG[i]->ipar[j]; pV = &V; if((vexist = (Vertex**)Tree_PQuery(THEM->Vertices,&pV)) == NULL) { - Msg(WARNING, "Unknown Control Point %d in Transfinite Surface %d\n", + Msg(WARNING, "Unknown Control Point %d in Transfinite Surface %d", V.Num,GG[i]->Num); return(0); } @@ -210,22 +210,22 @@ int MeshTransfiniteVolume (Volume *vol) { } if(nbs == 6 && NbFacesFound != 6) { - Msg(WARNING, "Wrong definition of Hexahedric Transfinite Volume(%d)\n", + Msg(WARNING, "Wrong Definition of Hexahedric Transfinite Volume %d", vol->Num); return(0); } if(nbs == 5 && NbFacesFound != 5) { - Msg(WARNING, "Wrong definition of Prismatic Transfinite Volume(%d). " - "Possibly because first and fourth points are not the degenerated ones\n", - vol->Num); + Msg(WARNING, "Wrong Definition of Prismatic Transfinite Volume %d\n" + WHITE_STR "Possibly because the first and fourth points are not the\n" + WHITE_STR "degenerated ones", vol->Num); return(0); } if(nbs == 6){ for(i=0;i<6;i++){ if(G[i] == NULL) { - Msg(WARNING, "Wrong definition of Hexahedric Transfinite Volume(%d)\n", + Msg(WARNING, "Wrong Definition of Hexahedric Transfinite Volume %d", vol->Num); return(0); } @@ -235,9 +235,9 @@ int MeshTransfiniteVolume (Volume *vol) { for(i=0;i<6;i++){ if(i != 3) { if(G[i] == NULL) { - Msg(WARNING, "Wrong definition of Prismatic Transfinite Volume(%d). " - "Possibly because first and fourth points are not the degenerated ones\n", - vol->Num); + Msg(WARNING, "Wrong Definition of Prismatic Transfinite Volume %d\n" + WHITE_STR "Possibly because the first and fourth points are not the\n" + WHITE_STR "degenerated ones", vol->Num); return(0); } } @@ -409,7 +409,7 @@ int MeshTransfiniteVolume (Volume *vol) { nbtet += 6; } else{ - Msg(WARNING, "Wrong Surface Recombining in Transfinite Volume(%d)\n", + Msg(WARNING, "Wrong Surface Recombining in Transfinite Volume %d", vol->Num); return(0); } @@ -461,7 +461,7 @@ int MeshTransfiniteVolume (Volume *vol) { nbtet += 2; } else{ - Msg(WARNING, "Wrong Surface Recombining in Transfinite Volume(%d)\n", + Msg(WARNING, "Wrong Surface Recombining in Transfinite Volume %d", vol->Num); return(0); } @@ -495,8 +495,8 @@ int MeshTransfiniteVolume (Volume *vol) { nbtet += 6; } else{ - Msg(WARNING, "Wrong Surface Recombining in Transfinite Volume(%d)\n", - vol->Num); + Msg(WARNING, "Wrong Surface Recombining in Transfinite Volume %d", + vol->Num); return(0); } } diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp index 436abc6aee05dbf5d4a96cbd8a1041a5df85920b..5b1219755aaabf8ab52e01094bca8a078379eb32 100644 --- a/Mesh/Create.cpp +++ b/Mesh/Create.cpp @@ -1,4 +1,4 @@ -/* $Id: Create.cpp,v 1.4 2000-11-23 17:16:38 geuzaine Exp $ */ +/* $Id: Create.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -472,7 +472,7 @@ Curve *Create_Curve (int Num, int Typ, int Order, List_T * Liste, if ((v = FindVertex (iPnt, THEM))) List_Add (pC->Control_Points, &v); else - Msg(ERROR, "Curve %d control point %d unknown", pC->Num, iPnt); + Msg(FATAL, "Unknown Control Point %d in Curve %d", iPnt, pC->Num); } } else { @@ -487,19 +487,19 @@ Curve *Create_Curve (int Num, int Typ, int Order, List_T * Liste, else { if ((v = FindVertex (p1, THEM))){ pC->beg = v; - Msg(INFO, "Curve %d beg control point %d ", pC->Num, v->Num); + Msg(INFOS, "Curve %d First Control Point %d ", pC->Num, v->Num); } else{ List_Read (pC->Control_Points, 0, &pC->beg); - Msg(ERROR, "Curve %d control point %d unknown", pC->Num, p1); + Msg(FATAL, "Unknown Control Point %d in Curve %d", p1, pC->Num); } if ((v = FindVertex (p2, THEM))){ pC->end = v; - Msg(INFO, "Curve %d end control point %d ", pC->Num, v->Num); + Msg(INFOS, "Curve %d First Control Point %d ", pC->Num, v->Num); } else{ List_Read (pC->Control_Points, List_Nbr (pC->Control_Points) - 1, &pC->end); - Msg(ERROR, "Curve %d control point %d unknown", pC->Num, p2); + Msg(FATAL, "Unknown Control Point %d in Curve %d", p2, pC->Num); } } End_Curve (pC); diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 68052ca6d79cfab10c943d4e3f5f817f7ac24f31..28a50953257f2548d2a6ba5eab187bcee25d0ecf 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -1,4 +1,4 @@ -/* $Id: Generator.cpp,v 1.4 2000-11-23 15:05:59 geuzaine Exp $ */ +/* $Id: Generator.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -186,7 +186,7 @@ void mai3d (Mesh * M, int Asked){ t1 = Cpu(); Maillage_Dimension_1 (M); t2 = Cpu(); - Msg (INFO, "Mesh 1D complete (%f s)", t2 - t1); + Msg (INFO, "Mesh 1D complete (%g s)", t2 - t1); M->status = 1; } @@ -198,7 +198,7 @@ void mai3d (Mesh * M, int Asked){ t1 = Cpu(); Maillage_Dimension_2 (M); t2 = Cpu(); - Msg (INFO, "Mesh 2D complete (%f s)", t2 - t1); + Msg (INFO, "Mesh 2D complete (%g s)", t2 - t1); M->status = 2; } @@ -210,7 +210,7 @@ void mai3d (Mesh * M, int Asked){ t1 = Cpu(); Maillage_Dimension_3 (M); t2 = Cpu(); - Msg (INFO, "Mesh 3D complete (%f s)", t2 - t1); + Msg (INFO, "Mesh 3D complete (%g s)", t2 - t1); M->status = 3; } diff --git a/Mesh/Interpolation.cpp b/Mesh/Interpolation.cpp index d2b868d25e16e6e07134101b13e64002f27719f1..38349eb5c75ea029f8f4f33540702da06a806cf3 100644 --- a/Mesh/Interpolation.cpp +++ b/Mesh/Interpolation.cpp @@ -1,4 +1,4 @@ -/* $Id: Interpolation.cpp,v 1.2 2000-11-23 14:11:35 geuzaine Exp $ */ +/* $Id: Interpolation.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -234,7 +234,7 @@ Vertex InterpolateCurve (Curve * Curve, double u, int derivee){ return V; default : - Msg(ERROR, "Unknown Curve Type in Interpolation"); + Msg(FATAL, "Unknown Curve Type in Interpolation"); return V; } @@ -461,7 +461,7 @@ Vertex InterpolateSurface (Surface * s, double u, double v, return (T); default : - Msg(ERROR, "Unknown Surface Type in Interpolation"); + Msg(FATAL, "Unknown Surface Type in Interpolation"); return T; } diff --git a/Mesh/Numeric.cpp b/Mesh/Numeric.cpp index 9df91ae6b27f6b4d9303e2681c935c1e9e1492ec..9bc3a2bd5c1914f6dec9d870eb3ed54c125de460 100644 --- a/Mesh/Numeric.cpp +++ b/Mesh/Numeric.cpp @@ -1,4 +1,4 @@ -/* $Id: Numeric.cpp,v 1.4 2000-11-23 17:16:38 geuzaine Exp $ */ +/* $Id: Numeric.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -224,9 +224,9 @@ void XYZtoUV (Surface *s, double X, double Y, double Z, double *U, double *V) { *V = Vnew; } - if(iter == MaxIter) Msg(WARNING, "Could not converge in XYZtoUV"); + if(iter == MaxIter) Msg(WARNING, "Could not Converge in XYZtoUV"); - if(iter > 10) Msg(WARNING, "Many (%d) iterations in XYZtoUV\n", iter); + if(iter > 10) Msg(WARNING, "Many (%d) Iterations in XYZtoUV", iter); free_dmatrix(mat,1,3,1,3); free_dmatrix(jac,1,3,1,3); diff --git a/Mesh/Print_Mesh.cpp b/Mesh/Print_Mesh.cpp index 5d5b5d44f39b6cfb78eb312c40c96cb787d7eb0b..0172b891950a22699af71cb14f0f0dd82bf0ffcb 100644 --- a/Mesh/Print_Mesh.cpp +++ b/Mesh/Print_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: Print_Mesh.cpp,v 1.2 2000-11-23 14:11:35 geuzaine Exp $ */ +/* $Id: Print_Mesh.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -274,7 +274,7 @@ void process_msh_elements (Mesh * M){ fprintf (mshfile, "%d\n", MSH_ELEMENT_NUM - 1); if (MSH_ELEMENT_NUM == 1) - Msg (WARNING, "No elements to save: did you forget to define Physical Entities?"); + Msg (WARNING, "No Elements to Save (Did You Forget to Define Physical Entities?)"); MSH_ADD = 1; MSH_ELEMENT_NUM = 1; @@ -526,7 +526,7 @@ int process_3D_elements (FILE * funv, Mesh * m){ sx->V[0] = sx->V[1]; sx->V[1] = temp; if (sx->Volume_Simplexe () < 0) - Msg(WARNING, "Argh... Negative Volume"); + Msg(WARNING, "Negative Volume for Simplex %d", sx->Num); } geo = v->Num; fprintf (funv, "%10d%10d%10d%10d%10d%10d\n", @@ -1014,10 +1014,11 @@ void Print_Mesh (Mesh * M, char *c, int Type){ Msg(WARNING, "Unable to Open File '%s'", name); return; } - Msg (INFOS, "Writing file %s", name); + Msg (INFOS, "Writing File '%s'", name); process_msh_nodes (M); process_msh_elements (M); Msg (INFOS, "Wrote %d Nodes, %d Elements", MSH_NODE_NUM, MSH_ELEMENT_NUM - 1); + Msg (INFO, "Wrote File '%s'", name); fclose (mshfile); } else if (Type == FORMAT_UNV){ @@ -1027,7 +1028,7 @@ void Print_Mesh (Mesh * M, char *c, int Type){ Msg(WARNING, "Unable to Open File '%s'", name); return; } - Msg (INFOS, "Writing file %s", name); + Msg (INFOS, "Writing File '%s'", name); process_nodes (unvfile, M); fprintf (unvfile, "%6d\n", -1); fprintf (unvfile, "%6d\n", ELEMENTS); @@ -1038,6 +1039,7 @@ void Print_Mesh (Mesh * M, char *c, int Type){ fprintf (unvfile, "%6d\n", -1); PrintGroups (M); fclose (unvfile); + Msg (INFO, "Wrote File '%s'", name); } else if (Type == FORMAT_GREF){ c ? strcpy (name, c) : strcat (name, ".Gref"); @@ -1048,7 +1050,7 @@ void Print_Mesh (Mesh * M, char *c, int Type){ Msg(WARNING, "Unable to Open File '%s'", name); return; } - Msg (INFOS, "Writing file %s", name); + Msg (INFOS, "Writing File '%s'", name); process_Gref_nodes (Greffile, M, TRN, TRE); process_Gref_elements (Greffile, M, Tree_Nbr (TRN)); process_Gref_poundarybonditions (Greffile, M, TRN, TRE); @@ -1056,5 +1058,6 @@ void Print_Mesh (Mesh * M, char *c, int Type){ Tree_Delete (TRN); Tree_Delete (TRE); EndConsecutiveNodes (M); + Msg (INFO, "Wrote File '%s'", name); } } diff --git a/Mesh/Simplex.cpp b/Mesh/Simplex.cpp index feca506c42aaacc0b7e6369a09e9e6b2220680e8..3e3ecd85779cde1c6e3a8f054c116adde80e9a1b 100644 --- a/Mesh/Simplex.cpp +++ b/Mesh/Simplex.cpp @@ -1,4 +1,4 @@ -/* $Id: Simplex.cpp,v 1.4 2000-11-23 17:16:38 geuzaine Exp $ */ +/* $Id: Simplex.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -49,7 +49,7 @@ int Simplex:: CircumCircle (double x1, double y1, d = 2. * (double) (y1 * (x2 - x3) + y2 * (x3 - x1) + y3 * (x1 - x2)); if (d == 0.0){ *xc = *yc = -99999.; - Msg(WARNING, "Degenerated Simplex"); + Msg(WARNING, "Deganarated Simplex"); return 0; } diff --git a/Mesh/SwapEdge.cpp b/Mesh/SwapEdge.cpp index c787420ef36b47faeaed2ab448e91eba874d6c5f..2122f7a39cdc98782b0930bc764b478edacaa1b4 100644 --- a/Mesh/SwapEdge.cpp +++ b/Mesh/SwapEdge.cpp @@ -1,4 +1,4 @@ -/* $Id: SwapEdge.cpp,v 1.2 2000-11-23 14:11:36 geuzaine Exp $ */ +/* $Id: SwapEdge.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -157,7 +157,7 @@ bool FindBestPattern (int N, Vertex * Contour[100], Vertex * Ed[2], worst_tet_new = DMIN (worst_tet_new, s->GammaShapeMeasure ()); } if (fabs (new_volume - old_volume) > 1.e-5 * fabs (new_volume + old_volume)) - Msg(INFO, "Edge swapping failed"); + Msg(WARNING, "Edge Swapping Failed"); if (fabs (new_volume - old_volume) > 1.e-5 * fabs (new_volume + old_volume) || worst_tet_new < worst_tet_old){ for (k = 0; k < 2 * sp->GetNbTriangles (); k++){ diff --git a/Unix/CbContext.cpp b/Unix/CbContext.cpp index 16359dde1d352ced6e747e50bfa4738b91bf407f..e65c53d16dd6ebca678d564cfeef06ee5e15e0d9 100644 --- a/Unix/CbContext.cpp +++ b/Unix/CbContext.cpp @@ -1,4 +1,4 @@ -/* $Id: CbContext.cpp,v 1.2 2000-11-23 14:11:40 geuzaine Exp $ */ +/* $Id: CbContext.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -23,7 +23,7 @@ static char *txt_new [] = { "Parameter", "Point", "Line", "Spline", "Bezier", "BSpline", "Circle", "Ellipsis", "Plane Surface", "Ruled Surface", "Nurbs Surface", "Volume", NULL }; -static char *txt_translate_rotate_dilate_symetry_delete [] = +static char *txt_translate_rotate_dilate_symmetry_delete [] = { "Point", "Line", "Surface", NULL }; static char *txt_add [] = @@ -176,25 +176,25 @@ void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data){ case CONTEXT_GEOM_ELEM_ADD_TRANSLATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Add Translate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_ADD_ROTATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Add Rotate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_ADD_DILATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Add Dilate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; - case CONTEXT_GEOM_ELEM_ADD_SYMETRY : + case CONTEXT_GEOM_ELEM_ADD_SYMMETRY : actual_global_context = CONTEXT_GEOM; - Msg(INFO, "Elementary Add Symetry"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + Msg(INFO, "Elementary Add Symmetry"); + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_MOVE : @@ -206,25 +206,25 @@ void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data){ case CONTEXT_GEOM_ELEM_MOVE_TRANSLATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Move Translate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_MOVE_ROTATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Move Rotate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_MOVE_DILATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Move Dilate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; - case CONTEXT_GEOM_ELEM_MOVE_SYMETRY : + case CONTEXT_GEOM_ELEM_MOVE_SYMMETRY : actual_global_context = CONTEXT_GEOM; - Msg(INFO, "Elementary Move Symetry"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + Msg(INFO, "Elementary Move Symmetry"); + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_EXTRUDE : @@ -236,31 +236,31 @@ void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data){ case CONTEXT_GEOM_ELEM_EXTRUDE_TRANSLATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Extrude Translate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_EXTRUDE_ROTATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Extrude Rotate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_EXTRUDE_DILATE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Extrude Dilate"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; - case CONTEXT_GEOM_ELEM_EXTRUDE_SYMETRY : + case CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY : actual_global_context = CONTEXT_GEOM; - Msg(INFO, "Elementary Extrude Symetry"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + Msg(INFO, "Elementary Extrude Symmetry"); + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_ELEM_DELETE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Elementary Delete"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_GEOM_PHYS : @@ -279,7 +279,7 @@ void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data){ case CONTEXT_GEOM_PHYS_DELETE : actual_global_context = CONTEXT_GEOM; Msg(INFO, "Physical Delete"); - ButtonText = txt_translate_rotate_dilate_symetry_delete; + ButtonText = txt_translate_rotate_dilate_symmetry_delete; break; case CONTEXT_MESH : @@ -303,7 +303,7 @@ void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data){ return; default : - Msg(WARNING, "Unknown Event in ActualizeContextCb : %d", actual_context); + Msg(WARNING, "Unknown Event in ActualizeContextCb (%d)", actual_context); return; } @@ -374,7 +374,7 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_DILATE,call_data); break; case 5: - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_SYMETRY,call_data); + ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_SYMMETRY,call_data); break; } break; @@ -421,8 +421,8 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ } break; - case CONTEXT_GEOM_ELEM_ADD_SYMETRY : - Msg(WARNING, "CONTEXT_GEOM_ELEM_ADD_SYMETRY not done yet!"); + case CONTEXT_GEOM_ELEM_ADD_SYMMETRY : + Msg(WARNING, "Add Symmetry not done yet"); break; case CONTEXT_GEOM_ELEM_MOVE : @@ -440,7 +440,7 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE_DILATE,call_data); break; case 4: - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE_SYMETRY,call_data); + ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE_SYMMETRY,call_data); break; } break; @@ -470,8 +470,8 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ } break; - case CONTEXT_GEOM_ELEM_MOVE_SYMETRY : - Msg(WARNING, "CONTEXT_GEOM_ELEM_MOVE_SYMETRY not done yet!"); + case CONTEXT_GEOM_ELEM_MOVE_SYMMETRY : + Msg(WARNING, "Move Symmetry not done yet"); break; case CONTEXT_GEOM_ELEM_EXTRUDE : @@ -489,7 +489,7 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_DILATE,call_data); break; case 4: - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_SYMETRY,call_data); + ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY,call_data); break; } break; @@ -511,11 +511,11 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ break; case CONTEXT_GEOM_ELEM_EXTRUDE_DILATE : - Msg(WARNING, "CONTEXT_GEOM_ELEM_EXTRUDE_DILATE not done yet!"); + Msg(WARNING, "Extrude Dilate not done yet!"); break; - case CONTEXT_GEOM_ELEM_EXTRUDE_SYMETRY : - Msg(WARNING, "CONTEXT_GEOM_ELEM_EXTRUDE_SYMETRY not done yet!"); + case CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY : + Msg(WARNING, "Extrude Symmetry not done yet!"); break; case CONTEXT_GEOM_ELEM_DELETE : @@ -580,7 +580,7 @@ void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ break; default : - Msg(WARNING, "Unknown Context in NextContextCb : %d", actual_global_context); + Msg(WARNING, "Unknown Context in NextContextCb (%d)", actual_global_context); break; } diff --git a/Unix/CbContext.h b/Unix/CbContext.h index f608a2aa602c652d7000379aaf64f6e8d892e76a..b1887b4b35ff1953e5f26d87cabcd9130f4139f6 100644 --- a/Unix/CbContext.h +++ b/Unix/CbContext.h @@ -1,4 +1,4 @@ -/* $Id: CbContext.h,v 1.2 2000-11-23 14:11:40 geuzaine Exp $ */ +/* $Id: CbContext.h,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #ifndef _CB_CONTEXT_H_ #define _CB_CONTEXT_H_ @@ -9,17 +9,17 @@ #define CONTEXT_GEOM_ELEM_ADD_TRANSLATE 105 #define CONTEXT_GEOM_ELEM_ADD_ROTATE 106 #define CONTEXT_GEOM_ELEM_ADD_DILATE 107 -#define CONTEXT_GEOM_ELEM_ADD_SYMETRY 108 +#define CONTEXT_GEOM_ELEM_ADD_SYMMETRY 108 #define CONTEXT_GEOM_ELEM_MOVE 109 #define CONTEXT_GEOM_ELEM_MOVE_TRANSLATE 110 #define CONTEXT_GEOM_ELEM_MOVE_ROTATE 111 #define CONTEXT_GEOM_ELEM_MOVE_DILATE 112 -#define CONTEXT_GEOM_ELEM_MOVE_SYMETRY 113 +#define CONTEXT_GEOM_ELEM_MOVE_SYMMETRY 113 #define CONTEXT_GEOM_ELEM_EXTRUDE 114 #define CONTEXT_GEOM_ELEM_EXTRUDE_TRANSLATE 115 #define CONTEXT_GEOM_ELEM_EXTRUDE_ROTATE 116 #define CONTEXT_GEOM_ELEM_EXTRUDE_DILATE 117 -#define CONTEXT_GEOM_ELEM_EXTRUDE_SYMETRY 118 +#define CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY 118 #define CONTEXT_GEOM_ELEM_DELETE 119 #define CONTEXT_GEOM_PHYS 120 #define CONTEXT_GEOM_PHYS_ADD 121 diff --git a/Unix/CbFile.cpp b/Unix/CbFile.cpp index 8d13a5b33029e2718bd99a7877bfd9f65df46d3d..4052c4c6bf7e48fb4067835f1c6752d7a8db4d69 100644 --- a/Unix/CbFile.cpp +++ b/Unix/CbFile.cpp @@ -1,4 +1,4 @@ -/* $Id: CbFile.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: CbFile.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include <unistd.h> @@ -50,7 +50,7 @@ void SaveToDisk (char *FileName, Widget warning, } if(!(fp = fopen(KeepFileName,"w"))) { - Msg(WARNING, "Unable to open file '%s'", KeepFileName); + Msg(WARNING, "Unable to Open File '%s'", KeepFileName); WARNING_OVERRIDE = 0; return; } @@ -81,18 +81,18 @@ void CreateImage (FILE *fp) { Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), tmp); fclose(tmp); sprintf(cmd, "xpr -device ps -gray 4 %s >%s", tmpFileName, KeepFileName); - Msg(INFOS, "Executing: %s\n", cmd); + Msg(INFOS, "Executing '%s'", cmd); system(cmd); unlink(tmpFileName); break; } - Msg(INFOS, "X image dump complete: '%s'", KeepFileName); + Msg(INFOS, "X Image Dump Complete '%s'", KeepFileName); break ; case PRINT_GL2GIF : create_gif(fp, CTX.viewport[2]-CTX.viewport[0], CTX.viewport[3]-CTX.viewport[1]); - Msg(INFOS, "GIF dump complete: '%s'", KeepFileName); + Msg(INFOS, "GIF Dump Complete '%s'", KeepFileName); break; case PRINT_GL2PS_SIMPLE : @@ -111,11 +111,11 @@ void CreateImage (FILE *fp) { CTX.stream = TO_SCREEN ; res = gl2psEndPage(); } - Msg(INFOS, "GL2PS postscript output complete: '%s'", KeepFileName); + Msg(INFOS, "GL2PS Output Complete '%s'", KeepFileName); break; default : - Msg(WARNING, "Unknown print type"); + Msg(WARNING, "Unknown Print Type"); break; } @@ -146,7 +146,9 @@ void FileCb(Widget w, XtPointer client_data, XtPointer call_data){ case FILE_SAVE_MESH_AS : Print_Mesh(&M, c, CTX.mesh.format); break; case FILE_SAVE_COLORTABLE_AS : SaveToDisk(c, WID.ED.saveDialog, SaveColorTable); break; case FILE_CANCEL : WARNING_OVERRIDE = 0; break; - case FILE_PRINT : SaveToDisk(c, WID.ED.printDialog, CreateImage); Init(); Draw(); break; + case FILE_PRINT : + SaveToDisk(c, WID.ED.printDialog, CreateImage); + Init(); Draw(); break; default : Msg(WARNING, "Unknown event in FileCb : %d", (long int)client_data); break; diff --git a/Unix/CbGeom.cpp b/Unix/CbGeom.cpp index ba16cd2d495a2bd7d4822e7e107f4a2883f1b886..802444e19dd69b6e979907b8148adae109a5f16a 100644 --- a/Unix/CbGeom.cpp +++ b/Unix/CbGeom.cpp @@ -1,4 +1,4 @@ -/* $Id: CbGeom.cpp,v 1.2 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: CbGeom.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -97,7 +97,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_NEW_BSPLINE : n=0; while(1){ - Msg(STATUS,"Select Point: (e) to end, (q) to quit"); + Msg(STATUS,"Select Point ('e'=end, 'q'=quit)"); ib = SelectEntity(ENT_POINT, &v,&c,&s); if(ib == 1){ /* left mouse butt */ p[n++] = v->Num; @@ -127,9 +127,9 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_NEW_CIRCLE : n=0; while(1){ - if(n == 0) Msg(STATUS,"Select Center: (q) to quit"); - if(n == 1) Msg(STATUS,"Select Starting Point: (q) to quit"); - if(n == 2) Msg(STATUS,"Select Ending Point: (q) to quit"); + if(n == 0) Msg(STATUS,"Select Center ('q'=quit)"); + if(n == 1) Msg(STATUS,"Select Starting Point ('q'=quit)"); + if(n == 2) Msg(STATUS,"Select Ending Point ('q'=quit)"); ib = SelectEntity(ENT_POINT, &v,&c,&s); if(ib == 1) { /* left mouse butt */ p[n++] = v->Num; @@ -152,10 +152,10 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_NEW_ELLIPSIS : n = 0; while(1){ - if(n == 0) Msg(STATUS,"Select Center: (q) to quit"); - if(n == 1) Msg(STATUS,"Select an Axis Point: (q) to quit"); - if(n == 2) Msg(STATUS,"Select Starting Point: (q) to quit"); - if(n == 3) Msg(STATUS,"Select Ending Point: (q) to quit"); + if(n == 0) Msg(STATUS,"Select Center ('q'=quit)"); + if(n == 1) Msg(STATUS,"Select an Axis Point ('q'=quit)"); + if(n == 2) Msg(STATUS,"Select Starting Point ('q'=quit)"); + if(n == 3) Msg(STATUS,"Select Ending Point ('q'=quit)"); ib = SelectEntity(ENT_POINT, &v,&c,&s); if(ib == 1) { /* left mouse butt */ p[n++] = v->Num; @@ -191,7 +191,7 @@ void geom_event_handler (int event) { List_Reset(Liste2); while(1) { - Msg(STATUS,"Select Boundary: (q) to quit"); + Msg(STATUS,"Select Boundary ('q'=quit)"); ib = SelectEntity(type, &v,&c,&s); if(ib <= 0){ ZeroHighlight(&M); @@ -206,7 +206,7 @@ void geom_event_handler (int event) { List_Reset(Liste1); List_Add(Liste2,&zone); while(1){ - Msg(STATUS,"Select Holes: (q) to quit"); + Msg(STATUS,"Select Holes ('q'=quit)"); ib = SelectEntity(type, &v,&c,&s); if(ib <= 0){ ZeroHighlight(&M); @@ -245,7 +245,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_TRANSLATE_POINT : case GEOM_ELEM_MOVE_TRANSLATE_POINT : while(1){ - Msg(STATUS,"Select Point: (q) to quit"); + Msg(STATUS,"Select Point ('q'=quit)"); if(!SelectEntity(ENT_POINT, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -259,7 +259,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_TRANSLATE_LINE : case GEOM_ELEM_MOVE_TRANSLATE_LINE : while(1){ - Msg(STATUS,"Select Line: (q) to quit"); + Msg(STATUS,"Select Line ('q'=quit)"); if(!SelectEntity(ENT_LINE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -273,7 +273,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_TRANSLATE_SURF : case GEOM_ELEM_MOVE_TRANSLATE_SURF : while(1){ - Msg(STATUS,"Select Surface: (q) to quit"); + Msg(STATUS,"Select Surface ('q'=quit)"); if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -289,7 +289,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_ROTATE_POINT : case GEOM_ELEM_MOVE_ROTATE_POINT : while(1){ - Msg(STATUS,"Select Point: (q) to quit"); + Msg(STATUS,"Select Point ('q'=quit)"); if(!SelectEntity(ENT_POINT, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -303,7 +303,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_ROTATE_LINE : case GEOM_ELEM_MOVE_ROTATE_LINE : while(1){ - Msg(STATUS,"Select Line: (q) to quit"); + Msg(STATUS,"Select Line ('q'=quit)"); if(!SelectEntity(ENT_LINE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -317,7 +317,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_ROTATE_SURF : case GEOM_ELEM_MOVE_ROTATE_SURF : while(1){ - Msg(STATUS,"Select Surface: (q) to quit"); + Msg(STATUS,"Select Surface ('q'=quit)"); if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -334,7 +334,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_EXTRUDE_TRANSLATE_POINT : case GEOM_ELEM_EXTRUDE_ROTATE_POINT : while(1){ - Msg(STATUS,"Select Point: (q) to quit"); + Msg(STATUS,"Select Point ('q'=quit)"); if(!SelectEntity(ENT_POINT, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -350,7 +350,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_EXTRUDE_TRANSLATE_LINE : case GEOM_ELEM_EXTRUDE_ROTATE_LINE : while(1){ - Msg(STATUS,"Select Line: (q) to quit"); + Msg(STATUS,"Select Line ('q'=quit)"); if(!SelectEntity(ENT_LINE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -366,7 +366,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_EXTRUDE_TRANSLATE_SURF : case GEOM_ELEM_EXTRUDE_ROTATE_SURF : while(1){ - Msg(STATUS,"Select Surface: (q) to quit"); + Msg(STATUS,"Select Surface ('q'=quit)"); if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -384,7 +384,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_DILATE_POINT : case GEOM_ELEM_MOVE_DILATE_POINT : while(1){ - Msg(STATUS,"Select Point: (q) to quit"); + Msg(STATUS,"Select Point ('q'=quit)"); if(!SelectEntity(ENT_POINT, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -398,7 +398,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_DILATE_LINE : case GEOM_ELEM_MOVE_DILATE_LINE : while(1){ - Msg(STATUS,"Select Line: (q) to quit"); + Msg(STATUS,"Select Line ('q'=quit)"); if(!SelectEntity(ENT_LINE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -412,7 +412,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_ADD_DILATE_SURF : case GEOM_ELEM_MOVE_DILATE_SURF : while(1){ - Msg(STATUS,"Select Surface: (q) to quit"); + Msg(STATUS,"Select Surface ('q'=quit)"); if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -429,7 +429,7 @@ void geom_event_handler (int event) { case GEOM_ELEM_DELETE_POINT : while(1){ - Msg(STATUS,"Select Point: (q) to quit"); + Msg(STATUS,"Select Point ('q'=quit)"); if(!SelectEntity(ENT_POINT, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -442,7 +442,7 @@ void geom_event_handler (int event) { break; case GEOM_ELEM_DELETE_LINE : while(1){ - Msg(STATUS,"Select Line: (q) to quit"); + Msg(STATUS,"Select Line ('q'=quit)"); if(!SelectEntity(ENT_LINE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -455,7 +455,7 @@ void geom_event_handler (int event) { break; case GEOM_ELEM_DELETE_SURF : while(1){ - Msg(STATUS,"Select Point: (q) to quit"); + Msg(STATUS,"Select Point ('q'=quit)"); if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ ZeroHighlight(&M); Replot(); @@ -482,15 +482,15 @@ void geom_event_handler (int event) { while(1){ switch(event){ case GEOM_PHYS_ADD_POINT: - Msg(STATUS,"Select Point: (e) to end, (q) to quit"); + Msg(STATUS,"Select Point ('e'=end, 'q'=quit)"); type = 0; break; case GEOM_PHYS_ADD_LINE: - Msg(STATUS,"Select Line: (e) to end, (q) to quit"); + Msg(STATUS,"Select Line ('e'=end, 'q'=quit)"); type = 1; break; case GEOM_PHYS_ADD_SURF: - Msg(STATUS,"Select Surface: (e) to end, (q) to quit"); + Msg(STATUS,"Select Surface ('e'=end, 'q'=quit)"); type = 2; break; } @@ -524,11 +524,11 @@ void geom_event_handler (int event) { case GEOM_PHYS_DELETE_SURF : case GEOM_PHYS_DELETE_VOLUME : case GEOM_ELEM_ADD_NEW_NURBS_SURF : - Msg(WARNING, "Not done interactively yet. Sorry!"); + Msg(WARNING, "Not done yet"); break; default : - Msg(WARNING, "Unknown event in geom_event_handler"); + Msg(WARNING, "Unknown Event in geom_event_handler"); break; } @@ -569,7 +569,7 @@ void GeomCb (Widget w, XtPointer client_data, XtPointer call_data){ case GEOM_DILAT_F : strcpy(df_text,XmTextGetString(w)); break; default : - Msg(WARNING, "Unknown value in GeomCb : %d", (long int)client_data); + Msg(WARNING, "Unknown Value in GeomCb (%d)", (long int)client_data); break; } diff --git a/Unix/CbInput.cpp b/Unix/CbInput.cpp index 5df2837fd90c491d7469dfd61321031a3043b244..fc8a1fa145af6ebf5d9648367f6ea5ad120a94a6 100644 --- a/Unix/CbInput.cpp +++ b/Unix/CbInput.cpp @@ -1,4 +1,4 @@ -/* $Id: CbInput.cpp,v 1.2 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: CbInput.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -203,8 +203,8 @@ void KeyboardAccel(XEvent *event){ break; case XK_h : case XK_H : CTX.geom.highlight = !CTX.geom.highlight; - CTX.geom.highlight ? Msg(INFOS, "Highlight enabled") : - Msg(INFOS, "Highlight disabled"); + CTX.geom.highlight ? Msg(INFOS, "Highlight Enabled") : + Msg(INFOS, "Highlight Disabled"); break; case XK_c : case XK_C : if(CTX.color.id==0) InitColors(&CTX.color,1); diff --git a/Unix/CbMesh.cpp b/Unix/CbMesh.cpp index 7d24c936833d40f7b9ea25b77a1d0dadc8d9e234..3d8e18c98b75069cbd6ba5e8c2c8068b8af14899 100644 --- a/Unix/CbMesh.cpp +++ b/Unix/CbMesh.cpp @@ -1,4 +1,4 @@ -/* $Id: CbMesh.cpp,v 1.3 2000-11-23 15:06:03 geuzaine Exp $ */ +/* $Id: CbMesh.cpp,v 1.4 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -134,7 +134,7 @@ void mesh_event_handler (int event) { case MESH_DEFINE_CHAR_LENGTH : n=0; while(1){ - Msg(STATUS,"Select Point: (e) to end, (q) to quit"); + Msg(STATUS,"Select Point ('e'=end, 'q'=quit)"); ib = SelectEntity(ENT_POINT, &v,&c,&s); if(ib == 1){ /* left mouse butt */ p[n++] = v->Num; @@ -159,7 +159,7 @@ void mesh_event_handler (int event) { case MESH_DEFINE_RECOMBINE : n=0; while(1){ - Msg(STATUS,"Select Surface: (e) to end, (q) to quit"); + Msg(STATUS,"Select Surface ('e'=end, 'q'=quit)"); ib = SelectEntity(ENT_SURFACE, &v,&c,&s); if(ib == 1){ /* left mouse butt */ p[n++] = s->Num; @@ -188,11 +188,11 @@ void mesh_event_handler (int event) { while(1){ switch (event) { case MESH_DEFINE_TRSF_LINE : - Msg(STATUS,"Select Line: (e) to end, (q) to quit"); + Msg(STATUS,"Select Line ('e'=end, 'q'=quit)"); ib = SelectEntity(ENT_LINE, &v,&c,&s); break ; case MESH_DEFINE_TRSF_SURFACE : - Msg(STATUS,"Select Surface: (e) to end, (q) to quit"); + Msg(STATUS,"Select Surface ('e'=end, 'q'=quit)"); ib = SelectEntity(ENT_SURFACE, &v,&c,&s); break; case MESH_DEFINE_TRSF_VOLUME : @@ -205,7 +205,7 @@ void mesh_event_handler (int event) { case MESH_DEFINE_TRSF_SURFACE : p[n++] = s->Num; case MESH_DEFINE_TRSF_VOLUME : while(1){ - Msg(STATUS,"Select Point: (e) to end, (q) to quit"); + Msg(STATUS,"Select Point ('e'=end, 'q'=quit)"); ib = SelectEntity(ENT_POINT, &v,&c,&s); if(ib == 1){ /* left mouse butt */ p[n++] = v->Num ; @@ -260,11 +260,11 @@ void mesh_event_handler (int event) { case MESH_DEFINE_ATTRACTOR_POINT : case MESH_DEFINE_ATTRACTOR_LINE : case MESH_DEFINE_ATTRACTOR_SURFACE : - Msg(WARNING, "Interactive Attractor Definition not Done..."); + Msg(WARNING, "Interactive Attractor Definition not done yet"); break ; default : - Msg(WARNING, "Unkown event in mesh_event_handler"); + Msg(WARNING, "Unkown Event in mesh_event_handler"); break; } @@ -291,7 +291,7 @@ void MeshCb (Widget w, XtPointer client_data, XtPointer call_data){ case MESH_ATTRACTOR_Y : strcpy(attry_text,XmTextGetString(w)); break; case MESH_ATTRACTOR_Z : strcpy(attrz_text,XmTextGetString(w)); break; default : - Msg(WARNING, "Unknown value in MeshCb : %d", (long int)client_data); + Msg(WARNING, "Unknown Event in MeshCb (%d)", (long int)client_data); break; } diff --git a/Unix/CbOptions.cpp b/Unix/CbOptions.cpp index 352c1724dad5b7a12c0bb91781ffb36e3ba9e99f..a12df68460c1196e0d64739041a7e3f452cc8b84 100644 --- a/Unix/CbOptions.cpp +++ b/Unix/CbOptions.cpp @@ -1,4 +1,4 @@ -/* $Id: CbOptions.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: CbOptions.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -29,7 +29,7 @@ extern Mesh M; extern Tree_T *EntitesVisibles; extern double LC; -int SHOW_ALL_ENTITIES ; +int SHOW_ALL_ENTITIES, SELECT_BY_NUMBER=OPTIONS_MESH_SELECT_ENTITY ; static int stop_anim ; static long anim_time ; @@ -248,6 +248,8 @@ void OptionsCb (Widget w, XtPointer client_data, XtPointer call_data){ case OPTIONS_MESH_ABORT : CancelMeshThread(); break; + case OPTIONS_MESH_SELECT_ENTITY : SELECT_BY_NUMBER = OPTIONS_MESH_SELECT_ENTITY; break; + case OPTIONS_MESH_SELECT_QUALITY : SELECT_BY_NUMBER = OPTIONS_MESH_SELECT_QUALITY; break; /* post */ @@ -286,22 +288,26 @@ void OptionsCb (Widget w, XtPointer client_data, XtPointer call_data){ /* mesh + geom : a changer...*/ case OPTIONS_GEOM_HIDE_SHOW : + SELECT_BY_NUMBER=OPTIONS_MESH_SELECT_ENTITY; + /* Fal-through */ case OPTIONS_MESH_HIDE_SHOW : c = XmTextGetString(w); - if (!strcmp(c,"all") || !strcmp(c,"*")){ - if(SHOW_ALL_ENTITIES){ - RemplirEntitesVisibles(0); SHOW_ALL_ENTITIES = 0; + if(SELECT_BY_NUMBER == OPTIONS_MESH_SELECT_ENTITY){ + if (!strcmp(c,"all") || !strcmp(c,"*")){ + if(SHOW_ALL_ENTITIES){ RemplirEntitesVisibles(0); SHOW_ALL_ENTITIES = 0; } + else { RemplirEntitesVisibles(1); SHOW_ALL_ENTITIES = 1; } } - else { - RemplirEntitesVisibles(1); SHOW_ALL_ENTITIES = 1; + else{ + i = atoi(c); + if(EntiteEstElleVisible(i)) ToutesLesEntitesRelatives(i,EntitesVisibles,0); + else ToutesLesEntitesRelatives(i,EntitesVisibles,1); } } else{ - i = atoi(c); - if(EntiteEstElleVisible(i)) - ToutesLesEntitesRelatives(i,EntitesVisibles,0); + if (!strcmp(c,"all") || !strcmp(c,"*")) + CTX.mesh.limit_gamma = 0.0 ; else - ToutesLesEntitesRelatives(i,EntitesVisibles,1); + CTX.mesh.limit_gamma = atof(c); } break; diff --git a/Unix/CbOptions.h b/Unix/CbOptions.h index 19074b66df28fc5b51dc28069a5f16d74cd21936..bc08648dec2ed0d19c050b29ffadfde05f2f4b75 100644 --- a/Unix/CbOptions.h +++ b/Unix/CbOptions.h @@ -1,4 +1,4 @@ -/* $Id: CbOptions.h,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: CbOptions.h,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #ifndef _CB_OPTIONS_H_ #define _CB_OPTIONS_H_ @@ -83,6 +83,8 @@ #define OPTIONS_MESH_INTERACTIVE 222 #define OPTIONS_MESH_VISIBILITY_ENTITY 223 #define OPTIONS_MESH_VISIBILITY_NUMBER 224 +#define OPTIONS_MESH_SELECT_ENTITY 225 +#define OPTIONS_MESH_SELECT_QUALITY 226 /* options post */ diff --git a/Unix/CbPost.cpp b/Unix/CbPost.cpp index c35f050625e7071a47a3d1a554a5c002a56d3d79..e890de3b847cc1a43874bf7c69be376d9a8ad285 100644 --- a/Unix/CbPost.cpp +++ b/Unix/CbPost.cpp @@ -1,4 +1,4 @@ -/* $Id: CbPost.cpp,v 1.2 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: CbPost.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -130,7 +130,7 @@ void DuplicateViewCb (Widget w, XtPointer client_data, XtPointer call_data){ void SaveColorTable(FILE *fp){ if(!CurrentView){ - Msg(WARNING, "No View to get Color Information from"); + Msg(WARNING, "No View to get Color Information From"); } else{ save_color_table(fp, &CurrentView->CT); @@ -300,7 +300,7 @@ void PostDialogCb (Widget w, XtPointer client_data, XtPointer call_data){ break; default: - Msg(WARNING, "Unknown event in PostDialogCb : %d", (long int)client_data); + Msg(WARNING, "Unknown Event in PostDialogCb (%d)", (long int)client_data); break; } } @@ -416,7 +416,7 @@ void PostCb (Widget w, XtPointer client_data, XtPointer call_data){ v = ViewForDialog[POST_VECTOR]; break; default : - Msg(WARNING, "Unknown event in PostCb"); + Msg(WARNING, "Unknown Event in PostCb"); break; } ChangeViewParam(v, client_data, call_data); @@ -661,7 +661,7 @@ void ChangeViewParam (Post_View *v, XtPointer client_data, XtPointer call_data){ break; default: - Msg(WARNING, "Unknown event in PostCb : %d", (long int)client_data); + Msg(WARNING, "Unknown Event in PostCb (%d)", (long int)client_data); break; } diff --git a/Unix/Main.cpp b/Unix/Main.cpp index 7c0348219eb3b0ca5feb2b2c1e96ad5a05b01045..31a42865cdcd8972284cd7e55bb8f20e647c7662 100644 --- a/Unix/Main.cpp +++ b/Unix/Main.cpp @@ -1,4 +1,4 @@ -/* $Id: Main.cpp,v 1.5 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: Main.cpp,v 1.6 2000-11-23 23:20:35 geuzaine Exp $ */ #include <signal.h> @@ -39,6 +39,40 @@ char gmsh_host[] = "Build Host : " GMSH_HOST ; char gmsh_packager[] = "Packager : " GMSH_PACKAGER ; char gmsh_email[] = "E-Mail : " GMSH_EMAIL ; char gmsh_url[] = "URL : " GMSH_URL ; +char gmsh_help[] = + "Usage: %s [options] [files]\n" + "Mesh options:\n" + " -0 parse input and exit\n" + " -1, -2, -3 batch 1-, 2- or 3-dimensional mesh\n" + " -format msh|unv mesh format (default: msh)\n" + " -algo iso|aniso mesh algorithm (default: iso)\n" + " -smooth int mesh smoothing (default: 0)\n" + " -degree int mesh degree (default: 1)\n" + " -scale float scaling factor (default: 1.0)\n" + " -bgm file load backround mesh from file\n" + " -interactive display the mesh construction\n" + "Post Processing options:\n" + " -dl enable display lists\n" + " -noview hide all views at startup\n" + "Display options:\n" + " -nodb no double buffer\n" + " -noov no overlay visual\n" + " -alpha enable alpha blending\n" + " -visinfo show visual information at startup\n" + " -geometry geom specify main window geometry\n" + " -viewport 9*float specify rotation, translation and scale\n" + " -display disp specify display\n" + " -perspective perspective instead of orthographic projection\n" + " -flash allow colormap flashing\n" + " -samevisual force same visual for OpenGL and GUI\n" + "Other options:\n" + " -v int set verbosity level (default: 2)\n" + " -threads enable threads\n" + " -path string path for included files\n" + " -version show version number\n" + " -info show detailed version information\n" + " -help show this message\n" + ; char *TheFileNameTab[MAX_OPEN_FILES], *TheBgmFileName=NULL; char ThePathForIncludes[NAME_STR_L]; @@ -56,7 +90,7 @@ void ParseFile(char *f){ yylineno=1; if(!(yyin = fopen(yyname,"r"))){ - Msg(INFO, "File '%s' dos not exist", f); + Msg(INFO, "File '%s' Does not Exist", f); return; } @@ -75,7 +109,7 @@ void ParseFile(char *f){ load_color_table(yyin, &v->CT); } else{ - Msg(WARNING, "No Post-Processing View available to set Colors"); + Msg(WARNING, "No Post-Processing View Available to set Colors From"); } } else{ @@ -87,7 +121,7 @@ void ParseFile(char *f){ extern int SHOW_ALL_ENTITIES ; void MergeProblem(char *name){ - Msg(INFOS, "Merging %s",name); + Msg(INFOS, "Merging '%s'",name); ParseFile(name); if (yyerrorstate) return; @@ -126,7 +160,7 @@ void OpenProblem(char *name){ XmNiconName, TheBaseFileName, NULL); - Msg(INFOS, "Opening %s", TheFileName); + Msg(INFOS, "Opening '%s'", TheFileName); ParseFile(TheFileName); @@ -149,7 +183,7 @@ void OpenProblem(char *name){ void Get_Options (int argc, char *argv[], int *nbfiles) { int i=1; - + TheFileNameTab[0] = "unnamed.geo" ; *nbfiles = 0; @@ -218,12 +252,12 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { if(argv[i]!=NULL){ CTX.mesh.degree = atoi(argv[i]); i++; if(CTX.mesh.degree != 1 || CTX.mesh.degree != 2){ - fprintf(stderr, "Error: Wrong degree\n"); + fprintf(stderr, ERROR_STR "Wrong degree\n"); exit(1); } } else { - fprintf(stderr, "Error: Missing Number\n"); + fprintf(stderr, ERROR_STR "Missing Number\n"); exit(1); } } @@ -247,13 +281,13 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { CTX.mesh.format = FORMAT_GREF ; } else{ - fprintf(stderr, "Error: Unknown mesh format\n"); + fprintf(stderr, ERROR_STR "Unknown mesh format\n"); exit(1); } i++; } else { - fprintf(stderr, "Error: Missing format\n"); + fprintf(stderr, ERROR_STR "Missing format\n"); exit(1); } } @@ -265,13 +299,13 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { else if(!strcmp(argv[i],"aniso")) CTX.mesh.algo = DELAUNAY_NEWALGO ; else{ - fprintf(stderr, "Error: Unknown mesh algorithm\n"); + fprintf(stderr, ERROR_STR "Unknown mesh algorithm\n"); exit(1); } i++; } else { - fprintf(stderr, "Error: Missing algorithm\n"); + fprintf(stderr, ERROR_STR "Missing algorithm\n"); exit(1); } } @@ -352,25 +386,37 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { CTX.verbosity = atoi(argv[i]); i++; } else { - fprintf(stderr, "Error: Missing Number\n"); + fprintf(stderr, ERROR_STR "Missing Number\n"); exit(1); } } else if(!strcmp(argv[i]+1, "version") || !strcmp(argv[i]+1, "-version")){ - Info(2,argv[0]); + fprintf(stderr, "%g\n", GMSH_VERSION); + exit(1); } else if(!strcmp(argv[i]+1, "info") || !strcmp(argv[i]+1, "-info")){ - Info(1,argv[0]); + fprintf(stderr, "%s%g\n", gmsh_version, GMSH_VERSION); + fprintf(stderr, "%s\n", gmsh_os); + fprintf(stderr, "%s\n", gmsh_date); + fprintf(stderr, "%s\n", gmsh_host); + fprintf(stderr, "%s\n", gmsh_packager); + fprintf(stderr, "%s\n", gmsh_email); + fprintf(stderr, "%s\n", gmsh_url); + exit(1) ; } else if(!strcmp(argv[i]+1, "help") || !strcmp(argv[i]+1, "-help")){ - Info(0,argv[0]); + fprintf(stderr, "%s\n", gmsh_progname); + fprintf(stderr, "%s\n", gmsh_copyright); + fprintf(stderr, gmsh_help, argv[0]); + exit(1); } else{ - fprintf(stderr, "Warning: Unknown option '%s'\n", argv[i]); - Info(0,argv[0]); + fprintf(stderr, "Unknown option '%s'\n", argv[i]); + fprintf(stderr, gmsh_help, argv[0]); + exit(1); } } @@ -378,7 +424,7 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { if(*nbfiles < MAX_OPEN_FILES) TheFileNameTab[(*nbfiles)++] = argv[i++]; else{ - fprintf(stderr, "Error: Too many input files\n"); + fprintf(stderr, ERROR_STR "Too many input files\n"); exit(1); } } @@ -416,6 +462,8 @@ int main(int argc, char *argv[]){ Get_Options(argc, argv, &nbf); + Msg(INFOS, "%s %g", gmsh_progname, GMSH_VERSION); + /* Initialize the static Mesh */ M.Vertices = NULL ; @@ -454,7 +502,7 @@ int main(int argc, char *argv[]){ Create_BgMesh(TYPBGMESH,.2,THEM); } else{ - Msg(ERROR, "Invalid background mesh (no view)"); + Msg(ERROR, "Invalid Background Mesh (no View)"); } } if(CTX.interactive > 0){ @@ -483,7 +531,7 @@ int main(int argc, char *argv[]){ #ifndef _NOTHREADS if(CTX.threads){ if(!XInitThreads()){ - Msg(WARNING, "Xlib is not thread safe: reverting to '-nothreads'"); + Msg(WARNING, "Xlib is not Thread Safe (Reverting to '-nothreads')"); CTX.threads = 0; } } @@ -498,7 +546,7 @@ int main(int argc, char *argv[]){ #ifndef _NOTHREADS if(CTX.threads){ if(!XtToolkitThreadInitialize()){ - Msg(WARNING, "Xtoolkit is not thread safe: reverting to '-nothreads'"); + Msg(WARNING, "Xtoolkit is not Thread Safe (Reverting to '-nothreads')"); CTX.threads = 0; } } @@ -516,15 +564,15 @@ int main(int argc, char *argv[]){ NULL, 0, &argc, argv); if(!XCTX.display) - Msg(ERROR, "Unable to open the specified display. Set the `DISPLAY'\n" - " environment variable properly or use the `xhost' command\n" - " to authorize access to the display"); + Msg(FATAL, "Unable to open the specified display. Set the `DISPLAY'\n" + WHITE_STR "environment variable properly or use the `xhost' command\n" + WHITE_STR "to authorize access to the display"); /* Check for GLX extension; for Mesa, this is always OK */ if(!glXQueryExtension(XCTX.display,NULL,NULL)) - Msg(ERROR, "The specified display does not support the OpenGL extension (GLX).\n" - " You may consider using Mesa instead"); + Msg(FATAL, "The specified display does not support the OpenGL extension (GLX).\n" + WHITE_STR "You may consider using Mesa instead"); /* Init with default screen num and default depth */ @@ -540,7 +588,7 @@ int main(int argc, char *argv[]){ if(CTX.db){ if(!(XCTX.glw.visinfo = glXChooseVisual(XCTX.display,XCTX.scrnum, glw_attrib_db))){ - Msg(WARNING,"GBA double buffured visual not available"); + Msg(WARNING,"GBA Double Buffured Visual not Available"); CTX.db = 0; } } @@ -548,10 +596,10 @@ int main(int argc, char *argv[]){ if(!CTX.db){ if(!(XCTX.glw.visinfo = glXChooseVisual(XCTX.display,XCTX.scrnum, glw_attrib_sb))) - Msg(ERROR, "RGBA single buffured visual not available"); + Msg(FATAL, "RGBA Single Buffured Visual not Available"); } - Msg(INFOS,"Visual id=%lx depth=%d screen=%d bits/rgb=%d class=%s dblbuf=%d", + Msg(DEBUG, "Visual id=%lx depth=%d screen=%d bits/rgb=%d class=%s dblbuf=%d", XCTX.glw.visinfo->visualid, XCTX.glw.visinfo->depth, XCTX.glw.visinfo->screen, XCTX.glw.visinfo->bits_per_rgb, #if defined(__cplusplus) || defined(c_plusplus) @@ -566,7 +614,7 @@ int main(int argc, char *argv[]){ #ifndef _NOOV if(CTX.overlay){ if(!(XCTX.glo.visinfo = glXChooseVisual(XCTX.display,XCTX.scrnum,glo_attrib))){ - Msg(INFOS, "Overlay visual not available (using blend function instead)"); + Msg(DEBUG, "Overlay Visual not Available (Using Blend Function Instead)"); CTX.overlay = 0; CTX.geom.highlight = 0; } @@ -577,7 +625,7 @@ int main(int argc, char *argv[]){ #endif if(CTX.overlay){ - Msg(INFO,"Overlay Visual id=%lx depth=%d screen=%d bits/rgb=%d class=%s", + Msg(DEBUG,"Overlay Visual id=%lx depth=%d screen=%d bits/rgb=%d class=%s", XCTX.glo.visinfo->visualid, XCTX.glo.visinfo->depth, XCTX.glo.visinfo->screen, XCTX.glo.visinfo->bits_per_rgb, #if defined(__cplusplus) || defined(c_plusplus) @@ -604,21 +652,21 @@ int main(int argc, char *argv[]){ */ if(!CTX.flash && (XCTX.glw.visinfo->visual != XCTX.gui.visual)){ - Msg(INFOS,"Making another colormap for graphic window"); + Msg(DEBUG, "Making Another Colormap for Graphic Window"); XCTX.glw.colormap = XCreateColormap(XCTX.display, RootWindow(XCTX.display,XCTX.scrnum), XCTX.glw.visinfo->visual, AllocNone); if(!XCTX.glw.colormap) - Msg(ERROR, "Unable to create colormap for graphic window: Try option '-flash'"); + Msg(FATAL, "Unable to Create Colormap for Graphic Window (Try Option '-flash')"); } if(CTX.overlay){ if(!CTX.flash && (XCTX.glo.visinfo->visual != XCTX.gui.visual)){ - Msg(INFOS, "Making another colormap for overlay window"); + Msg(DEBUG, "Making Another Colormap for Overlay Window"); XCTX.glo.colormap = XCreateColormap(XCTX.display, RootWindow(XCTX.display,XCTX.scrnum), XCTX.glo.visinfo->visual, AllocNone); if(!XCTX.glo.colormap) - Msg(ERROR, "Unable to create private colormap for overlay window:\n" - " Try '-noov' and/or '-flash' options"); + Msg(FATAL, "Unable to Create Private Colormap for Overlay Window\n" + WHITE_STR "(Try '-noov' and/or '-flash' Options)"); } } @@ -646,7 +694,7 @@ int main(int argc, char *argv[]){ if (!XAllocNamedColor(XCTX.display, XCTX.glo.colormap, "white", &ov_color_def, &ov_color_exact)) { - Msg(WARNING, "Couldn't allocate white for overlay window: Reverting to '-noov'"); + Msg(WARNING, "Couldn't Allocate White for Overlay window (Reverting to '-noov')"); CTX.overlay = 0; } else @@ -656,7 +704,7 @@ int main(int argc, char *argv[]){ if(CTX.overlay){ if (!XAllocNamedColor(XCTX.display, XCTX.glo.colormap, "black", &ov_color_def, &ov_color_exact)) { - Msg(WARNING, "Couldn't allocate black for overlay window: Reverting to '-noov'"); + Msg(WARNING, "Couldn't Allocate Black for Overlay Window (Reverting to '-noov')"); CTX.overlay = 0; } else @@ -668,13 +716,11 @@ int main(int argc, char *argv[]){ XCTX.xfont.fixed = XLoadQueryFont(XCTX.display, CTX.colorbar_font_string); if(XCTX.xfont.helve == NULL){ - Msg(WARNING, "Unable to load font %s", CTX.font_string); + Msg(WARNING, "Unable to Load Font '%s'", CTX.font_string); XCTX.xfont.helve = XCTX.xfont.fixed ; } - if(XCTX.xfont.fixed == NULL){ - Msg(ERROR, "Unable to load font %s", CTX.colorbar_font_string); - exit(1); - } + if(XCTX.xfont.fixed == NULL) + Msg(FATAL, "Unable to Load Font '%s'", CTX.colorbar_font_string); XCTX.xfont.helve_h = XCTX.xfont.helve->max_bounds.ascent + XCTX.xfont.helve->max_bounds.descent; @@ -721,7 +767,7 @@ int main(int argc, char *argv[]){ /* OpenGL display list for the font */ if((CTX.font_base = glGenLists(XCTX.xfont.helve->max_char_or_byte2+1)) == 0) - Msg(ERROR, "Font out of OpenGL display lists"); + Msg(FATAL, "Font out of OpenGL Display Lists"); glXUseXFont(XCTX.xfont.helve->fid, XCTX.xfont.helve->min_char_or_byte2, @@ -760,9 +806,8 @@ int main(int argc, char *argv[]){ TYPBGMESH = ONFILE; Create_BgMesh(TYPBGMESH,.2,THEM); } - else{ - Msg(ERROR, "Invalid background mesh (no view)"); - } + else + Msg(ERROR, "Invalid Background Mesh (no View)"); } /* Compute viewport and Draw */ diff --git a/Unix/Message.cpp b/Unix/Message.cpp index ca854b8dc6d66d16a4f815d070d1980c16ab2282..0333872ac2240960f948be7da245e511ab747ebe 100644 --- a/Unix/Message.cpp +++ b/Unix/Message.cpp @@ -1,4 +1,4 @@ -/* $Id: Message.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: Message.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include <signal.h> #include <sys/resource.h> @@ -12,92 +12,29 @@ extern Context_T CTX; extern Widgets_T WID; -/* ------------------------------------------------------------------------ */ -/* I n f o */ -/* ------------------------------------------------------------------------ */ - -extern char gmsh_progname[], gmsh_version[], gmsh_os[], gmsh_date[]; -extern char gmsh_host[], gmsh_packager[], gmsh_email[], gmsh_url[]; -extern char gmsh_copyright[] ; - -char clargs[] = - "Usage: %s [options] [files]\n" - "Mesh options:\n" - " -0 parse input and exit\n" - " -1, -2, -3 batch 1-, 2- or 3-dimensional mesh\n" - " -format msh|unv mesh format (default: msh)\n" - " -algo iso|aniso mesh algorithm (default: iso)\n" - " -smooth int mesh smoothing (default: 0)\n" - " -degree int mesh degree (default: 1)\n" - " -scale float scaling factor (default: 1.0)\n" - " -bgm file load backround mesh from file\n" - " -interactive display the mesh construction\n" - "Post Processing options:\n" - " -dl enable display lists\n" - " -noview hide all views at startup\n" - "Display options:\n" - " -nodb no double buffer\n" - " -noov no overlay visual\n" - " -alpha enable alpha blending\n" - " -visinfo show visual information at startup\n" - " -geometry geom specify main window geometry\n" - " -viewport 9*float specify rotation, translation and scale\n" - " -display disp specify display\n" - " -perspective perspective instead of orthographic projection\n" - " -flash allow colormap flashing\n" - " -samevisual force same visual for OpenGL and GUI\n" - "Other options:\n" - " -v int set verbosity level (default: 2)\n" - " -threads enable threads\n" - " -path string path for included files\n" - " -version show version number\n" - " -info show detailed version information\n" - " -help show this message\n" - ; - -void Info (int level, char *arg0){ - switch(level){ - case 0 : - fprintf(stderr, "%s\n", gmsh_progname); - fprintf(stderr, "%s\n", gmsh_copyright); - fprintf(stderr, clargs, arg0); - exit(1); - case 1: - fprintf(stderr, "%s%g\n", gmsh_version, GMSH_VERSION); - fprintf(stderr, "%s\n", gmsh_os); - fprintf(stderr, "%s\n", gmsh_date); - fprintf(stderr, "%s\n", gmsh_host); - fprintf(stderr, "%s\n", gmsh_packager); - fprintf(stderr, "%s\n", gmsh_email); - fprintf(stderr, "%s\n", gmsh_url); - exit(1) ; - case 2 : - fprintf(stderr, "%g\n", GMSH_VERSION); - exit(1); - default : - break; - } -} - - /* ------------------------------------------------------------------------ */ /* S i g n a l */ /* ------------------------------------------------------------------------ */ - void Signal (int sig_num){ switch (sig_num){ case SIGSEGV : - Msg(ERROR, "Segmentation Violation (invalid memory reference)\n" - "----------------------------------------------------------------------\n" - "You have probably discovered a bug in Gmsh...\n" - "You may e-mail the context in which it occurred to one of the authors.\n" - "Type 'gmsh -version' to get feedback information."); + Msg(FATAL, "Segmentation Violation (Invalid Memory Reference)\n" + "------------------------------------------------------\n" + "You have discovered a bug in Gmsh. You may e-mail the\n" + "context in which it occurred to one of the authors:\n" + "type 'gmsh -info' to get feedback information"); + break; + case SIGFPE : + Msg(FATAL, "Floating Point Exception (Division by Zero?)"); + break; + case SIGINT : + Msg(FATAL, "Interrupt (Generated from Terminal Special Character)"); + break; + default : + Msg(FATAL, "Unknown Signal"); break; - case SIGFPE : Msg(ERROR, "Floating point exception (division by zero?)"); break; - case SIGINT : Msg(ERROR, "Interrupt (generated from terminal special char)"); break; - default : Msg(ERROR, "Unknown signal"); break; } } @@ -123,91 +60,134 @@ void Msg(int level, char *fmt, ...){ Arg arg[2]; int nb, nbvis; - if(!CTX.verbosity && CTX.interactive && - level != ERROR && level != PARSER_ERROR) return ; + if(level != FATAL && level != ERROR && level != PARSER_ERROR && + CTX.interactive && !CTX.verbosity) + return ; va_start (args, fmt); switch(level){ - - case PARSER_ERROR : - if(CTX.interactive || !CTX.command_win){ - fprintf(stderr, "Parse Error: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); - } - else{ - PUT_IN_COMMAND_WIN ; - } - break ; - - case PARSER_INFO : - if(CTX.interactive || !CTX.command_win){ - fprintf(stderr, "Parse Info: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); - } - else{ - PUT_IN_COMMAND_WIN ; - } - break ; - + case FATAL : + fprintf(stderr, FATAL_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + abort = 1; + break; case ERROR : if(CTX.interactive || !CTX.command_win){ - fprintf(stderr, "Error: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); - abort = 1; + fprintf(stderr, ERROR_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); } else{ PUT_IN_COMMAND_WIN ; } - break ; - + break; case WARNING : if(CTX.interactive || !CTX.command_win){ - fprintf(stderr, "Warning: "); vfprintf(stderr, fmt,args); fprintf(stderr, "\n"); + if(CTX.verbosity > 0){ + fprintf(stderr, WARNING_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } } - else { + else{ PUT_IN_COMMAND_WIN ; } break; - case INFOS : if(CTX.interactive || !CTX.command_win){ - vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + if(CTX.verbosity > 1){ + fprintf(stderr, INFOS_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } } else{ PUT_IN_COMMAND_WIN ; } break; - case INFO : if(CTX.interactive){ - vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + if(CTX.verbosity > 1){ + fprintf(stderr, INFO_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } } else{ vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.infoLabel, XmNlabelString, XmStringCreateSimple(TextBuffer), NULL); + XtVaSetValues(WID.G.infoLabel, XmNlabelString, + XmStringCreateSimple(TextBuffer), NULL); XmUpdateDisplay(WID.G.infoLabel); } break; - case SELECT : if(CTX.interactive){ - vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + if(CTX.verbosity > 1){ + fprintf(stderr, SELECT_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } } else{ vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.selectLabel, XmNlabelString, XmStringCreateSimple(TextBuffer), NULL); + XtVaSetValues(WID.G.selectLabel, XmNlabelString, + XmStringCreateSimple(TextBuffer), NULL); XmUpdateDisplay(WID.G.selectLabel); } break; - case STATUS : if(CTX.interactive){ - vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + if(CTX.verbosity > 1){ + fprintf(stderr, STATUS_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } } else{ vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.statusLabel, XmNlabelString, XmStringCreateSimple(TextBuffer), NULL); + XtVaSetValues(WID.G.statusLabel, XmNlabelString, + XmStringCreateSimple(TextBuffer), NULL); XmUpdateDisplay(WID.G.statusLabel); } break; + case PARSER_ERROR : + if(CTX.interactive || !CTX.command_win){ + if(CTX.verbosity > 0){ + fprintf(stderr, PARSER_ERROR_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } + } + else{ + PUT_IN_COMMAND_WIN ; + } + break; + case PARSER_INFO : + if(CTX.interactive || !CTX.command_win){ + if(CTX.verbosity > 1){ + fprintf(stderr, PARSER_INFO_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } + } + else{ + PUT_IN_COMMAND_WIN ; + } + break; + case DEBUG : + if(CTX.interactive || !CTX.command_win){ + if(CTX.verbosity > 2){ + fprintf(stderr, DEBUG_STR); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + } + } + else{ + PUT_IN_COMMAND_WIN ; + } + break; } va_end (args); @@ -231,7 +211,7 @@ void GetResources(long *s, long *us, long *mem){ } void PrintResources(FILE *stream, char *fmt, long s, long us, long mem){ - fprintf(stream, "Resources: %scpu %ld.%ld s / mem %ld kb\n", fmt, s, us, mem); + fprintf(stream, "Resources = %scpu %ld.%ld s / mem %ld kb\n", fmt, s, us, mem); } double Cpu(void){ @@ -246,3 +226,10 @@ double Cpu(void){ void Progress(int i){ } + +/* ------------------------------------------------------------------------ */ +/* E d i t G e o m e t r y */ +/* ------------------------------------------------------------------------ */ + +void AddALineInTheEditGeometryForm (char* line){ +} diff --git a/Unix/Register.cpp b/Unix/Register.cpp index ebcf6104e344bb44131f02f08a75e37a669ced93..53448f9e55b64eaeb188c73a5ab363a4b6ec4c21 100644 --- a/Unix/Register.cpp +++ b/Unix/Register.cpp @@ -1,4 +1,4 @@ -/* $Id: Register.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: Register.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -142,9 +142,7 @@ void RegisterCallbacks_FD(Widgets_T *w){ register_cancel_cb (w->FD.saveAsDialog, ManageCb, w->FD.saveAsDialog); register_activate_cb (w->FD.saveAsButt[0], OptionsCb, OPTIONS_MESH_FORMAT_MSH); register_activate_cb (w->FD.saveAsButt[1], OptionsCb, OPTIONS_MESH_FORMAT_UNV); - /* register_activate_cb (w->FD.saveAsButt[2], OptionsCb, OPTIONS_MESH_FORMAT_GREF); - */ register_ok_cb (w->FD.printDialog, FileCb, FILE_PRINT); register_cancel_cb (w->FD.printDialog, ManageCb, w->FD.printDialog); @@ -186,6 +184,8 @@ void RegisterCallbacks_OD(Widgets_T *w){ register_valchg_cb (w->OD.meshVisibleButt[1], OptionsCb, OPTIONS_MESH_LINES); register_valchg_cb (w->OD.meshVisibleButt[2], OptionsCb, OPTIONS_MESH_SURFACES); register_valchg_cb (w->OD.meshVisibleButt[3], OptionsCb, OPTIONS_MESH_VOLUMES); + register_valchg_cb (w->OD.meshVisibleByNumButt[0], OptionsCb, OPTIONS_MESH_SELECT_ENTITY); + register_valchg_cb (w->OD.meshVisibleByNumButt[1], OptionsCb, OPTIONS_MESH_SELECT_QUALITY); register_activate_cb(w->OD.meshVisibleByNumText, OptionsCb, OPTIONS_MESH_HIDE_SHOW); register_valchg_cb (w->OD.meshAspectButt[0], OptionsCb, OPTIONS_MESH_WIREFRAME); register_valchg_cb (w->OD.meshAspectButt[1], OptionsCb, OPTIONS_MESH_HIDDEN_LINES); diff --git a/Unix/Widgets.cpp b/Unix/Widgets.cpp index 1cff1a4ffb43ad1def516d85fa4f9cc872835f8b..8fc135dbd55bf3245466af2fe81084d0ddea8b12 100644 --- a/Unix/Widgets.cpp +++ b/Unix/Widgets.cpp @@ -1,4 +1,4 @@ -/* $Id: Widgets.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ +/* $Id: Widgets.cpp,v 1.5 2000-11-23 23:20:35 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -622,12 +622,10 @@ void CreateWidgets_FD(Widgets_T *w){ XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Ideas universal [.unv]")); i++; w->FD.saveAsButt[1] = XmCreatePushButton(w->FD.saveAsPane, "MsaveAsButt1", arg, i); XtManageChild(w->FD.saveAsButt[1]); - /* i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Gref [.gre]")); i++; + XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Gref [.Gref]")); i++; w->FD.saveAsButt[2] = XmCreatePushButton(w->FD.saveAsPane, "MsaveAsButt2", arg, i); XtManageChild(w->FD.saveAsButt[2]); - */ i=0; XtSetArg(arg[i], XmNsubMenuId, w->FD.saveAsPane); i++; XtSetArg(arg[i], XmNspacing, 0); i++; @@ -1049,7 +1047,7 @@ void CreateWidgets_OD(Widgets_T *w){ XtManageChild(w->OD.meshVisibleByNumFrame[0]); i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Visibility by Number")); i++; + XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Visibility")); i++; XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; w->OD.meshVisibleByNumFrame[1] = XmCreateLabel(w->OD.meshVisibleByNumFrame[0], "ODmeshVisibleByNumFrame1", arg, i); XtManageChild(w->OD.meshVisibleByNumFrame[1]); @@ -1058,6 +1056,23 @@ void CreateWidgets_OD(Widgets_T *w){ w->OD.meshVisibleByNumRowCol = XmCreateRowColumn(w->OD.meshVisibleByNumFrame[0], "ODmeshVisibleByNumRowCol", arg, i); XtManageChild(w->OD.meshVisibleByNumRowCol); + i=0; + XtSetArg(arg[i], XmNnumColumns, 2); i++; + w->OD.meshVisibleByNumCheck = XmCreateRadioBox(w->OD.meshVisibleByNumRowCol, "ODmeshVisibleByNumCheck", arg, i); + XtManageChild(w->OD.meshVisibleByNumCheck); + + i=0; + XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("By Entity")); i++; + XtSetArg(arg[i], XmNset, True); i++; + w->OD.meshVisibleByNumButt[0] = XmCreateToggleButton(w->OD.meshVisibleByNumCheck, "ODmeshVisibleByNumButt0", arg, i); + XtManageChild(w->OD.meshVisibleByNumButt[0]); + + i=0; + XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("By Quality")); i++; + XtSetArg(arg[i], XmNset, False); i++; + w->OD.meshVisibleByNumButt[1] = XmCreateToggleButton(w->OD.meshVisibleByNumCheck, "ODmeshVisibleByNumButt1", arg, i); + XtManageChild(w->OD.meshVisibleByNumButt[1]); + i=0; XtSetArg(arg[i], XmNvalue, "*"); i++; w->OD.meshVisibleByNumText = XmCreateTextField(w->OD.meshVisibleByNumRowCol, "ODmeshVisibleByNumText", arg, i); diff --git a/Unix/Widgets.h b/Unix/Widgets.h index c88317b342d452c0ac5f7a2e30538c9502867ab4..d50b7f0a5d46637b4f7e98fa733787659086ff5f 100644 --- a/Unix/Widgets.h +++ b/Unix/Widgets.h @@ -1,4 +1,4 @@ -/* $Id: Widgets.h,v 1.2 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: Widgets.h,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ #ifndef _WIDGETS_H_ #define _WIDGETS_H_ @@ -106,6 +106,7 @@ typedef struct { Widget meshVisibleTypeCheck, meshVisibleTypeButt[2] ; Widget meshVisibleCheck, meshVisibleButt[4] ; Widget meshVisibleByNumFrame[2], meshVisibleByNumRowCol ; + Widget meshVisibleByNumCheck, meshVisibleByNumButt[4]; Widget meshVisibleByNumText ; Widget meshAspectFrame[2] ; Widget meshAspectCheck, meshAspectButt[3] ; diff --git a/Unix/XColors.cpp b/Unix/XColors.cpp index 799e734286ebe4c7adbce97cbe6fb7651e5879b5..955a7da3bcf6cf58f4c240cb6bb7b149fc5567cf 100644 --- a/Unix/XColors.cpp +++ b/Unix/XColors.cpp @@ -1,4 +1,4 @@ -/* $Id: XColors.cpp,v 1.2 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: XColors.cpp,v 1.3 2000-11-23 23:20:35 geuzaine Exp $ */ /* Attention. Toutes les couleurs sont crees a partir de la colormap de l'interface : XCTX.gui.colormap @@ -97,7 +97,7 @@ unsigned long AllocateColorInt( int r, int g, int b ) &xcol ); return xcol.pixel; default: - printf("Error in AllocateColorInt %d\n", pixelformat); + Msg(ERROR, "Error in AllocateColorInt %d", pixelformat); exit(0); } return 0; diff --git a/demos/ex12.a b/demos/ex12.a new file mode 100644 index 0000000000000000000000000000000000000000..3919d59a46c30a1ab26d244e426762b8809c8d35 --- /dev/null +++ b/demos/ex12.a @@ -0,0 +1,105 @@ +/* + * Sample Gmsh demo file + * + * Copyright (C) 2000 C. Geuzaine, J.-F. Remacle + * + */ + +h = 19.6 ; hSol = 1. ; +L = 150. ; + +xg = 0. ; yg = 30.023 + h ; +x1a = -6.782 ; y1a = 19.355 + h ; +x1b = -9.83 ; y1b = 8.839 + h ; +x1c = -8.001 ; y1c = 0. + h ; + +x2a = 6.782 ; y2a = 19.355 + h ; +x2b = 9.83 ; y2b = 8.839 + h ; +x2c = 8.001 ; y2c = 0. + h ; + +z0 = 0 ; dy0 = 12. ; +z1 = 20 ; dy1 = 11.787 ; +z2 = 40 ; dy2 = 11.148 ; +z3 = 70 ; dy3 = 9.391 ; +z4 = 100 ; dy4 = 6.673 ; +z5 = 120 ; dy5 = 4.326 ; +z6 = 130 ; dy6 = 2.991 ; +z7 = 140 ; dy7 = 1.550 ; +z8 = 150 ; dy8 = 0. ; + +p0 = 2. ; p1 = 30. ; + +Include "ex12.b" ; + +/* ------------ */ +/* Fil 1a, b, c */ +/* ------------ */ + +x = x1a ; y = y1a ; i_p = 100 ; i_l = 10 ; +Include "ex12.c" ; +x = x1b ; y = y1b ; i_p = 200 ; i_l = 20 ; +Include "ex12.c" ; +x = x1c ; y = y1c ; i_p = 300 ; i_l = 30 ; +Include "ex12.c" ; + +/* ------------ */ +/* Fil 2a, b, c */ +/* ------------ */ + +x = x2a ; y = y2a ; i_p = 400 ; i_l = 40 ; +Include "ex12.c" ; +x = x2b ; y = y2b ; i_p = 500 ; i_l = 50 ; +Include "ex12.c" ; +x = x2c ; y = y2c ; i_p = 600 ; i_l = 60 ; +Include "ex12.c" ; + +/* ------ */ +/* Fil g */ +/* ------ */ + +x = xg ; y = yg ; i_p = 700 ; i_l = 70 ; +Include "ex12.c" ; + + +/* --------------------------------------------- */ + +Physical Line (1011) = {10,11,12} ; +Physical Line (1012) = {20,21,22} ; +Physical Line (1013) = {30,31,32} ; + +Physical Line (1021) = {40,41,42} ; +Physical Line (1022) = {50,51,52} ; +Physical Line (1023) = {60,61,62} ; + +Physical Line (1010) = {70,71,72} ; + + +Physical Line (1100) = { + 10,20,30,40,50,60, 70, + 11,21,31,41,51,61, 71, + 12,22,32,42,52,62, 72, + + 201,202,203,204, 211,212,213,214, 221,222,223,224, 231,232,233,234, + 241,242,243,244, 251,252,253,254, 261,262,263,264, 271,272,273,274, + 281,282,283,284, + 301,302,303,304,305,306,307,308, 311,312,313,314,315,316,317,318, + 321,322,323,324,325,326,327,328, 331,332,333,334,335,336,337,338, + 401,402,403,404, 411,412,413,414, 421,422,423,424, 431,432,433,434, + 441,442,443,444, 451,452,453,454, + 501,502,503,504, 511,512,513,514, 521,522,523,524, 531,532,533,534, + 541,542,543,544, 551,552,553,554 +} ; + +Physical Line (1001) = { + 201,202,203,204, 211,212,213,214, 221,222,223,224, 231,232,233,234, + 241,242,243,244, 251,252,253,254, 261,262,263,264, 271,272,273,274, + 281,282,283,284, + 301,302,303,304,305,306,307,308, 311,312,313,314,315,316,317,318, + 321,322,323,324,325,326,327,328, 331,332,333,334,335,336,337,338, + 401,402,403,404, 411,412,413,414, 421,422,423,424, 431,432,433,434, + 441,442,443,444, 451,452,453,454, + 501,502,503,504, 511,512,513,514, 521,522,523,524, 531,532,533,534, + 541,542,543,544, 551,552,553,554 +} ; + +