Commit 18c3bb96 by Christophe Geuzaine

small tweaks

parent 0931e8b5
Pipeline #1626 canceled with stage
in 16 minutes 5 seconds
......@@ -306,7 +306,7 @@ def ovectorstring(name, value=None, python_value=None, julia_value=None):
a.python_arg = "byref(" + api_name + "), byref(" + api_name_n + ")"
a.python_return = "_ovectorstring(" + api_name + ", " + api_name_n + ".value)"
a.julia_ctype = "Ptr{Ptr{Cchar}}, Ptr{Csize_t}"
a.julia_pre = (api_name + " = Vector{Ptr{Cstring}}(1)\n " +
a.julia_pre = (api_name + " = Vector{Ptr{Ptr{Cchar}}}(1)\n " +
api_name_n + " = Vector{Csize_t}(1)")
a.julia_arg = api_name + ", " + api_name_n
a.julia_post = ("tmp_" + api_name + " = unsafe_wrap(Array, " + api_name + "[1], " +
......@@ -1040,7 +1040,7 @@ class API:
")\n")
f.write(indent + "if ierr.value != 0:\n")
f.write(indent + " raise ValueError(\n")
f.write(indent + " \"" + c_name + " returned non-zero error code: \",\n")
f.write(indent + ' "' + c_name + ' returned non-zero error code: ",\n')
f.write(indent + " ierr.value)\n")
r = (["api__result__"]) if rtype else []
r += list((o.python_return for o in oargs))
......@@ -1117,7 +1117,8 @@ class API:
f.write('"""\n')
f.write("module " + m.name + "\n\n")
if level == 1:
f.write("const clib = \"libgmsh\"\n")
f.write('const clib = is_windows() ? "gmsh-' + self.api_version +
'" : "libgmsh"\n')
else:
f.write("import " + ("." * level) + "gmsh\n")
if c_mpath:
......
......@@ -18,7 +18,7 @@ Top-level functions
"""
module gmsh
const clib = "libgmsh"
const clib = is_windows() ? "gmsh-3.0" : "libgmsh"
"""
......@@ -232,7 +232,7 @@ List the names of all models.
Return `names'.
"""
function list()
api_names_ = Vector{Ptr{Cstring}}(1)
api_names_ = Vector{Ptr{Ptr{Cchar}}}(1)
api_names_n_ = Vector{Csize_t}(1)
ierr = Vector{Cint}(1)
ccall((:gmshModelList, gmsh.clib), Void,
......@@ -2943,7 +2943,7 @@ the 'data' for each data type.
Return `dataType', `numElements', `data'.
"""
function getListData(tag)
api_dataType_ = Vector{Ptr{Cstring}}(1)
api_dataType_ = Vector{Ptr{Ptr{Cchar}}}(1)
api_dataType_n_ = Vector{Csize_t}(1)
api_numElements_ = Vector{Ptr{Cint}}(1)
api_numElements_n_ = Vector{Csize_t}(1)
......
......@@ -12,7 +12,7 @@ model.add("t16")
factory.addBox(0,0,0, 1,1,1, 1)
factory.addBox(0,0,0, 0.5,0.5,0.5, 2)
factory.cut([(3,1)], [(3,2000)], 3)
factory.cut([(3,1)], [(3,2)], 3)
x = 0; y = 0.75; z = 0; r = 0.09
......
......@@ -13,7 +13,7 @@ model.add("t16")
factory.addBox(0,0,0, 1,1,1, 1)
factory.addBox(0,0,0, 0.5,0.5,0.5, 2)
factory.cut([(3,1)], [(3,2000)], 3)
factory.cut([(3,1)], [(3,2)], 3)
x = 0; y = 0.75; z = 0; r = 0.09
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment