Commit 42112df4 authored by Louis Beauloye's avatar Louis Beauloye
Browse files

Options can be set with the run() function

parent 04b9d531
......@@ -420,7 +420,7 @@ class MbsDirdyn(object):
if __DEBUG__:
print("DEBUG>> MbsDirdyn pointer deleted.")
def run(self):
def run(self, **kwargs):
"""
Run a direct dynamics analysis.
......@@ -445,6 +445,8 @@ class MbsDirdyn(object):
self.__assign_symbolic_fct__()
self.mbs.__assign_symb_fct__()
self.set_options(**kwargs)
if not self.store_results:
libmodules.mbs_run_dirdyn(self.mbs_dirdyn_ptr, self.mbs.mbs_data_ptr)
else:
......@@ -861,7 +863,6 @@ class MbsDirdyn(object):
elif key == 'compute_Qc':
raise TypeError("{:} is list or numpy.ndarray, can not be casted from {:}.".format(key, type(value))).with_traceback(err.__traceback__) from None
def get_options(self, *args):
"""
Get the specified options for Dirdyn module.
......
......@@ -398,7 +398,7 @@ class MbsEquil(object):
if __DEBUG__:
print("DEBUG>> MbsEquil pointer deleted")
def run(self):
def run(self, **kwargs):
"""
Run a equilibrium analysis.
......@@ -423,6 +423,8 @@ class MbsEquil(object):
self.__assign_symbolic_fct__()
self.mbs.__assign_symb_fct__()
self.set_options(**kwargs)
libmodules.mbs_run_equil(self.mbs_equil_ptr, self.mbs.mbs_data_ptr)
if self.store_results:
......
......@@ -378,7 +378,7 @@ class MbsInvdyn(object):
libmodules.mbs_delete_invdyn(self.mbs_invdyn_ptr, self.mbs.mbs_data_ptr)
if __DEBUG__: print("DEBUG>> " + self.module_name + " pointer deleted")
def run(self):
def run(self, **kwargs):
"""
Run an inverse dynamics analysis
......@@ -397,6 +397,8 @@ class MbsInvdyn(object):
self.__assign_symbolic_fct__()
self.mbs.__assign_symb_fct__()
self.set_options(**kwargs)
if not self.store_results:
libmodules.mbs_run_invdyn(self.mbs_invdyn_ptr, self.mbs.mbs_data_ptr)
else:
......
......@@ -366,7 +366,7 @@ class MbsModal(object):
if __DEBUG__:
print("DEBUG>> " + self.module_name + " pointer deleted")
def run(self):
def run(self, **kwargs):
"""
Run a modal analysis.
......@@ -391,6 +391,8 @@ class MbsModal(object):
self.__assign_symbolic_fct__()
self.mbs.__assign_symb_fct__()
self.set_options(**kwargs)
libmodules.mbs_run_modal(self.mbs_modal_ptr, self.mbs.mbs_data_ptr)
if self.store_results:
self.load_results()
......
......@@ -287,7 +287,7 @@ class MbsPart(object):
return
def run(self):
def run(self, **kwargs):
"""
Run a coordinate partitioning.
......@@ -303,6 +303,8 @@ class MbsPart(object):
self.__assign_symbolic_fct__()
self.mbs.__assign_symb_fct__()
self.set_options(**kwargs)
libmodules.mbs_run_part(self.mbs_part_ptr, self.mbs.mbs_data_ptr)
# Unassign functions
......
......@@ -135,7 +135,7 @@ class MbsSolvekin(MbsInvdyn):
super().__load_symbolic_fct__(self.symbolic_path)
def run(self):
def run(self, **kwargs):
"""
Run an inverse dynamics analysis
......@@ -154,6 +154,8 @@ class MbsSolvekin(MbsInvdyn):
self.__assign_symbolic_fct__()
self.mbs.__assign_symb_fct__()
self.set_options(**kwargs)
if not self.store_results:
libmodules.mbs_run_solvekin(self.mbs_solvekin_ptr, self.mbs.mbs_data_ptr)
else:
......
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