From be0380ba5a1e4e6669c0bfde3e4f76a9cd7f4b6a Mon Sep 17 00:00:00 2001
From: Francois Henrotte <francois.henrotte@ulg.ac.be>
Date: Thu, 21 Feb 2013 15:01:09 +0000
Subject: [PATCH] test for onelab-py

---
 contrib/onelab/python/OnelabClient.py |  1 -
 contrib/onelab/python/coin.geo        | 28 +++++++++++++++++++++++++++
 contrib/onelab/python/test.ol         |  2 --
 contrib/onelab/python/test.py         | 12 +++++++++---
 4 files changed, 37 insertions(+), 6 deletions(-)
 create mode 100644 contrib/onelab/python/coin.geo
 delete mode 100755 contrib/onelab/python/test.ol

diff --git a/contrib/onelab/python/OnelabClient.py b/contrib/onelab/python/OnelabClient.py
index a1af19b447..257f8fcb53 100755
--- a/contrib/onelab/python/OnelabClient.py
+++ b/contrib/onelab/python/OnelabClient.py
@@ -119,7 +119,6 @@ class client :
       print "python launch : "+ command + " -onelab "+ msg
       os.system(command + " -onelab " + name + " " + msg)
 
-
   def merge_file(self, filename) :
     if not self.socket :
       return
diff --git a/contrib/onelab/python/coin.geo b/contrib/onelab/python/coin.geo
new file mode 100644
index 0000000000..a65e52858d
--- /dev/null
+++ b/contrib/onelab/python/coin.geo
@@ -0,0 +1,28 @@
+
+DefineConstant[ refine = {0.1, 
+                          Path "Parameters/Geometry",
+                          Label "Refinement at corner"} ] ;
+
+lc = 0.1;
+
+a = 1.0;
+b = 1.0;
+h = 1.0;
+
+Point(1) = {0, 0, 0, lc*refine};
+Point(2) = {a, 0, 0, lc} ;
+Point(3) = {0, b, 0, lc} ;
+Point(4) = {a, -h, 0, lc} ;
+Point(5) = {-h, b, 0, lc} ;
+Point(6) = {-h, -h, 0, lc} ;
+
+Line(1) = {1,3} ;
+Line(2) = {3,5} ;
+Line(3) = {5,6} ;
+Line(4) = {6,4} ;
+Line(5) = {4,2} ;
+Line(6) = {2,1} ;
+
+Line Loop(1) = {1,2,3,4,5,6} ;
+Plane Surface(1) = {1};
+
diff --git a/contrib/onelab/python/test.ol b/contrib/onelab/python/test.ol
deleted file mode 100755
index 79463f51e7..0000000000
--- a/contrib/onelab/python/test.ol
+++ /dev/null
@@ -1,2 +0,0 @@
-Native.register(native, ./test.py);
-Native.run();
diff --git a/contrib/onelab/python/test.py b/contrib/onelab/python/test.py
index bb17cd41dd..f2c1b84058 100755
--- a/contrib/onelab/python/test.py
+++ b/contrib/onelab/python/test.py
@@ -13,9 +13,15 @@ D = oc.get_number('Group/D', 2, labels = {0:'zero', 1:'un', 2:'deux', 3:'trois'}
 #utf-8 are allowed everywhere (should be prefixed by 'u' in python 2, not required in python 3)
 #Omega = oc.get_string(u'Ω', u'∫(∂φ/∂α)³dx', help=u'ask someone@universe.org', choices = ['oui', 'non', u'peut-être'])
 
+modelName = 'coin'
+
+oc.merge_file(modelName + '.geo')
+
+print('Action=%s pour %s' %(oc.action,'python'))
 if oc.action != 'compute' :
   exit(0)
 
-#this is the solver code
-#print (A, B, C, str(Omega))
-print (A, B, C)
+oc.sub_client('gmsh', 'gmsh ' + modelName + '.geo -2')
+
+oc.merge_file(modelName + '.msh')
+
-- 
GitLab