本文整理匯總了Python中mbwind.System.joint_reactions[:]方法的典型用法代碼示例。如果您正苦於以下問題:Python System.joint_reactions[:]方法的具體用法?Python System.joint_reactions[:]怎麽用?Python System.joint_reactions[:]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mbwind.System
的用法示例。
在下文中一共展示了System.joint_reactions[:]方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_solve_reactions
# 需要導入模塊: from mbwind import System [as 別名]
# 或者: from mbwind.System import joint_reactions[:] [as 別名]
def test_solve_reactions(self):
# Check it calls the Element method in the right order: down
# the tree from leaves to base. It must also reset reactions.
s = System()
c0 = RigidConnection('c0')
c1 = RigidConnection('c1')
c2 = RigidConnection('c2')
b1 = RigidBody('b1', 1)
b2 = RigidBody('b2', 1)
s.add_leaf(c0)
c0.add_leaf(c1)
c0.add_leaf(c2)
c1.add_leaf(b1)
c2.add_leaf(b2)
s.setup()
# Check elements' iter_reactions() are called
def mock_iter_reactions(element):
calls.append(element)
calls = []
import types
for el in s.elements.values():
el.iter_reactions = types.MethodType(mock_iter_reactions, el)
# Test
s.joint_reactions[:] = 3
s.solve_reactions()
self.assertEqual(calls, [b2, c2, b1, c1, c0])
assert_aae(s.joint_reactions, 0)