Skip to content

Commit

Permalink
Make zero LJ sigma check consistent with Sire.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jun 4, 2024
1 parent 9326a91 commit 7326023
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/somd2/runner/_somd1.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ def _make_compatible(system):
# First fix zero LJ sigmas values.
##################################

# Create a null LJParameter.
null_lj = _SireMM.LJParameter()
# Tolerance for zero sigma values.
null_lj_sigma = 1e-9

for atom in mol.atoms():
# Get the end state LJ sigma values.
lj0 = atom.property("LJ0")
lj1 = atom.property("LJ1")

# Lambda = 0 state has a zero sigma value.
if lj0.sigma() == null_lj.sigma():
if abs(lj0.sigma().value()) <= null_lj_sigma:
# Use the sigma value from the lambda = 1 state.
edit_mol = (
edit_mol.atom(atom.index())
Expand All @@ -90,7 +90,7 @@ def _make_compatible(system):
)

# Lambda = 1 state has a zero sigma value.
if lj1.sigma() == null_lj.sigma():
if abs(lj1.sigma().value()) <= null_lj_sigma:
# Use the sigma value from the lambda = 0 state.
edit_mol = (
edit_mol.atom(atom.index())
Expand Down

0 comments on commit 7326023

Please sign in to comment.