Commit 6655a74b authored by Louis Beauloye's avatar Louis Beauloye
Browse files

[Ctypes] fix sensor, and data SWr

parent 02a74ec4
......@@ -349,7 +349,7 @@ class MbsData(object):
self.__xfidpt = self.__SWr = None
if self.Nxfrc:
self.__xfidpt = np.ctypeslib.as_array(self.mbs_data_ptr.contents.xfidpt, (self.Nxfrc+1,))
self.__SWr = np.ctypeslib.as_array(self.mbs_data_ptr.contents.SWr, (self.Nxfrc+1, 9+1))
self.__SWr = np.ctypeslib.as_array(self.mbs_data_ptr.contents.SWr[0], (self.Nxfrc+1, 9+1))
# User State
self.__ux = self.__ux0 = self.__uxd = None
......
......@@ -72,7 +72,7 @@ class MbsDirdyn(object):
self.mbs_dirdyn_ptr.contents.mbs_aux.contents.M[1][2],
self.mbs_dirdyn_ptr.contents.mbs_aux.contents.M[2][1],
self.mbs_dirdyn_ptr.contents.mbs_aux.contents.M[2][2])
# Path to user function used by partitionning modue
# Path to user function used by partitionning module
self.user_path = self.mbs.user_path
if not (user_path==None):
project_path = (self.mbs.project_path).decode("utf-8")
......@@ -190,7 +190,7 @@ class MbsDirdyn(object):
path = os.path.abspath(os.path.join(template_path, user_file))
module = imp.load_source(user_file[:-3], path)
self.user_cons_jdqd = module.user_cons_jdqd
self.ptrs_to_user_fcts["user_cons_jdqd"] = user_cons_jdqd_wrap(lambda h,Jac,mbs,tsim : self.user_cons_jdqd(self._jdqduserc, self.mbs, tsim))
self.ptrs_to_user_fcts["user_cons_jdqd"] = user_cons_jdqd_wrap(lambda h,Jac,mbs,tsim : self.user_cons_jdqd(self._jdqduserc, self.mbs))
# user_dirdyn
user_file = "user_dirdyn.py"
......@@ -235,7 +235,7 @@ class MbsDirdyn(object):
path = os.path.abspath(os.path.join(template_path, symb_file))
module = imp.load_source(symb_file[:-3], path)
self.mbs_cons_hJ = module.cons_hJ
self.ptrs_to_symb_fcts["mbs_cons_hJ"] = mbs_cons_hJ_wrap(lambda h,Jac,mbs,tsim : self.__callback_mbs_cons_hJ(self.mbs_cons_hJ,h,Jac))
self.ptrs_to_symb_fcts["mbs_cons_hJ"] = mbs_cons_hJ_wrap(lambda h,Jac,mbs,tsim : self.mbs_cons_hJ(self._h,self._Jac, self.mbs))
# mbs_cons_jdqd
......@@ -274,11 +274,6 @@ class MbsDirdyn(object):
return
# Callback function for function with advanced arguments
def __callback_user_cons_hJ(self, fun, h, Jac, tsim):
__h = np.ctypeslib.as_array(h, (self.mbs.Nuserc+1,))
__Jac = np.ctypeslib.as_array(Jac[0], (self.mbs.Nuserc+1,self.mbs.njoint+1))
fun(__h,__Jac,self.mbs,tsim)
def __callback_mbs_cons_hJ(self, fun, h, Jac):
if __DEBUG__ : print( "DEBUG>> callback_mbs_cons_hJ")
__h = np.ctypeslib.as_array(h, (self.mbs.Ncons+1,))
......
......@@ -163,7 +163,7 @@ class MbsSensor(object):
else:
id_ = self.id
self.mbs.sensor(self, self.mbs, id_)
self.__mbs_data.mbs_sensor(self, self.__mbs_data, id_)
def gensensor(self, id_=None):
"""
......@@ -193,7 +193,7 @@ class MbsSensor(object):
else:
id_ = self.id
self.mbs.gensensor(self, self.mbs, id_)
self.__mbs_data.mbs_gensensor(self, self.__mbs_data, id_)
@property
......
Supports Markdown
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