Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the map option for fixing the ghost LJ sigma values #48

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/somd2/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(self, system, config):
self._config._extra_args["check_for_h_by_mass"] = False
self._config._extra_args["check_for_h_by_element"] = False
self._config._extra_args["check_for_h_by_ambertype"] = False
self._config._extra_args["fix_ghost_sigmas"] = True
self._config._extra_args["fix_perturbable_zero_sigmas"] = True

# Check for a periodic space.
self._check_space()
Expand Down
12 changes: 4 additions & 8 deletions src/somd2/runner/_somd1.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ def _make_compatible(system):
except KeyError:
raise KeyError("No perturbable molecules in the system")

# Store a dummy element and ambertype.
element_dummy = _SireMol.Element("Xx")
ambertype_dummy = "du"

for mol in pert_mols:
# Store the molecule info.
info = mol.info()
Expand All @@ -74,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 @@ -94,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
Loading