Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
robotran
mbsysc
Commits
476eabea
Commit
476eabea
authored
Oct 14, 2020
by
Olivier Lantsoght
Browse files
[MBsysPy] Add user output vector in MbsResults of MbsDirdyn.
parent
5d7d5e60
Changes
2
Hide whitespace changes
Inline
Side-by-side
MBsysC/mbs_interface/MBsysPy/_mbsysc_loader/mbs_functions_c.py
View file @
476eabea
...
...
@@ -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
]
...
...
MBsysC/mbs_interface/MBsysPy/mbsyspy/mbs_dirdyn.py
View file @
476eabea
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment