Skip to content

Commit

Permalink
Make sure all LJ sigma values are non-zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed May 30, 2024
1 parent d1c5a27 commit 8cfc3c2
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/somd2/runner/_somd1.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,32 @@ def _make_compatible(system):
# Get an editable version of the molecule.
edit_mol = mol.edit()

#####################################
# First fix the ghost atom LJ sigmas.
#####################################
##################################
# First fix zero LJ sigmas values.
##################################

# Create a null LJParameter.
null_lj = _SireMM.LJParameter()

for atom in mol.atoms():
# Lambda = 0 state is a dummy, use sigma from the lambda = 1 state.
if (
atom.property("element0") == element_dummy
or atom.property("ambertype0") == ambertype_dummy
):
lj0 = atom.property("LJ0")
lj1 = atom.property("LJ1")
# 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():
# Use the sigma value from the lambda = 1 state.
edit_mol = (
edit_mol.atom(atom.index())
.set_property(
"LJ0", _SireMM.LJParameter(lj1.sigma(), lj0.epsilon())
)
.molecule()
)
# Lambda = 1 state is a dummy, use sigma from the lambda = 0 state.
elif (
atom.property("element1") == element_dummy
or atom.property("ambertype1") == ambertype_dummy
):
lj0 = atom.property("LJ0")
lj1 = atom.property("LJ1")

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

0 comments on commit 8cfc3c2

Please sign in to comment.