Skip to content

Commit

Permalink
Added python tests for new MassMatrix() function for Box, sphere & Cy…
Browse files Browse the repository at this point in the history
…linder

Signed-off-by: Jasmeet Singh <jasmeet0915@gmail.com>
  • Loading branch information
jasmeet0915 committed Jun 27, 2023
1 parent 22da159 commit 114d39c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/python_pybind11/test/Box_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@ def test_mass(self):
self.assertEqual(expectedMassMat, massMat)
self.assertEqual(expectedMassMat.mass(), massMat.mass())

massMat2 = box.mass_matrix()
self.assertEqual(expectedMassMat, massMat2)
self.assertEqual(expectedMassMat.diagonal_moments(), massMat2.diagonal_moments())
self.assertEqual(expectedMassMat.mass(), massMat2.mass())


if __name__ == '__main__':
unittest.main()
5 changes: 5 additions & 0 deletions src/python_pybind11/test/Cylinder_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ def test_mass(self):
self.assertEqual(expectedMassMat, massMat)
self.assertEqual(expectedMassMat.mass(), massMat.mass())

massMat2 = cylinder.mass_matrix()
self.assertEqual(expectedMassMat, massMat2)
self.assertEqual(expectedMassMat.diagonal_moments(), massMat2.diagonal_moments())
self.assertEqual(expectedMassMat.mass(), massMat2.mass())


if __name__ == '__main__':
unittest.main()
5 changes: 5 additions & 0 deletions src/python_pybind11/test/Sphere_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def test_mass(self):
self.assertEqual(expectedMassMat, massMat)
self.assertEqual(expectedMassMat.mass(), massMat.mass())

massMat2 = sphere.mass_matrix()
self.assertEqual(expectedMassMat, massMat2)
self.assertEqual(expectedMassMat.diagonal_moments(), massMat2.diagonal_moments())
self.assertEqual(expectedMassMat.mass(), massMat2.mass())

def test_volume_below(self):

r = 2
Expand Down

0 comments on commit 114d39c

Please sign in to comment.