From 34efbc71a65747d25026fa801c53444b9d2fd66d Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 13 Apr 2008 18:52:51 +0000 Subject: [PATCH] cleanup --- Box/Box.cpp | 38 ++++++++++++++++--------------------- Fltk/Main.cpp | 52 ++++++++++++++++++++++++--------------------------- 2 files changed, 40 insertions(+), 50 deletions(-) diff --git a/Box/Box.cpp b/Box/Box.cpp index 53a63669fd..53f7e4ca78 100644 --- a/Box/Box.cpp +++ b/Box/Box.cpp @@ -1,4 +1,4 @@ -// $Id: Box.cpp,v 1.50 2008-03-23 21:42:56 geuzaine Exp $ +// $Id: Box.cpp,v 1.51 2008-04-13 18:52:51 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -80,31 +80,25 @@ int GMSHBOX(int argc, char *argv[]) new GModel; OpenProject(CTX.filename); - if(gmsh_yyerrorstate) - ParUtil::Instance()->Abort(); - else { - for(unsigned int i = 1; i < CTX.files.size(); i++) - MergeFile(CTX.files[i].c_str()); - if(CTX.bgm_filename) { - MergeFile(CTX.bgm_filename); - if(PView::list.size()) - GModel::current()->getFields()->set_background_mesh(PView::list.size() - 1); - else - fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n"); - } - if(CTX.batch > 0) { - GModel::current()->mesh(CTX.batch); - CreateOutputFile(CTX.output_filename, CTX.mesh.format); - } - else if(CTX.batch == -1) - CreateOutputFile(CTX.output_filename, FORMAT_GEO); - ParUtil::Instance()->Barrier(__LINE__, __FILE__); - return 1; + for(unsigned int i = 1; i < CTX.files.size(); i++) + MergeFile(CTX.files[i].c_str()); + if(CTX.bgm_filename) { + MergeFile(CTX.bgm_filename); + if(PView::list.size()) + GModel::current()->getFields()->set_background_mesh(PView::list.size() - 1); + else + fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n"); } + if(CTX.batch > 0) { + GModel::current()->mesh(CTX.batch); + CreateOutputFile(CTX.output_filename, CTX.mesh.format); + } + else if(CTX.batch == -1) + CreateOutputFile(CTX.output_filename, FORMAT_GEO); + ParUtil::Instance()->Barrier(__LINE__, __FILE__); GmshFinalize(); - return 1; } diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index a939bf2a68..2367aebbfe 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.126 2008-03-23 21:42:57 geuzaine Exp $ +// $Id: Main.cpp,v 1.127 2008-04-13 18:52:51 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -78,34 +78,30 @@ int main(int argc, char *argv[]) if(CTX.batch) { Msg(INFO, "'%s' started on %s", cmdline.c_str(), currtime.c_str()); OpenProject(CTX.filename); - if(gmsh_yyerrorstate) - exit(1); - else { - for(unsigned int i = 1; i < CTX.files.size(); i++) - MergeFile(CTX.files[i].c_str()); - if(CTX.post.combine_time) - PView::combine(true, 2, CTX.post.combine_remove_orig); - if(CTX.bgm_filename) { - MergeFile(CTX.bgm_filename); - if(PView::list.size()) - GModel::current()->getFields()->set_background_mesh(PView::list.size() - 1); - else - Msg(GERROR, "Invalid background mesh (no view)"); - } - if(CTX.batch == 4) { - AdaptMesh(GModel::current()); - CreateOutputFile(CTX.output_filename, CTX.mesh.format); - } - else if(CTX.batch > 0) { - GModel::current()->mesh(CTX.batch); - CreateOutputFile(CTX.output_filename, CTX.mesh.format); - } - else if(CTX.batch == -1) - CreateOutputFile(CTX.output_filename, FORMAT_GEO); - else if(CTX.batch == -2) - GModel::current()->checkMeshCoherence(); - exit(0); + for(unsigned int i = 1; i < CTX.files.size(); i++) + MergeFile(CTX.files[i].c_str()); + if(CTX.post.combine_time) + PView::combine(true, 2, CTX.post.combine_remove_orig); + if(CTX.bgm_filename) { + MergeFile(CTX.bgm_filename); + if(PView::list.size()) + GModel::current()->getFields()->set_background_mesh(PView::list.size() - 1); + else + Msg(GERROR, "Invalid background mesh (no view)"); } + if(CTX.batch == 4) { + AdaptMesh(GModel::current()); + CreateOutputFile(CTX.output_filename, CTX.mesh.format); + } + else if(CTX.batch > 0) { + GModel::current()->mesh(CTX.batch); + CreateOutputFile(CTX.output_filename, CTX.mesh.format); + } + else if(CTX.batch == -1) + CreateOutputFile(CTX.output_filename, FORMAT_GEO); + else if(CTX.batch == -2) + GModel::current()->checkMeshCoherence(); + exit(0); } // Interactive Gmsh -- GitLab