diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index eeaa49507e6bea6467e005e6773051a341cdc43d..2decad5527e3ac0cd0f03529e7c76c85d73adf38 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -115,6 +115,9 @@ std::vector<std::pair<std::string, std::string> > GetUsage() #endif s.push_back(mp("Other options:", "")); s.push_back(mp("-", "Parse input files, then exit")); + s.push_back(mp("-new", "Create new model before merge next file")); + s.push_back(mp("-merge", "Merge next files")); + s.push_back(mp("-open", "Open next files")); #if defined(HAVE_FLTK) s.push_back(mp("-a, -g, -m, -s, -p", "Start in automatic, geometry, mesh, solver or " "post-processing mode")); @@ -396,6 +399,14 @@ void GetOptions(int argc, char *argv[]) CTX::instance()->files.push_back("-new"); i++; } + else if(!strcmp(argv[i] + 1, "open")) { + CTX::instance()->files.push_back("-open"); + i++; + } + else if(!strcmp(argv[i] + 1, "merge")) { + CTX::instance()->files.push_back("-merge"); + i++; + } else if(!strcmp(argv[i] + 1, "pid")) { fprintf(stdout, "%d\n", GetProcessId()); fflush(stdout); diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 1f3ce8f2301004b1fb3e9f867b8bcbb765a17a88..5b2cf7d9f3b9ec809e7fe302183615bb9419b720 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -158,9 +158,17 @@ int GmshBatch() Msg::Info("Started on %s", Msg::GetLaunchDate().c_str()); OpenProject(GModel::current()->getFileName()); - for(unsigned int i = 1; i < CTX::instance()->files.size(); i++){ + bool open = false; + for(unsigned int i = 0; i < CTX::instance()->files.size(); i++){ + if(i == 0 && CTX::instance()->files[0][0] != '-') continue; if(CTX::instance()->files[i] == "-new") new GModel(); + else if(CTX::instance()->files[i] == "-merge") + open = false; + else if(CTX::instance()->files[i] == "-open") + open = true; + else if(open) + OpenProject(CTX::instance()->files[i]); else MergeFile(CTX::instance()->files[i]); } @@ -239,11 +247,19 @@ int GmshFLTK(int argc, char **argv) // open project file and merge all other input files if(FlGui::getOpenedThroughMacFinder().empty()){ OpenProject(GModel::current()->getFileName()); - for(unsigned int i = 1; i < CTX::instance()->files.size(); i++){ + bool open = false; + for(unsigned int i = 0; i < CTX::instance()->files.size(); i++){ + if(i == 0 && CTX::instance()->files[0][0] != '-') continue; if(CTX::instance()->files[i] == "-new"){ GModel::current()->setVisibility(0); new GModel(); } + else if(CTX::instance()->files[i] == "-merge") + open = false; + else if(CTX::instance()->files[i] == "-open") + open = true; + else if(open) + OpenProject(CTX::instance()->files[i]); else MergeFile(CTX::instance()->files[i]); } diff --git a/doc/texinfo/commandline.texi b/doc/texinfo/commandline.texi index 4ff7de1c19ea05d5da3c147dbe136338009cc8eb..188cd3fff0d5bd9ee815101f0e942d00721f891e 100644 --- a/doc/texinfo/commandline.texi +++ b/doc/texinfo/commandline.texi @@ -115,6 +115,12 @@ OpenGL quad-buffered stereo rendering (requires special graphic card) @ftable @code @item - Parse input files, then exit +@item -new +Create new model before merge next file +@item -merge +Merge next files +@item -open +Open next files @item -a, -g, -m, -s, -p Start in automatic, geometry, mesh, solver or post-processing mode @item -pid diff --git a/doc/texinfo/opt_plugin.texi b/doc/texinfo/opt_plugin.texi index 04191d64c1967b45798fa68ceada9c8518a76f63..89eb3baa25809faab94705c63565addfd2e4656b 100644 --- a/doc/texinfo/opt_plugin.texi +++ b/doc/texinfo/opt_plugin.texi @@ -93,7 +93,7 @@ Default value: @code{0} @end table @item Plugin(Crack) -Plugin(Crack) creates a crack around the physical group +Plugin(Crack) creates a crack around the physical group `PhysicalGroup' of dimension `Dimension' (1 or 2). The plugin duplicates the vertices and the elements on the crack and stores them in a new discrete curve (Dimension = 1) or surface (Dimension = 2). The elements touching the crack on the negative side are modified to use the newly generated vertices. Numeric options: @table @code @item Dimension