From fcfe3916105f42eedec9c5369c427316e4915210 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 7 Mar 2017 08:36:29 +0000
Subject: [PATCH] little function for Aliaksei

---
 Common/Gmsh.cpp | 11 +++++++++++
 Common/Gmsh.h   |  1 +
 2 files changed, 12 insertions(+)

diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp
index 0f86c96b14..347dd118fa 100644
--- a/Common/Gmsh.cpp
+++ b/Common/Gmsh.cpp
@@ -347,6 +347,17 @@ int GmshBatch()
   return 1;
 }
 
+int GmshBatch(int argc, char **argv)
+{
+  new GModel();
+  GmshInitialize(argc, argv);
+  if(!Msg::GetGmshClient()) CTX::instance()->terminal = 1;
+  CTX::instance()->noPopup = 1;
+  GmshBatch();
+  GmshFinalize();
+  return 1;
+}
+
 int GmshFLTK(int argc, char **argv)
 {
 #if defined(HAVE_FLTK) && defined(HAVE_POST)
diff --git a/Common/Gmsh.h b/Common/Gmsh.h
index 2a29eacac6..abbd644b71 100644
--- a/Common/Gmsh.h
+++ b/Common/Gmsh.h
@@ -47,6 +47,7 @@ int GmshMergePostProcessingFile(const std::string &fileName);
 int GmshWriteFile(const std::string &fileName);
 int GmshFinalize();
 int GmshBatch();
+int GmshBatch(int argc, char **argv);
 int GmshFLTK(int argc=0, char **argv=0);
 
 #endif
-- 
GitLab