Skip to content

Commit

Permalink
fixed: distance for initial box was not set by default
Browse files Browse the repository at this point in the history
If the distance was not given explicitly as setup.distance, the default distance from
equil.DIST was not chosen. Note that the DIST[water] default was set to 1.0 again (instead
of 1.2) because for right now we want to be consistent with the SAMPL5 simulations.
We might set it to 1.2 later (to reduce problems with cutoffs in the box for small molecules)
  • Loading branch information
orbeckst committed Jun 28, 2016
1 parent fa74d12 commit b0e3b18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions mdpow/equil.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
# BOX <-- forcefields.get_solvent_model(id).coordinates


# TODO: change to water distance 1.2 in the future (1.0 for
# compatibility with our SAMPL5 runs)
#: minimum distance between solute and box surface (in nm)
DIST = {'water': 1.2, 'octanol': 1.5,'cyclohexane':1.5}
DIST = {'water': 1.0, 'octanol': 1.5, 'cyclohexane': 1.5}


class Simulation(Journalled):
Expand Down Expand Up @@ -186,7 +188,8 @@ def __init__(self, molecule=None, **kwargs):
raise ValueError(msg)
self.solventmodel = forcefields.get_solvent_model(self.solventmodel_identifier)

distance = kwargs.pop('distance', DIST[solvent])
distance = kwargs.pop('distance', None)
distance = distance if distance is not None else DIST[solvent]

self.solvent = AttributeDict(itp=self.solventmodel.itp,
box=self.solventmodel.coordinates,
Expand Down
2 changes: 1 addition & 1 deletion mdpow/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def equilibrium_simulation(cfg, solvent, **kwargs):
# custom mdp files
mdpfiles = get_mdp_files(cfg, Simulation.protocols)
try:
distance = cfg.get('setup','distance')
distance = cfg.get('setup', 'distance')
except KeyError:
distance = None # if no distance is specified, None = default

Expand Down

0 comments on commit b0e3b18

Please sign in to comment.