Skip to content

Commit

Permalink
Prevent Brownian dynamics coupling of virtual sites (espressomd#4295)
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Jan 2, 2024
1 parent ad3ac5d commit 7525b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
5 changes: 2 additions & 3 deletions src/python/espressomd/thermostat.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,15 @@ 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.
Must be positive.
"""

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:
Expand Down
11 changes: 1 addition & 10 deletions testsuite/python/brownian_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.]
Expand Down

0 comments on commit 7525b50

Please sign in to comment.