Commit 1801c532 authored by Olivier Lantsoght's avatar Olivier Lantsoght
Browse files

[MBsysPy] Other way to retrieve vector output name. To be checked on Mac (see !383).

parent 19102b50
......@@ -266,7 +266,15 @@ class MbsDirdyn(object):
for i in range(nb_user_output_vector):
size2 = self.mbs_dirdyn_ptr.contents.buffers[buffer_id + i].contents.nx + 1
user_out = np.copy(np.ctypeslib.as_array(self.mbs_dirdyn_ptr.contents.buffers[buffer_id + i].contents.tx, (size1, size2)))
name = os.path.basename(bytes_to_str(ctypes.string_at(libutilities.get_output_vector_label(i))))
# Name of the output vector should be recoverable with function
# 'libutilities.get_output_vector_label(i)' returning char*.
# However on MacOs (see comments of merge request !383) this
# does not work (pointer seems to be random).
name = os.path.basename(self.mbs_dirdyn_ptr.contents.buffers[buffer_id + i].contents.filename)[:-4]
len_prefix = len(self.get_options("resfilename"))
name = name[len_prefix + 1:]
self.results.outputs[name] = user_out
if self.mbs_dirdyn_ptr.contents.user_buffer.contents.nx:
......
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