Skip to content

Commit

Permalink
utils: fix units of nonbondedCutoff calc
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed Jul 19, 2022
1 parent 879dc81 commit d906eda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pymatgen/io/openmm/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def get_input_set( # type: ignore
Args:
smiles: keys are smiles and values are number of that molecule to pack
density: the density of the system. density OR box must be given as an argument.
box: list of [xlo, ylo, zlo, xhi, yhi, zhi]. density OR box must be given as an argument.
box: list of [xlo, ylo, zlo, xhi, yhi, zhi] with coordinates given in Angstroms. Density OR box must be given as an argument.
Returns:
an OpenMM.InputSet
Expand Down
4 changes: 3 additions & 1 deletion pymatgen/io/openmm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ def parameterize_system(
forcefield_omm.registerTemplateGenerator(template.generator)

box_size = min(box[3] - box[0], box[4] - box[1], box[5] - box[2])
nonbondedCutoff = min(10, box_size // 2)
# NOTE: cutoff is in nm, not Angstrom!
# box_size is calculated in Angstrom. Convert to nm here
nonbondedCutoff = min(1, box_size // 20)
# TODO: Make insensitive to input units
periodic_box_vectors = np.array(
[
Expand Down

0 comments on commit d906eda

Please sign in to comment.