Skip to content

Commit

Permalink
Automatically keep charge constant unless user overrides.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Aug 9, 2024
1 parent edde734 commit 51b1cf4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/somd2/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,16 @@ def __init__(self, system, config):
if self._config.charge_difference != charge_diff:
_logger.warning(
f"The charge difference of {charge_diff} between the end states "
f"does not match the expected value of {self._config.charge_difference}. "
"Please specify the 'charge_difference' if you wish to keep the charge "
"constant."
f"does not match the specified value of {self._config.charge_difference}."
)

# The user value takes precedence.
if self._config.charge_difference != 0:
charge_diff = self._config.charge_difference

# Create alchemical ions.
if self._config.charge_difference != 0:
self._system = self._create_alchemical_ions(
self._system, self._config.charge_difference
)
self._system = self._create_alchemical_ions(self._system, charge_diff)

# Set the lambda values.
if self._config.lambda_values:
Expand Down

0 comments on commit 51b1cf4

Please sign in to comment.