Skip to content

Commit

Permalink
Always check for light atoms by maximum mass only.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Oct 15, 2024
1 parent d8aa2d4 commit 4665bcb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/somd2/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ def __init__(self, system, config):
# Link properties to the lambda = 0 end state.
self._system = _morph.link_to_reference(self._system)

# Set the default configuration options.

# Restrict the atomic properties used to define light atoms when
# applying constraints.
self._config._extra_args["check_for_h_by_max_mass"] = True
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

# Make sure that perturbable LJ sigmas aren't scaled to zero.
self._config._extra_args["fix_perturbable_zero_sigmas"] = True

# We're running in SOMD1 compatibility mode.
if self._config.somd1_compatibility:
from .._utils._somd1 import _make_compatible
Expand Down Expand Up @@ -150,16 +162,8 @@ def __init__(self, system, config):
"Unable to convert water topology to AMBER format for SOMD1 compatibility."
)

# Only check for light atoms by the maximum end state mass if running
# in SOMD1 compatibility mode. Ghost atoms are considered light when
# adding bond constraints. Also fix the LJ sigma for ghost atoms so
# it isn't scaled to zero.
# Ghost atoms are considered light when adding bond constraints.
self._config._extra_args["ghosts_are_light"] = True
self._config._extra_args["check_for_h_by_max_mass"] = True
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_perturbable_zero_sigmas"] = True

# Apply Boresch modifications to bonded terms involving ghost atoms to
# avoid spurious couplings to the physical system at the end states.
Expand All @@ -168,9 +172,6 @@ def __init__(self, system, config):

self._system = _boresch(self._system)

# Make sure there are no zero LJ sigmas for perturbable atoms.
self._config._extra_args["fix_perturbable_zero_sigmas"] = True

# Check for a periodic space.
self._check_space()

Expand Down

0 comments on commit 4665bcb

Please sign in to comment.