Skip to content

Commit

Permalink
fixed contact test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-7800 committed Oct 2, 2023
1 parent 97141dc commit 6ce4738
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions elastica/contact_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,8 @@ def apply_contact(
system_one.lengths,
system_two.position_collection,
system_two.director_collection,
system_two.radius,
system_two.length,
system_two.radius[0],
system_two.length[0],
):
return

Expand Down Expand Up @@ -945,7 +945,7 @@ def apply_contact(self, system_one: RodType, system_two: SystemType):
system_one.lengths,
system_two.position_collection,
system_two.director_collection,
system_two.radius,
system_two.radius[0],
):
return

Expand Down
4 changes: 2 additions & 2 deletions elastica/contact_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _prune_using_aabbs_rod_cylinder(
# d^T @ Q
cylinder_dimensions_in_local_FOR = np.array(
[cylinder_radius, cylinder_radius, 0.5 * cylinder_length]
).reshape(3)
)
cylinder_dimensions_in_world_FOR = np.zeros_like(cylinder_dimensions_in_local_FOR)
for i in range(3):
for j in range(3):
Expand Down Expand Up @@ -213,7 +213,7 @@ def _prune_using_aabbs_rod_sphere(

sphere_dimensions_in_local_FOR = np.array(
[sphere_radius, sphere_radius, sphere_radius]
).reshape(3)
)
sphere_dimensions_in_world_FOR = np.zeros_like(sphere_dimensions_in_local_FOR)
for i in range(3):
for j in range(3):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_contact_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def mock_sphere_init(self):
"Details of initialization are given in test_contact_specific_functions.py"

self.n_elems = 1
self.position = np.array([[0], [0], [0]])
self.director = np.array(
self.position_collection = np.array([[0], [0], [0]])
self.director_collection = np.array(
[[[1.0], [0.0], [0.0]], [[0.0], [1.0], [0.0]], [[0.0], [0.0], [1.0]]]
)
self.radius = 1.0
self.radius = np.array([1.0])
self.velocity_collection = np.array([[0.0], [0.0], [0.0]])
self.external_forces = np.array([[0.0], [0.0], [0.0]])
self.external_torques = np.array([[0.0], [0.0], [0.0]])
Expand Down

0 comments on commit 6ce4738

Please sign in to comment.