Skip to content
Permalink
Browse files

np.copy

  • Loading branch information
RudolfWeeber committed Mar 26, 2020
1 parent 89e6dc9 commit e6838d81845a23e53b09e894da06fc7c66a750b4
Showing with 6 additions and 3 deletions.
  1. +6 −3 testsuite/python/lb_interpolation.py
@@ -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
@@ -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

0 comments on commit e6838d8

Please sign in to comment.
You can’t perform that action at this time.