Skip to content

Commit

Permalink
np.copy
Browse files Browse the repository at this point in the history
  • Loading branch information
RudolfWeeber committed Mar 26, 2020
1 parent 89e6dc9 commit e6838d8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions testsuite/python/lb_interpolation.py
Expand Up @@ -74,8 +74,10 @@ def test_interpolated_velocity(self):
self.system.integrator.run(250)
# Check interpolated vel at upper boundary. The node position is at
# box_l[0]-agrid/2.
np.testing.assert_allclose(self.lbf.get_interpolated_velocity(
[self.system.box_l[0] - AGRID / 2, 0, 0]), np.array([0, 0, V_BOUNDARY]))
np.testing.assert_allclose(
np.copy(self.lbf.get_interpolated_velocity(
[self.system.box_l[0] - AGRID / 2, 0, 0])),
np.array([0, 0, V_BOUNDARY]))

# Check interpolated velocity involving boundary and neighboring node
# The boundary node index is lbf.shape[0]-1, so -2 refers to the
Expand All @@ -84,7 +86,8 @@ def test_interpolated_velocity(self):
self.lbf.shape[0] - 2, 0, 0]
# The midpoint between the boundary and
# that node is box_l - agrid.
np.testing.assert_allclose(self.lbf.get_interpolated_velocity([self.system.box_l[0] - AGRID, 0, 0]),
np.testing.assert_allclose(
np.copy(self.lbf.get_interpolated_velocity([self.system.box_l[0] - AGRID, 0, 0])),
0.5 * (np.array([0, 0, V_BOUNDARY]) + node_next_to_boundary.velocity))

# Bulk
Expand Down

0 comments on commit e6838d8

Please sign in to comment.