diff --git a/contrib/onelab/python/OnelabClient.py b/contrib/onelab/python/OnelabClient.py index a1af19b4471bd2214799cd5073445bc79cb60561..257f8fcb534c09c3096e14d73f55624b5966a13a 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 0000000000000000000000000000000000000000..a65e52858d422bbd18acebc1c9876ebded0b236f --- /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 79463f51e7665b85b585b2081d0a6d73a31ac3c8..0000000000000000000000000000000000000000 --- 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 bb17cd41dd649651f3958575ffd6c6a61f1bdb84..f2c1b840582a6781c7e210f0ee5f3e8722a39751 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') +