Skip to content

Commit

Permalink
Unit test HPMC pair potentials with multiple r_cut.
Browse files Browse the repository at this point in the history
This test fails on the current `trunk-major` branch and passes after the
fix.
  • Loading branch information
joaander committed Nov 26, 2024
1 parent a781767 commit 6c17e28
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hoomd/hpmc/pytest/test_pair_lennard_jones.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ def test_multiple_pair_potentials(mc_simulation_factory):
assert simulation.operations.integrator.pair_energy == pytest.approx(
expected=-3.0, rel=1e-5)

# check that individual energies are computed correctly with varying r_cut
lennard_jones_2.params[('A', 'A')] = dict(epsilon=2.0, sigma=1.0, r_cut=0)
assert simulation.operations.integrator.pair_energy == pytest.approx(
expected=-1.0, rel=1e-5)
assert lennard_jones_1.energy == pytest.approx(expected=-1.0, rel=1e-5)
assert lennard_jones_2.energy == pytest.approx(expected=0.0, abs=1e-5)


def test_logging():
hoomd.conftest.logging_check(
Expand Down

0 comments on commit 6c17e28

Please sign in to comment.