From c0772538976d2ea9f36af47b128d81fdded6a327 Mon Sep 17 00:00:00 2001 From: henrik-dahl-pinholt <107730383+henrik-dahl-pinholt@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:14:03 -0400 Subject: [PATCH] Fixed sign discrepancy in spherical_well According to the description, the positive well depth should give attraction, before it gave repulsion. --- polychrom/forces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polychrom/forces.py b/polychrom/forces.py index 1f8fcf0..a081ed7 100644 --- a/polychrom/forces.py +++ b/polychrom/forces.py @@ -850,7 +850,7 @@ def spherical_well(sim_object, particles, r, center=[0, 0, 0], width=1, depth=1, """ force = openmm.CustomExternalForce( - "step(1+d) * step(1-d) * SPHWELLdepth * (1 + cos(3.1415926536*d)) / 2;" + "-step(1+d) * step(1-d) * SPHWELLdepth * (1 + cos(3.1415926536*d)) / 2;" "d = (sqrt((x-SPHWELLx)^2 + (y-SPHWELLy)^2 + (z-SPHWELLz)^2) - SPHWELLradius) / SPHWELLwidth" )