Skip to content

Commit ab7ff93

Browse files
committed
API: Wire more arguments through to_openmm_system
1 parent 008aefe commit ab7ff93

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/using/edges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For example, `Interchange.topology.get_positions()` will never include positions
1313

1414
### Existing charges are ignored by default
1515

16-
`Molecule` and `Topology` objects can store partial charges, but these are ignored by default in methods like `Interchange.from_smirnoff`. This is because partial charges in SMIRNOFF force fields are defined by sections in the force field. To override this behavior, use the `charge_from_molecules` argument. Be aware that charges, and as a result most physics, differ from what's perscribed by the contents of the force field.
16+
`Molecule` and `Topology` objects can store partial charges, but these are ignored by default in methods like `Interchange.from_smirnoff`. This is because partial charges in SMIRNOFF force fields are defined by sections in the force field. To override this behavior, use the `charge_from_molecules` argument. Be aware that charges, and as a result most physics, will differ from what's perscribed by the contents of the force field.
1717

1818
## Quirks of `from_openmm`
1919

openff/interchange/components/interchange.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ def to_openmm_simulation(
587587
integrator: "openmm.Integrator",
588588
combine_nonbonded_forces: bool = True,
589589
add_constrained_forces: bool = False,
590+
ewald_tolerance: float = 1e-4,
591+
hydrogen_mass: PositiveFloat = 1.007947,
590592
additional_forces: Iterable["openmm.Force"] = tuple(),
591593
**kwargs,
592594
) -> "openmm.app.simulation.Simulation":
@@ -614,6 +616,12 @@ def to_openmm_simulation(
614616
add_constrained_forces : bool, default=False,
615617
If True, add valence forces that might be overridden by constraints, i.e. call `addBond` or `addAngle`
616618
on a bond or angle that is fully constrained.
619+
ewald_tolerance : float, default=1e-4
620+
The value passed to `NonbondedForce.setEwaldErrorTolerance`
621+
hydrogen_mass : PostitiveFloat, default=1.007947
622+
The mass to use for hydrogen atoms if not present in the topology. If non-trivially different
623+
than the default value, mass will be transferred from neighboring heavy atoms. Note that this is currently
624+
not applied to any waters and is unsupported when virtual sites are present.
617625
additional_forces : Iterable[openmm.Force], default=tuple()
618626
Additional forces to be added to the system, e.g. barostats, that are not
619627
added by the force field.
@@ -655,6 +663,8 @@ def to_openmm_simulation(
655663
system = self.to_openmm_system(
656664
combine_nonbonded_forces=combine_nonbonded_forces,
657665
add_constrained_forces=add_constrained_forces,
666+
ewald_tolerance=ewald_tolerance,
667+
hydrogen_mass=hydrogen_mass,
658668
)
659669

660670
for force in additional_forces:

0 commit comments

Comments
 (0)