Skip to content
Snippets Groups Projects
Commit 25d2d484 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent c447fad1
Branches
Tags
No related merge requests found
/* $Id: Adapt.cpp,v 1.2 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: Adapt.cpp,v 1.3 2001-01-08 08:05:39 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "Adapt.h" #include "Adapt.h"
......
/* $Id: Adapt.h,v 1.4 2000-11-26 15:43:44 geuzaine Exp $ */
#ifndef _ADAPT_H_ #ifndef _ADAPT_H_
#define _ADAPT_H_ #define _ADAPT_H_
......
# $Id: Makefile,v 1.6 2000-12-29 10:27:00 geuzaine Exp $ # $Id: Makefile,v 1.7 2001-01-08 08:05:39 geuzaine Exp $
# #
# Makefile for "libAdapt.a" # Makefile for "libAdapt.a"
# #
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
.IGNORE: .IGNORE:
CC = c++ CC = c++
C_FLAGS = -g
OS_FLAGS = -D_XMOTIF
RM = rm RM = rm
RMFLAGS = -f
RANLIB = ranlib RANLIB = ranlib
LIB = ../lib/libAdapt.a LIB = ../lib/libAdapt.a
INCLUDE = -I../Common -I../DataStr INCLUDE = -I../Common -I../DataStr
CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(INCLUDE) C_FLAGS = -g -Wall
OS_FLAGS =
VERSION_FLAGS =
RMFLAGS = -f
CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE)
SRC = Adapt.cpp \ SRC = Adapt.cpp \
mnbrak.cpp \ mnbrak.cpp \
......
/* $Id: brent.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: brent.cpp,v 1.4 2001-01-08 08:05:39 geuzaine Exp $
#include <math.h> #include <math.h>
......
/* $Id: dsvdcmp.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: dsvdcmp.cpp,v 1.4 2001-01-08 08:05:39 geuzaine Exp $
#include <math.h> #include <math.h>
#include "nrutil.h" #include "nrutil.h"
......
/* $Id: fdjac.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: fdjac.cpp,v 1.4 2001-01-08 08:05:39 geuzaine Exp $
#include <math.h> #include <math.h>
#define NRANSI #define NRANSI
#include "nrutil.h" #include "nrutil.h"
...@@ -29,4 +29,3 @@ fdjac (int n, float x[], float fvec[], float **df, ...@@ -29,4 +29,3 @@ fdjac (int n, float x[], float fvec[], float **df,
} }
#undef EPS #undef EPS
#undef NRANSI #undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: fmin.cpp,v 1.2 2000-11-23 14:11:24 geuzaine Exp $ */ // $Id: fmin.cpp,v 1.3 2001-01-08 08:05:40 geuzaine Exp $
#define NRANSI #define NRANSI
#include "nrutil.h" #include "nrutil.h"
...@@ -18,4 +18,3 @@ fmin (float x[]) ...@@ -18,4 +18,3 @@ fmin (float x[])
return 0.5 * sum; return 0.5 * sum;
} }
#undef NRANSI #undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: lnsrch.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: lnsrch.cpp,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
#include <math.h> #include <math.h>
#define NRANSI #define NRANSI
#include "nrutil.h" #include "nrutil.h"
...@@ -78,4 +78,3 @@ lnsrch (int n, float xold[], float fold, float g[], float p[], float x[], ...@@ -78,4 +78,3 @@ lnsrch (int n, float xold[], float fold, float g[], float p[], float x[],
#undef ALF #undef ALF
#undef TOLX #undef TOLX
#undef NRANSI #undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: lubksb.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: lubksb.cpp,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
void void
lubksb (float **a, int n, int *indx, float b[]) lubksb (float **a, int n, int *indx, float b[])
{ {
...@@ -25,4 +25,3 @@ lubksb (float **a, int n, int *indx, float b[]) ...@@ -25,4 +25,3 @@ lubksb (float **a, int n, int *indx, float b[])
b[i] = sum / a[i][i]; b[i] = sum / a[i][i];
} }
} }
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: ludcmp.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: ludcmp.cpp,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
#include <math.h> #include <math.h>
#define NRANSI #define NRANSI
#include "nrutil.h" #include "nrutil.h"
...@@ -70,4 +70,3 @@ ludcmp (float **a, int n, int *indx, float *d) ...@@ -70,4 +70,3 @@ ludcmp (float **a, int n, int *indx, float *d)
} }
#undef TINY #undef TINY
#undef NRANSI #undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: mnbrak.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: mnbrak.cpp,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
#include <math.h> #include <math.h>
#define NRANSI #define NRANSI
#include "nrutil.h" #include "nrutil.h"
...@@ -77,4 +77,3 @@ mnbrak (double *ax, double *bx, double *cx, double *fa, double *fb, double *fc, ...@@ -77,4 +77,3 @@ mnbrak (double *ax, double *bx, double *cx, double *fa, double *fb, double *fc,
#undef TINY #undef TINY
#undef SHFT #undef SHFT
#undef NRANSI #undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: newt.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: newt.cpp,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
#include <math.h> #include <math.h>
#define NRANSI #define NRANSI
#include "nrutil.h" #include "nrutil.h"
...@@ -105,4 +105,3 @@ newt (float x[], int n, int *check, ...@@ -105,4 +105,3 @@ newt (float x[], int n, int *check,
#undef STPMX #undef STPMX
#undef FREERETURN #undef FREERETURN
#undef NRANSI #undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software J!0. */
/* $Id: nrutil.cpp,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */ // $Id: nrutil.cpp,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
#include <stdio.h> #include <stdio.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
......
/* $Id: nrutil.h,v 1.3 2000-11-26 15:43:44 geuzaine Exp $ */
#ifndef _NR_UTILS_H_ #ifndef _NR_UTILS_H_
#define _NR_UTILS_H_ #define _NR_UTILS_H_
......
/* $Id: Box.cpp,v 1.17 2000-12-21 12:30:34 geuzaine Exp $ */ // $Id: Box.cpp,v 1.18 2001-01-08 08:05:40 geuzaine Exp $
#include <signal.h> #include <signal.h>
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
#include "Views.h" #include "Views.h"
#include "Parser.h" #include "Parser.h"
#include "Context.h" #include "Context.h"
#include "Main.h" #include "OpenFile.h"
#include "GetOptions.h"
#include "MinMax.h" #include "MinMax.h"
#include "Version.h" #include "Version.h"
...@@ -17,53 +18,15 @@ ...@@ -17,53 +18,15 @@
extern List_T *Post_ViewList; extern List_T *Post_ViewList;
char *TheFileNameTab[MAX_OPEN_FILES];
char *ThePathForIncludes=NULL, *TheBgmFileName=NULL;
int VERBOSE = 0 ;
char gmsh_progname[] = "This is Gmsh (non-interactive)" ;
char gmsh_copyright[] = "Copyright (C) 1997-2001 J.-F. Remacle, C. Geuzaine";
char gmsh_version[] = "Version : " ;
char gmsh_os[] = "Operating System : " GMSH_OS ;
char gmsh_date[] = "Build Date : " GMSH_DATE ;
char gmsh_host[] = "Build Host : " GMSH_HOST ;
char gmsh_packager[] = "Packager : " GMSH_PACKAGER ;
char gmsh_url[] = "URL : http://www.geuz.org/gmsh/" ;
char gmsh_email[] = "E-Mail : Christophe.Geuzaine@ulg.ac.be\n"
" Remacle@scorec.rpi.edu" ;
char gmsh_help[] =
"Usage: %s [options] [files]\n"
"Geometry options:\n"
" -0 output flattened parsed geometry and exit\n"
"Mesh options:\n"
" -1, -2, -3 perform batch 1D, 2D and 3D mesh generation\n"
" -smooth int set mesh smoothing (default: 3)\n"
" -degree int set mesh degree (default: 1)\n"
" -format msh|unv|gref set output mesh format (default: msh)\n"
" -algo iso|aniso select mesh algorithm (default: iso)\n"
" -scale float set global scaling factor (default: 1.0)\n"
" -meshscale float set mesh scaling factor (default: 1.0)\n"
" -clscale float set characteristic length scaling factor (default: 1.0)\n"
" -bgm file load backround mesh from file\n"
"Other options:\n"
" -v print debug information\n"
" -path string set path for included files\n"
" -version show version number\n"
" -info show detailed version information\n"
" -help show this message\n"
;
/* dummy defs for link purposes */ /* dummy defs for link purposes */
void ZeroHighlight(Mesh *){}
void AddViewInUI(int, char *, int){} void AddViewInUI(int, char *, int){}
void draw_polygon_2d (double, double, double, int, double *, double *, double *){} void draw_polygon_2d (double, double, double, int, double *, double *, double *){}
void set_r(int, double){} void set_r(int, double){}
void Init(void){} void Init(void){}
void Draw(void){} void Draw(void){}
void DrawUI(void){}
void Replot(void){} void Replot(void){}
void Get_AnimTime(void){}
void CreateFile(char *, int){} void CreateFile(char *, int){}
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
...@@ -75,7 +38,7 @@ void Info (int level, char *arg0){ ...@@ -75,7 +38,7 @@ void Info (int level, char *arg0){
case 0 : case 0 :
fprintf(stderr, "%s\n", gmsh_progname); fprintf(stderr, "%s\n", gmsh_progname);
fprintf(stderr, "%s\n", gmsh_copyright); fprintf(stderr, "%s\n", gmsh_copyright);
fprintf(stderr, gmsh_help, arg0); fprintf(stderr, gmsh_options, arg0);
exit(1); exit(1);
case 1: case 1:
fprintf(stderr, "%.2f\n", GMSH_VERSION); fprintf(stderr, "%.2f\n", GMSH_VERSION);
...@@ -94,253 +57,6 @@ void Info (int level, char *arg0){ ...@@ -94,253 +57,6 @@ void Info (int level, char *arg0){
} }
} }
/* ------------------------------------------------------------------------ */
/* p a r s e */
/* ------------------------------------------------------------------------ */
void ParseFile(char *f){
char String[256];
strncpy(yyname,f,NAME_STR_L);
yyerrorstate=0;
yylineno=1;
if(!(yyin = fopen(yyname,"r"))){
Msg(INFO, "File '%s' Does not Exist", f);
return;
}
fpos_t position;
fgetpos(yyin, &position);
fgets(String, sizeof(String), yyin) ;
fsetpos(yyin, &position);
if(!strncmp(String, "$PTS", 4) ||
!strncmp(String, "$NO", 3) ||
!strncmp(String, "$ELM", 4)){
if(THEM->status < 0) mai3d(THEM, 0);
Read_Mesh(THEM, yyin, FORMAT_MSH);
}
else if(!strncmp(String, "$PostFormat", 11) ||
!strncmp(String, "$View", 5)){
Read_View(yyin, yyname);
}
else{
while(!feof(yyin)) yyparse();
}
fclose(yyin);
}
void MergeProblem(char *name){
Msg(INFOS, "Merging %s",name);
ParseFile(name);
if (yyerrorstate) return;
}
void OpenProblem(char *name){
char ext[6];
InitSymbols();
Init_Mesh(&M, 1);
strncpy(TheFileName,name,NAME_STR_L);
strncpy(TheBaseFileName,name,NAME_STR_L);
strcpy(ext,name+(strlen(name)-4));
if(!strcmp(ext,".GEO") ||
!strcmp(ext,".geo") ||
!strcmp(ext,".msh") ||
!strcmp(ext,".pos")){
TheBaseFileName[strlen(name)-4] = '\0';
}
else{
strcat(TheFileName,".geo");
}
strncpy(THEM->name, TheBaseFileName,NAME_STR_L);
Msg(INFOS, "Opening %s", TheFileName);
ParseFile(TheFileName);
ApplyLcFactor(THEM);
mai3d(THEM,0);
Maillage_Dimension_0(&M);
ZeroHighlight(&M);
CalculateMinMax(THEM->Points);
}
/* ------------------------------------------------------------------------ */
/* G e t _ O p t i o n s */
/* ------------------------------------------------------------------------ */
void Get_Options (int argc, char *argv[], int *nbfiles) {
int i=1;
if(argc < 2) Info(0,argv[0]);
TheFileNameTab[0] = "unnamed.geo" ;
*nbfiles = 0;
while (i < argc) {
if (argv[i][0] == '-') {
if(!strcmp(argv[i]+1, "0")){
CTX.interactive = -1; i++;
}
else if(!strcmp(argv[i]+1, "1")){
CTX.interactive = 1; i++;
}
else if(!strcmp(argv[i]+1, "2")){
CTX.interactive = 2; i++;
}
else if(!strcmp(argv[i]+1, "3")){
CTX.interactive = 3; i++;
}
else if(!strcmp(argv[i]+1, "v")){
VERBOSE = 1; i++;
}
else if(!strcmp(argv[i]+1, "path")){
i++;
if(argv[i] != NULL) ThePathForIncludes = argv[i++];
else{
fprintf(stderr, ERROR_STR "Missing String\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "bgm")){
i++;
if(argv[i] != NULL) TheBgmFileName = argv[i++];
else{
fprintf(stderr, ERROR_STR "Missing File Name\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "smooth")){
i++;
if(argv[i] != NULL) CTX.mesh.nb_smoothing = atoi(argv[i++]);
else{
fprintf(stderr, ERROR_STR "Missing Number\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "scale")){
i++;
if(argv[i] != NULL) CTX.geom.scaling_factor = atof(argv[i++]);
else{
fprintf(stderr, ERROR_STR "Missing Number\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "meshscale")){
i++;
if(argv[i] != NULL) CTX.mesh.scaling_factor = atof(argv[i++]);
else{
fprintf(stderr, ERROR_STR "Missing Number\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "clscale")){
i++;
if(argv[i]!=NULL){
CTX.mesh.lc_factor = atof(argv[i++]);
if(CTX.mesh.lc_factor <= 0.0){
fprintf(stderr, ERROR_STR
"Characteristic Length Factor Must be > 0\n");
exit(1);
}
}
else {
fprintf(stderr, ERROR_STR "Missing Number\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "degree")){
i++;
if(argv[i]!=NULL){
CTX.mesh.degree = atoi(argv[i++]);
if(CTX.mesh.degree != 1 || CTX.mesh.degree != 2){
fprintf(stderr, ERROR_STR "Wrong degree\n");
exit(1);
}
}
else {
fprintf(stderr, ERROR_STR "Missing Number\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "format")){
i++;
if(argv[i]!=NULL){
if(!strcmp(argv[i],"msh"))
CTX.mesh.format = FORMAT_MSH ;
else if(!strcmp(argv[i],"unv"))
CTX.mesh.format = FORMAT_UNV ;
else if(!strcmp(argv[i],"gref"))
CTX.mesh.format = FORMAT_GREF ;
else{
fprintf(stderr, ERROR_STR "Unknown mesh format\n");
exit(1);
}
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing format\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "algo")){
i++;
if(argv[i]!=NULL){
if(!strcmp(argv[i],"iso"))
CTX.mesh.algo = DELAUNAY_OLDALGO ;
else if(!strcmp(argv[i],"aniso"))
CTX.mesh.algo = DELAUNAY_NEWALGO ;
else{
fprintf(stderr, ERROR_STR "Unknown mesh algorithm\n");
exit(1);
}
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing algorithm\n");
exit(1);
}
}
else if(!strcmp(argv[i]+1, "info")){
Info(2,argv[0]);
}
else if(!strcmp(argv[i]+1, "version")){
Info(1,argv[0]);
}
else if(!strcmp(argv[i]+1, "help")){
Info(0,argv[0]);
}
else{
fprintf(stderr, WARNING_STR "Unknown option '%s'\n", argv[i]);
Info(0,argv[0]);
}
}
else {
if(*nbfiles < MAX_OPEN_FILES){
TheFileNameTab[(*nbfiles)++] = argv[i++];
}
else{
fprintf(stderr, ERROR_STR "Too many input files\n");
exit(1);
}
}
}
strncpy(TheFileName, TheFileNameTab[0], NAME_STR_L);
}
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* m a i n */ /* m a i n */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
...@@ -355,7 +71,7 @@ int main(int argc, char *argv[]){ ...@@ -355,7 +71,7 @@ int main(int argc, char *argv[]){
signal(SIGSEGV, Signal); signal(SIGSEGV, Signal);
signal(SIGFPE, Signal); signal(SIGFPE, Signal);
OpenProblem(TheFileName); OpenProblem(CTX.filename);
if(yyerrorstate) if(yyerrorstate)
exit(1); exit(1);
else{ else{
...@@ -431,7 +147,7 @@ void Msg(int level, char *fmt, ...){ ...@@ -431,7 +147,7 @@ void Msg(int level, char *fmt, ...){
break ; break ;
case PARSER_INFO : case PARSER_INFO :
if(VERBOSE){ if(CTX.verbosity == 5){
fprintf(stderr, PARSER_INFO_STR); fprintf(stderr, PARSER_INFO_STR);
vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); vfprintf(stderr, fmt, args); fprintf(stderr, "\n");
} }
...@@ -442,7 +158,7 @@ void Msg(int level, char *fmt, ...){ ...@@ -442,7 +158,7 @@ void Msg(int level, char *fmt, ...){
case INFO : case INFO :
case SELECT : case SELECT :
case STATUS : case STATUS :
if(VERBOSE){ if(CTX.verbosity == 5){
fprintf(stderr, INFO_STR); fprintf(stderr, INFO_STR);
vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); vfprintf(stderr, fmt, args); fprintf(stderr, "\n");
} }
......
# $Id: Makefile,v 1.3 2000-12-29 10:27:00 geuzaine Exp $ # $Id: Makefile,v 1.4 2001-01-08 08:05:40 geuzaine Exp $
# #
# Makefile for ".a" # Makefile for ".a"
# #
...@@ -6,19 +6,17 @@ ...@@ -6,19 +6,17 @@
.IGNORE: .IGNORE:
CC = c++ CC = c++
C_FLAGS = -g
VERSION_FLAGS =
OS_FLAGS =
RM = rm RM = rm
RMFLAGS = -f
RANLIB = ranlib RANLIB = ranlib
LIB = ../lib/libBox.a LIB = ../lib/libBox.a
INCLUDE = -I../Common -I../DataStr -I../Geo\ INCLUDE = -I../Common -I../DataStr -I../Geo\
-I../Graphics -I../Mesh -I../Parser -I../Unix -I../Graphics -I../Mesh -I../Parser -I../Motif -I../Fltk
C_FLAGS = -g
OS_FLAGS =
VERSION_FLAGS =
RMFLAGS = -f
CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE) CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE)
SRC = Box.cpp SRC = Box.cpp
......
/* $Id: ColorTable.cpp,v 1.1 2000-12-08 10:56:36 geuzaine Exp $ */ // $Id: ColorTable.cpp,v 1.2 2001-01-08 08:05:40 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "ColorTable.h" #include "ColorTable.h"
......
/* $Id: ColorTable.h,v 1.1 2000-12-08 10:56:36 geuzaine Exp $ */
#ifndef _COLORTABLE_H_ #ifndef _COLORTABLE_H_
#define _COLORTABLE_H_ #define _COLORTABLE_H_
......
/* $Id: Colors.h,v 1.4 2000-12-08 22:17:47 geuzaine Exp $ */
#ifndef _COLORS_H_ #ifndef _COLORS_H_
#define _COLORS_H_ #define _COLORS_H_
......
/* $Id: Const.h,v 1.5 2000-11-26 18:43:48 geuzaine Exp $ */
#ifndef _CONSTS_H_ #ifndef _CONSTS_H_
#define _CONSTS_H_ #define _CONSTS_H_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment