From 7525b506c129d5190bd4ad1d11bfdccf3e516bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Tue, 2 Jan 2024 21:07:17 +0100 Subject: [PATCH] Prevent Brownian dynamics coupling of virtual sites (#4295) --- src/python/espressomd/thermostat.pyx | 5 ++--- testsuite/python/brownian_dynamics.py | 11 +---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/python/espressomd/thermostat.pyx b/src/python/espressomd/thermostat.pyx index 2af6fb25d18..0b00d7b8239 100644 --- a/src/python/espressomd/thermostat.pyx +++ b/src/python/espressomd/thermostat.pyx @@ -407,9 +407,6 @@ cdef class Thermostat: The same applies to ``gamma_rotation``, which requires the feature ``ROTATION`` to work properly. But also accepts three floats if ``PARTICLE_ANISOTROPY`` is also compiled in. - act_on_virtual : :obj:`bool`, optional - If ``True`` the thermostat will act on virtual sites, default is - ``False``. seed : :obj:`int` Initial counter value (or seed) of the philox RNG. Required on first activation of the Brownian thermostat. @@ -417,6 +414,8 @@ cdef class Thermostat: """ + assert act_on_virtual is False, "Brownian dynamics virtual sites coupling was disabled in ESPResSo 4.2.2" + scalar_gamma_def = True scalar_gamma_rot_def = True IF PARTICLE_ANISOTROPY: diff --git a/testsuite/python/brownian_dynamics.py b/testsuite/python/brownian_dynamics.py index 5682cce83ba..223340e159a 100644 --- a/testsuite/python/brownian_dynamics.py +++ b/testsuite/python/brownian_dynamics.py @@ -144,14 +144,6 @@ def test_07__virtual(self): np.testing.assert_almost_equal(np.copy(virtual.v), [1, 0, 0]) np.testing.assert_almost_equal(np.copy(physical.v), [0, 0, 0]) - virtual.pos = physical.pos = [0, 0, 0] - system.thermostat.set_brownian( - kT=0, gamma=1, gamma_rotation=1., act_on_virtual=True, seed=41) - system.integrator.run(1) - - np.testing.assert_almost_equal(np.copy(virtual.v), [0, 0, 0]) - np.testing.assert_almost_equal(np.copy(physical.v), [0, 0, 0]) - @utx.skipIfMissingFeatures(["ROTATION", "EXTERNAL_FORCES"]) def test_fix_rotation(self): system = self.system @@ -168,8 +160,7 @@ def test_fix_rotation(self): system.integrator.set_brownian_dynamics() system.integrator.run(3) np.testing.assert_allclose( - part.omega_lab, [ - 0, 0, 1.3 / 1.5], atol=1e-14) + part.omega_lab, [0, 0, 1.3 / 1.5], atol=1e-14) # noise only part.ext_torque = 3 * [0.]