Skip to content

Commit

Permalink
LE: test on >1 cores
Browse files Browse the repository at this point in the history
  • Loading branch information
RudolfWeeber committed Jul 29, 2024
1 parent 63c73e3 commit 982fbc0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions testsuite/python/lees_edwards.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,18 +740,16 @@ def test_le_breaking_bonds(self):
@utx.skipIfMissingFeatures("LENNARD_JONES")
def run_lj_pair_visibility(self, shear_direction, shear_plane_normal):
"""
Simulate an LJ liquid under linear shear and verify forces.
Simulate LJ particles coming into contact under linear shear and verify forces.
This is to make sure that no pairs get lost or are outdated
in the short range loop. To have deterministic forces, velocity
capping is used rather than a thermostat.
in the short range loop.
"""
shear_axis, normal_axis = axis(
shear_direction), axis(shear_plane_normal)
system = self.system
system.part.clear()
system.time = 0
system.time_step = 0.1
system.box_l = 10, 10, 10
protocol = espressomd.lees_edwards.LinearShear(
shear_velocity=3, initial_pos_offset=5)
system.lees_edwards.set_boundary_conditions(
Expand All @@ -763,7 +761,8 @@ def run_lj_pair_visibility(self, shear_direction, shear_plane_normal):
pos=(0.1 * normal_axis, -0.8 * normal_axis),
v=(1.0 * shear_axis, -0.3 * shear_axis))
assert np.all(system.part.all().f == 0.)
tests_common.check_non_bonded_loop_trace(self, system)
tests_common.check_non_bonded_loop_trace(
self, system, cutoff=system.non_bonded_inter[0, 0].lennard_jones.get_params()["cutoff"] + system.cell_system.skin)

# Rewind the clock to get back the LE offset applied during force calc
system.time = system.time - system.time_step
Expand All @@ -773,14 +772,16 @@ def run_lj_pair_visibility(self, shear_direction, shear_plane_normal):
system.integrator.run(3)
if np.any(np.abs(system.part.all().f) > 0):
have_interacted = True
tests_common.check_non_bonded_loop_trace(self, system)
tests_common.check_non_bonded_loop_trace(
self, system, cutoff=system.non_bonded_inter[0, 0].lennard_jones.get_params()["cutoff"] + system.cell_system.skin)
system.time = system.time - system.time_step
tests_common.verify_lj_forces(system, 1E-7)
assert have_interacted

def test_zz_lj_pair_visibility(self):
# check that regular decomposition without fully connected doesn't catch the particle
system = self.system
system.box_l = 10, 10, 10
with self.assertRaises(AssertionError):
system.cell_system.set_regular_decomposition(
fully_connected_boundary=None)
Expand Down

0 comments on commit 982fbc0

Please sign in to comment.