From da71fed91df687cd2479c3e0ba8ed8613e564feb Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 11 Mar 2008 20:06:26 +0000
Subject: [PATCH] example driver

---
 utils/misc/driver.cpp | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 utils/misc/driver.cpp

diff --git a/utils/misc/driver.cpp b/utils/misc/driver.cpp
new file mode 100644
index 0000000000..cc2924d15f
--- /dev/null
+++ b/utils/misc/driver.cpp
@@ -0,0 +1,27 @@
+// compile and install Gmsh as a library with
+//
+//   make install-lib
+//
+// Then compile this driver with "g++ driver.cpp -lGmsh"
+
+#include <stdio.h>
+#include <gmsh/Gmsh.h>
+#include <gmsh/GModel.h>
+#include <gmsh/MElement.h>
+
+int main(int argc, char **argv)
+{
+  GmshInitialize(argc, argv);
+  GModel *m = new GModel();
+  m->readGEO("../../tutorial/t5.geo");
+  m->mesh(3);
+  for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it){
+    printf("volume %d contains %d elements:\n", (*it)->tag(), (*it)->getNumMeshElements());
+    for(unsigned int i = 0; i < (*it)->getNumMeshElements(); i++)
+      printf(" %d", (*it)->getMeshElement(i)->getNum());
+    printf("\n");
+  }
+  m->writeMSH("test.msh");
+  m->writeUNV("test.unv");
+  GmshFinalize();
+}
-- 
GitLab