From c64457a34e157b92ee3e01e6d26c80b80896dc80 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 10 Aug 2006 15:55:23 +0000 Subject: [PATCH] *** empty log message *** --- Box/Main.cpp | 4 +- Common/CommandLine.cpp | 73 ++++++++++++++++------------------- Fltk/Main.cpp | 4 +- doc/texinfo/command_line.texi | 14 +++---- 4 files changed, 45 insertions(+), 50 deletions(-) diff --git a/Box/Main.cpp b/Box/Main.cpp index 44b4b287af..adc8da5d87 100644 --- a/Box/Main.cpp +++ b/Box/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.62 2006-08-08 04:35:21 geuzaine Exp $ +// $Id: Main.cpp,v 1.63 2006-08-10 15:55:23 geuzaine Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -119,7 +119,7 @@ int GMSHBOX(int argc, char *argv[]) mai3d(THEM, CTX.batch); CreateOutputFile(CTX.output_filename, CTX.mesh.format); } - else + else if(CTX.batch == -1) CreateOutputFile(CTX.output_filename, FORMAT_GEO); ParUtil::Instance()->Barrier(__LINE__, __FILE__); return 1; diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index e5df6a24ea..91c4e6662e 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -1,4 +1,4 @@ -// $Id: CommandLine.cpp,v 1.73 2006-08-07 13:57:13 geuzaine Exp $ +// $Id: CommandLine.cpp,v 1.74 2006-08-10 15:55:23 geuzaine Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -75,12 +75,12 @@ void Print_Usage(char *name){ // the man page (doc/gmsh.1) Msg(DIRECT, "Usage: %s [options] [files]", name); Msg(DIRECT, "Geometry options:"); - Msg(DIRECT, " -0 Parse input files, output unrolled geometry, and exit"); + Msg(DIRECT, " -0 Output unrolled geometry, then exit"); Msg(DIRECT, "Mesh options:"); - Msg(DIRECT, " -1, -2, -3 Perform batch 1D, 2D and 3D mesh generation"); + Msg(DIRECT, " -1, -2, -3 Perform 1D, 2D or 3D mesh generation, then exit"); Msg(DIRECT, " -saveall Save all elements (discard physical group definitions)"); Msg(DIRECT, " -o file Specify mesh output file name"); - Msg(DIRECT, " -format string Set output mesh format (msh, unv, gref, stl, p3d)"); + Msg(DIRECT, " -format string Set output mesh format (msh, unv, mesh, stl, vrml)"); Msg(DIRECT, " -algo string Select mesh algorithm (iso, tri, aniso, netgen, tetgen)"); Msg(DIRECT, " -smooth int Set number of mesh smoothing steps"); Msg(DIRECT, " -optimize Optimize quality of tetrahedral elements"); @@ -92,7 +92,6 @@ void Print_Usage(char *name){ Msg(DIRECT, " -rand float Set random perturbation factor"); Msg(DIRECT, " -bgm file Load background mesh from file"); Msg(DIRECT, " -constrain Constrain background mesh with characteristic lengths"); - Msg(DIRECT, " -histogram Print mesh quality histogram"); Msg(DIRECT, " -extrude Use old extrusion mesh generator"); Msg(DIRECT, " -recombine Recombine meshes from old extrusion mesh generator"); #if defined(HAVE_FLTK) @@ -108,6 +107,7 @@ void Print_Usage(char *name){ Msg(DIRECT, " -display string Specify display"); #endif Msg(DIRECT, "Other options:"); + Msg(DIRECT, " - Parse input files, then exit"); #if defined(HAVE_FLTK) Msg(DIRECT, " -a, -g, -m, -s, -p Start in automatic, geometry, mesh, solver or post-processing mode"); #endif @@ -117,7 +117,7 @@ void Print_Usage(char *name){ Msg(DIRECT, " -nopopup Don't popup dialog windows in scripts"); Msg(DIRECT, " -string \"string\" Parse option string at startup"); Msg(DIRECT, " -option file Parse option file at startup"); - Msg(DIRECT, " -convert file file Perform batch conversion of views and meshes into latest file formats"); + Msg(DIRECT, " -convert file file Convert views and meshes into latest file formats, then exit"); Msg(DIRECT, " -version Show version number"); Msg(DIRECT, " -info Show detailed version information"); Msg(DIRECT, " -help Show this message"); @@ -176,7 +176,27 @@ void Get_Options(int argc, char *argv[]) if(argv[i][0] == '-') { - if(!strcmp(argv[i] + 1, "pid")) { + if(!strcmp(argv[i] + 1, "")) { + CTX.batch = -2; + i++; + } + else if(!strcmp(argv[i] + 1, "0")) { + CTX.batch = -1; + i++; + } + else if(!strcmp(argv[i] + 1, "1")) { + CTX.batch = 1; + i++; + } + else if(!strcmp(argv[i] + 1, "2")) { + CTX.batch = 2; + i++; + } + else if(!strcmp(argv[i] + 1, "3")) { + CTX.batch = 3; + i++; + } + else if(!strcmp(argv[i] + 1, "pid")) { fprintf(stdout, "%d\n", GetProcessId()); fflush(stdout); i++; @@ -201,22 +221,6 @@ void Get_Options(int argc, char *argv[]) CTX.initial_context = 4; i++; } - else if(!strcmp(argv[i] + 1, "0")) { - CTX.batch = -1; - i++; - } - else if(!strcmp(argv[i] + 1, "1")) { - CTX.batch = 1; - i++; - } - else if(!strcmp(argv[i] + 1, "2")) { - CTX.batch = 2; - i++; - } - else if(!strcmp(argv[i] + 1, "3")) { - CTX.batch = 3; - i++; - } else if(!strcmp(argv[i] + 1, "saveall")) { CTX.mesh.save_all = 1; i++; @@ -396,25 +400,16 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "format") || !strcmp(argv[i] + 1, "f")) { i++; if(argv[i] != NULL) { - if(!strcmp(argv[i], "msh") || - !strcmp(argv[i], "MSH") || !strcmp(argv[i], "gmsh")) { + if(!strcmp(argv[i], "msh")) CTX.mesh.format = FORMAT_MSH; - } - else if(!strcmp(argv[i], "unv") || - !strcmp(argv[i], "UNV") || !strcmp(argv[i], "ideas")) { + else if(!strcmp(argv[i], "unv")) CTX.mesh.format = FORMAT_UNV; - } - else if(!strcmp(argv[i], "gref") || - !strcmp(argv[i], "GREF") || !strcmp(argv[i], "Gref")) { - CTX.mesh.format = FORMAT_GREF; - } - else if(!strcmp(argv[i], "stl") || !strcmp(argv[i], "STL")) { + else if(!strcmp(argv[i], "mesh")) + CTX.mesh.format = FORMAT_MESH; + else if(!strcmp(argv[i], "stl")) CTX.mesh.format = FORMAT_STL; - } - else if(!strcmp(argv[i], "p3d") || - !strcmp(argv[i], "P3D") || !strcmp(argv[i], "Plot3D")) { - CTX.mesh.format = FORMAT_P3D; - } + else if(!strcmp(argv[i], "vrml")) + CTX.mesh.format = FORMAT_VRML; else { fprintf(stderr, ERROR_STR "Unknown mesh format\n"); exit(1); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index 6e02d25c5f..6c72121787 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.95 2006-08-08 04:35:23 geuzaine Exp $ +// $Id: Main.cpp,v 1.96 2006-08-10 15:55:23 geuzaine Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) mai3d(CTX.batch); CreateOutputFile(CTX.output_filename, CTX.mesh.format); } - else + else if(CTX.batch == -1) CreateOutputFile(CTX.output_filename, FORMAT_GEO); exit(0); } diff --git a/doc/texinfo/command_line.texi b/doc/texinfo/command_line.texi index 9022ea4503..1d263678d4 100644 --- a/doc/texinfo/command_line.texi +++ b/doc/texinfo/command_line.texi @@ -2,7 +2,7 @@ @ftable @code @item -0 -Parse input files, output unrolled geometry, and exit +Output unrolled geometry, then exit @end ftable @sp 1 @@ -11,15 +11,15 @@ Parse input files, output unrolled geometry, and exit @ftable @code @item -1, -2, -3 -Perform batch 1D, 2D and 3D mesh generation +Perform 1D, 2D or 3D mesh generation, then exit @item -saveall Save all elements (discard physical group definitions) @item -o file Specify mesh output file name @item -format string -Set output mesh format (msh, unv, gref, stl, p3d) +Set output mesh format (msh, unv, mesh, stl, vrml) @item -algo string -Select mesh algorithm (iso, tri, aniso, netgen) +Select mesh algorithm (iso, tri, aniso, netgen, tetgen) @item -smooth int Set number of mesh smoothing steps @item -optimize @@ -38,8 +38,6 @@ Set random perturbation factor Load background mesh from file @item -constrain Constrain background mesh with characteristic lengths -@item -histogram -Print mesh quality histogram @item -extrude Use old extrusion mesh generator @item -recombine @@ -83,6 +81,8 @@ Specify display @noindent Other options: @ftable @code +@item - +Parse input files, then exit @item -a, -g, -m, -s, -p Start in automatic, geometry, mesh, solver or post-processing mode @item -pid @@ -98,7 +98,7 @@ Parse option string at startup @item -option file Parse option file at startup @item -convert file file -Perform batch conversion of views and meshes into latest file formats +Convert views and meshes into latest file formats, then exit @item -version Show version number @item -info -- GitLab