115 Commits

Author SHA1 Message Date
Jeff Wagner
13c568d08d Fix leaked variable causing spurious template constraint assignment (#5236)
* fix 5234 and add test

* clean up docstring and standardize test name
2026-03-26 08:49:35 -07:00
Peter Eastman
834b1294a9 Residue templates can specify constraints (#5197)
* Residue templates can specify constraints

* Patched template generation preserves constraints
2026-02-09 13:29:40 -08:00
Peter Eastman
8eeee16de9 Templates can match whole molecules (#5181)
* Templates can match whole molecules

* addExtraParticles() supports molecule templates

* Documentation on molecule templates

* Bug fix
2026-01-30 11:16:39 -08:00
Christian Clauss
82703dff73 Fix typos discovered by codespell in Python files (#5173) 2025-12-30 12:21:00 -08:00
Evan Pretti
adfd84c273 Add LCPO method (#5130)
* Basic LCPO support

* Add basic test for LCPO from a prmtop file

* API for LCPOForce

* Started LCPO reference implementation

* Finished reference forces & test cases

* Use other test for finite difference since grid might have discontinuous forces

* Reference platform formatting

* Initial implementation of CPU platform

* Bugfixes

* More vectorization and improve neighbor list query speed

* Parallelize part of neighbor search

* Check box size for LCPO with periodic boundary conditions

* Fixes for updating parameters in context

* GBSAOBCForce doesn't use first & last indices for updates, so no need for this optimization here

* Changes to neighbor checking and optimization

* Fixes and minor changes

* Add global surface tension parameter

* Only process half of the pairs in the neighbor list

* Remove unnecessary checks

* Initial version of common platform implementation

* Asynchronously download neighbor list size

* Debugging

* Do pair precomputation in copyPairsToNeighborList

* Recompute interactions instead of scanning neighbor list in inner loop

* Condense position array before computations

* Also make neighbor count download asynchronous on device

* Fixes for kernel launching

* Topology-based LCPO parameter assignment

* Fixes, and use test system for LCPO with nucleic acids

* Always raise instead of warn when LCPO parameters can't be assigned

* Use Amber convention for phosphates
2025-12-11 13:28:36 -08:00
João Morado
eaf56f96bc Update AMOEBA XML, .prm files, and parsing of Tinker files (#5086)
* Correct AmoebaAngleTorsion in test_Amoeba18Nucleic of TestForceField

* Update processTinkerForceField to handle latest .prm Tinker files

* Update amoeba2018 XML files

* Update amoeba2013 XML files

* Update amoeba2009 XML files

* Adapt addTorTor to new format in the .prm files

* Fix TorsionTorsion

* Also update the total energy in test_Amoeba18Nucleic

* Update amoebabio18.prm

* Fix nucleic acid test energies

* Correct AmoebaAngleTorsionForce params

* Add new addTorTor to TinkerFiles

* Revert unit fix

* Change to .pdb file which Tinker likes

* Update test_Amoeba18BPTI

* Remove trailing zeros from XML files

* Leave trailing zeros only on 2018 ff

* New element names in 2018

* More digits for surfaceAreaFactor

* More digits for surfaceAreaFactor

* More digits

* Remove debugging print

* Add support to 2009 and 2013 AMOEBA ffs to processTinkerForceField.py

* Add FF specific residues XML files

* Delete old residuesFinal.xml

* Update AMOEBA XML ffs

* Update FFs

* Fix some formatting issues

* Fix "." in scientific notation

* Remove old assertions
2025-10-14 12:55:21 -07:00
João Morado
489e2c46a2 Cleanup TinkerReader, ForceField, and amoebaforces (#5080)
* Fresh branch refactoring the new AMOEBA code

* Finish cleaning up AmoebaAngleForce and AmoebaInPlaneAngleForce

* Cleanup AmoebaTorsionTorsionForce

* Cleanup AmoebaOutOfPlaneBend

* Cleanup AmoebaMultipoleForce

* Remove unnecessary gkForce

* Simplify usage of atomClasses in ForceField

* Formatting

* Fix type of class on WCA

* Simplify angle forces

* Add parsing of units to PiTorsion and StretchBond, and misc. formatting adjustments

* Update code per review feedback

* Clearly defined API for TorsionTorsion,  and correct matching for UB,

* Unindent break statements

* Raise ValueError if classes and types are mixed in a Urey-Bradley term definition
2025-10-14 08:59:01 -07:00
Evan Pretti
1a67542eef Make distinct parameter dictionaries for _TemplateAtomData by default (#5091) 2025-09-24 16:22:43 -07:00
Evan Pretti
0ad623417f Fix error message formatting related to bonds to extra sites (#5065) 2025-09-08 09:12:47 -07:00
Evan Pretti
4958ba269b Forbid LJPME when LJ uses CustomNonbondedForce (#5044) 2025-08-13 11:55:06 -07:00
Evan Pretti
1cf4277422 Additional explanation messages for special cases and tests 2025-07-23 15:56:43 -07:00
Evan Pretti
71208da2b0 Output more detailed messages when template matching fails 2025-07-23 10:43:34 -07:00
Evan Pretti
7abba925ea Add check for consistent force field/solvent model version 2025-07-03 15:30:04 -07:00
Evan Pretti
8664eb15ed Update CHARMM36 2024 with fixes and add updated water models 2025-07-02 09:41:30 -07:00
Evan Pretti
58b2a3210c Add test case for relative import within data directory 2025-06-05 11:46:15 -07:00
Evan Pretti
a4f8921d2d Add amber19-all, update documentation and tests 2025-05-02 15:24:34 -07:00
Evan Pretti
c4a9f1b41a Offset CMAP <Torsion> map indices and add test for correct assignment 2025-03-14 13:03:06 -07:00
Evan Pretti
cd8f19c519 Properly handle and test multiple registration of atom types without elements (#4795)
* Properly handle duplicate atom type definitions without elements

* Correct the description of a test in a docstring

* Correctly handle existing type without element and duplicate type with element

* Try to update actions/cache to v4
2025-02-12 16:10:33 -08:00
Evan Pretti
7abdccbbbf Reduce LennardJonesGenerator memory consumption with many NBFixPair-matching pairs (#4770)
* Include more cases in TestForceField.test_NBFix

* Reduce LennardJonesGenerator NBFIX memory consumption

* Restored test case to use multiple elements to avoid ambiguity
2025-01-17 17:08:08 -08:00
Peter Eastman
e62bdf6adb API improvements (#4437)
* Can use getPlatform() instead of getPlatformByName()

* More concise arguments for getState()
2024-02-13 15:29:55 -08:00
Peter Eastman
e2453f5ec1 Don't add extra bond between water hydrogens (#4219) 2023-09-07 12:42:58 -07:00
Alex Izvorski
f0bbea98cc Add OPC and OPC3 ion sets (#3819)
* copy opc ions and opc*standard.xml from b12c2e871b

* auto-merged files

* move charges to residue definition

* remove unmerged files

* add docs

* rename U to U4+

* rename Ag+, Tl+, Gd3+ and I- residue names

* fix O-H bond length typo

* add opc3 constraints test
2022-11-29 13:06:33 -08:00
Alex Izvorski
583471a616 OPC and OPC3 water (#3654)
* Add benchmarks from Amber20 benchmark suite to standard benchmark script

* Add ensemble option; don't change hydrogen mass in amber input files

* Download and extract .tar.gz using pure python code, no wget/tar dependencies

* Rename amber tests

* add opc and opc3 models

* update to match https://bioinformatics.cs.vt.edu/~izadi/OPC_Gromacs/opc.top

* opc box, converted from ambertools-22.0-py38h6177452_1/dat/leap/lib/opcbox.off

* change values to make serialized system match one created from prmtop as close as possible

* unit test for opc water

* opc - final values, match frcmod.opc; derivation in comments

* opc3 water - final values, shows derivation

* opc3box made from ambertools 22 dat/leap/lib/opc3box.off

* add opc3 water test

* add opc and opc3 to docs

* move tests to TestForceField.py

* move opc tests out of amoeba tests, oops

* move opcbox and opc3box pdb files

Co-authored-by: Alex Izvorski <alex@genesistherapeutics.ai>
2022-06-28 16:02:44 -07:00
Peter Eastman
7432ad8c1c Ensure bond lengths are set before creating forces that depend on them (#3493)
* Ensure bond lengths are set before creating forces that depend on them

* Minor formatting
2022-03-02 16:05:43 -08:00
Peter Eastman
33c694d4fd CustomNonbondedForce supports computed values (#3412)
* Reference implementation of computed values for CustomNonbondedForce

* CPU implementation of computed values for CustomNonbondedForce

* Common implementation of computed values for CustomNonbondedForce

* Serialization of computed values

* ForceField supports computed values
2022-01-27 12:12:00 -08:00
Peter Eastman
2f20fbe2ad Fixed error using AMOEBA 2018 with RNA (#3313) 2021-11-04 20:41:04 -07:00
Peter Eastman
d83c2724a4 Added GLYCAM (#3303)
* Added GLYCAM

* Improved tests and documentation

* Fixed incorrect external bonds
2021-10-29 15:56:44 -07:00
Peter Eastman
06767dde49 Added AMOEBA 2018 force field (#3299)
* Adding support for new AMOEBA features

* Support modern method of specifying in-plane angles

* Implemented stretch-torsions

* Implemented angle-torsions

* More AMOEBA fixes

* Bug fix

* Converted AMOEBA 2018 force field

* Added documentation for AMOEBA 2018

* Added a missing file for tests
2021-10-26 09:20:13 -07:00
Peter Eastman
b7c9526aa7 Check for keyword args to createSystem() that are never used (#3242)
* Check for keyword args to createSystem() that are never used

* Fixed incorrect arguments in test cases
2021-09-09 13:48:20 -07:00
Peter Eastman
654c6c9c37 Implicit solvent for modern force fields (#3214)
* Created OBC2 that works with current force fields

* Created HCT, OBC1, GBn, and GBn2 that works with current force fields

* Added documentation for GB models

* Updates to documentation and tests based on comments

* Added formula for screening parameter
2021-09-08 10:10:47 -07:00
Peter Eastman
a00aa6131d Support initialization scripts in force fields (#3167) 2021-07-05 09:42:41 -07:00
Peter Eastman
a8865f611b Allow custom template matchers for residues (#3161) 2021-06-30 12:38:04 -07:00
Peter Eastman
e53bdc5eab Top level Python module is now "openmm" (#3000)
* Top level Python module is now "openmm"

* Updated module names in examples

* Updated module names in documentation

* Updated module in CI scripts

* Added deprecation warning
2021-02-01 09:40:37 -08:00
Peter Eastman
c8a73c914d Made ordering of impropers more deterministic (#2992)
* Made ordering of impropers more deterministic

* Fixed typo
2021-01-25 09:44:15 -08:00
peastman
05e0c4f9d8 Do not alter mass of hydrogens in rigid water (#2975)
* Do not alter mass of hydrogens in rigid water

* Do not alter mass of hydrogens in rigid water
2021-01-05 13:18:20 -08:00
peastman
756b1d91fc Fixed errors in test case 2020-06-15 13:48:55 -07:00
peastman
5c83e4233b Added 2019 CHARMM polarizable force field 2020-06-11 15:20:10 -07:00
peastman
2ca67c5c85 Added drudeMass argument for setting mass of Drude particles 2020-03-31 15:54:50 -07:00
peastman
57d8503605 Improved behavior of rigidWater option 2020-01-16 16:07:16 -08:00
John Chodera
5e9ce68894 Remove requested lines of ffxml 2020-01-05 17:14:48 -08:00
John Chodera
4f48402f1b Fix typo, and add documentation for 'ordering' 2020-01-04 13:59:17 -08:00
John Chodera
12c9af48e3 Add a test for 'smirnoff' impropers mode 2020-01-04 12:45:27 -08:00
peastman
c6225e7ac8 Minor cleanup based on comments 2019-10-29 15:34:52 -07:00
peastman
d88ddb3b7a Allow multiple matching templates if they assign identical parameters 2019-10-28 11:27:22 -07:00
Andreas Krämer
b0dacea009 Changed forcefield to not use dispersion corrections for CHARMM 2019-08-08 19:45:24 -04:00
peastman
80d6bd3b9d CHARMM36 supports disulfide bonds 2018-04-06 10:59:07 -07:00
peastman
fea6d6f65b Added switchDistance option to ForceField.createSystem() 2018-02-20 16:05:44 -08:00
peastman
9f25f4faca Fixed bug in LennardJonesGenerator 2017-10-06 17:10:38 -07:00
Jason Swails
3ebef4c6a6 Tweak test 2017-05-24 21:48:00 -04:00
Jason Swails
f3be4bbc9c Fix test 2017-05-24 16:21:56 -04:00