Commit 476eabea authored by Olivier Lantsoght's avatar Olivier Lantsoght
Browse files

[MBsysPy] Add user output vector in MbsResults of MbsDirdyn.

parent 5d7d5e60
......@@ -93,6 +93,9 @@ libutilities.mbs_set_warning_msg_fct_ptr.restypes = None
libutilities.mbs_set_error_msg_fct_ptr.argtypes = [mbs_messages_wrap]
libutilities.mbs_set_error_msg_fct_ptr.restypes = None
libutilities.get_output_vector_nb.argtypes = []
libutilities.get_output_vector_nb.restypes = ctypes.c_int
# LoadXML
libloadXML.mbs_info_reader.argtypes = [ctypes.c_char_p]
......
......@@ -27,6 +27,7 @@ from ..mbs_utilities import mbs_msg
# importing libraries
from .._mbsysc_loader.loadlibs import libmodules
from .._mbsysc_loader.loadlibs import libutilities
# =============================================================================
......@@ -259,6 +260,15 @@ class MbsDirdyn(object):
if self.mbs.nhu:
size2 = self.mbs_dirdyn_ptr.contents.buffers[buffer_id].contents.nx + 1
self.results.Lambda = np.copy(np.ctypeslib.as_array(self.mbs_dirdyn_ptr.contents.buffers[buffer_id].contents.tx, (size1, size2)))
buffer_id = buffer_id + 1
nb_user_output_vector = libutilities.get_output_vector_nb()
for i in range(nb_user_output_vector):
ignored_length = len(bytes_to_str(ctypes.string_at(self.mbs_dirdyn_ptr.contents.options.contents.resfilename)))
size2 = self.mbs_dirdyn_ptr.contents.buffers[buffer_id].contents.nx + i
user_out = np.copy(np.ctypeslib.as_array(self.mbs_dirdyn_ptr.contents.buffers[buffer_id].contents.tx, (size1, size2)))
name = os.path.basename(bytes_to_str(ctypes.string_at(self.mbs_dirdyn_ptr.contents.buffers[buffer_id].contents.filename)))[ignored_length:]
self.results.outputs[name] = user_out
if self.mbs_dirdyn_ptr.contents.user_buffer.contents.nx:
size = self.mbs_dirdyn_ptr.contents.user_buffer.contents.index
......
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