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

"gmsh -convert file file" now also translates meshes into the newest
format (in addition to parsed->binary post-processing views)
parent 93c56994
No related branches found
No related tags found
No related merge requests found
// $Id: CommandLine.cpp,v 1.31 2004-04-18 03:07:44 geuzaine Exp $ // $Id: CommandLine.cpp,v 1.32 2004-04-21 23:14:47 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#endif #endif
extern Context_T CTX; extern Context_T CTX;
extern Mesh *THEM;
char *TheFileNameTab[MAX_OPEN_FILES]; char *TheFileNameTab[MAX_OPEN_FILES];
char *TheBgmFileName = NULL, *TheOptString = NULL; char *TheBgmFileName = NULL, *TheOptString = NULL;
...@@ -93,7 +94,7 @@ void Print_Usage(char *name){ ...@@ -93,7 +94,7 @@ void Print_Usage(char *name){
Msg(DIRECT, " -link int select link mode between views (default: 0)"); Msg(DIRECT, " -link int select link mode between views (default: 0)");
Msg(DIRECT, " -smoothview smooth views"); Msg(DIRECT, " -smoothview smooth views");
Msg(DIRECT, " -combine combine input views into multi time step ones"); Msg(DIRECT, " -combine combine input views into multi time step ones");
Msg(DIRECT, " -convert file file convert all views in a file into binary views"); Msg(DIRECT, " -convert file file perform batch conversion of view(s)/mesh into new file formats");
Msg(DIRECT, "Display options:"); Msg(DIRECT, "Display options:");
Msg(DIRECT, " -nodb disable double buffering"); Msg(DIRECT, " -nodb disable double buffering");
Msg(DIRECT, " -fontsize int specify the font size for the GUI (default: 12)"); Msg(DIRECT, " -fontsize int specify the font size for the GUI (default: 12)");
...@@ -263,11 +264,20 @@ void Get_Options(int argc, char *argv[], int *nbfiles) ...@@ -263,11 +264,20 @@ void Get_Options(int argc, char *argv[], int *nbfiles)
else if(!strcmp(argv[i] + 1, "convert")) { else if(!strcmp(argv[i] + 1, "convert")) {
i++; i++;
CTX.terminal = 1; CTX.terminal = 1;
CTX.batch = 1;
if(argv[i] && argv[i + 1]) { if(argv[i] && argv[i + 1]) {
MergeProblem(argv[i]); OpenProblem(argv[i]);
// convert post-processing views to latest (binary) format
for(int j = 0; j < List_Nbr(CTX.post.list); j++) for(int j = 0; j < List_Nbr(CTX.post.list); j++)
WriteView((Post_View *) List_Pointer(CTX.post.list, j), WriteView((Post_View *) List_Pointer(CTX.post.list, j),
argv[i + 1], 1, j ? 1 : 0); argv[i + 1], 1, j ? 1 : 0);
// convert any mesh to the latest format
if(THEM){
if(Tree_Nbr(THEM->Vertices)){
CTX.mesh.msh_file_version = 2.0;
Print_Mesh(THEM, argv[i + 1], FORMAT_MSH);
}
}
} }
else else
fprintf(stderr, "Usage: %s -convert file file\n", argv[0]); fprintf(stderr, "Usage: %s -convert file file\n", argv[0]);
......
// $Id: Main.cpp,v 1.61 2004-04-19 07:42:24 geuzaine Exp $ // $Id: Main.cpp,v 1.62 2004-04-21 23:14:47 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -80,6 +80,20 @@ int main(int argc, char *argv[]) ...@@ -80,6 +80,20 @@ int main(int argc, char *argv[])
exit(0); exit(0);
} }
// Initialize the static Mesh
M.Vertices = NULL;
M.Simplexes = NULL;
M.Points = NULL;
M.Curves = NULL;
M.SurfaceLoops = NULL;
M.EdgeLoops = NULL;
M.Surfaces = NULL;
M.Volumes = NULL;
M.PhysicalGroups = NULL;
M.Partitions = NULL;
M.Metric = NULL;
// Configuration files and command line options // Configuration files and command line options
Get_Options(argc, argv, &nbf); Get_Options(argc, argv, &nbf);
...@@ -102,20 +116,6 @@ int main(int argc, char *argv[]) ...@@ -102,20 +116,6 @@ int main(int argc, char *argv[])
if(CTX.default_plugins) if(CTX.default_plugins)
GMSH_PluginManager::instance()->registerDefaultPlugins(); GMSH_PluginManager::instance()->registerDefaultPlugins();
// Initialize the static Mesh
M.Vertices = NULL;
M.Simplexes = NULL;
M.Points = NULL;
M.Curves = NULL;
M.SurfaceLoops = NULL;
M.EdgeLoops = NULL;
M.Surfaces = NULL;
M.Volumes = NULL;
M.PhysicalGroups = NULL;
M.Partitions = NULL;
M.Metric = NULL;
// Signal handling // Signal handling
signal(SIGINT, Signal); signal(SIGINT, Signal);
......
...@@ -62,7 +62,7 @@ smooth views ...@@ -62,7 +62,7 @@ smooth views
@item -combine @item -combine
combine input views into multi time step ones combine input views into multi time step ones
@item -convert file file @item -convert file file
convert all views in a file into binary views perform batch conversion of view(s)/mesh into new file formats
@end ftable @end ftable
@sp 1 @sp 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment