95 Commits

Author SHA1 Message Date
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
Peter Eastman
ccb83f1db9 GromacsTopFile supports vsite type 3fad (#5155) 2025-12-02 09:51:33 -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
939e0af545 Reader of Tinker files (#4769)
* Add basic version of TinkerFiles

* Refactor TinkerFiles

* Update docstring, type hints, and fix bug when setting box vectors

* Small fixes

* Add unit tests for the TinkerFiles class

* Fixes and updates to TinkerFiles

* Add simuteTinker example

* Update Modeller to work with AMOEBA force fields

* Small fixes

* Relax type hinting

* Fix indices in modeller

* Fix modeller indices

* Fix type hints and usage of Quantity

* Remove numpy protector

* Add reader of .seq files

* Add topology parsing of some protein residues, waters, ions, and generic molecules.

* Miscellaneous improvements

* Update amino acids and nucleotides list

* Various fixes to XML writing, and separate XML writing into a new class

* Comments/warnings

* Add nucleic topological definitions

* Improved handling of peptide residues

* Fix for CYX (disulfide bonds)

* Refactor the topology creation methods

* General improvements, and add support for nucleic-like residues

* No need to handle MP, DP, TP

* Minor improvements

* General refactoring, add automatic determination of topology

* Add TinkerAtomType dataclass, and remove references to biotypes as they are not needed

* Re-add missing parsing of forces and scalars

* Updates to createSystem()

* Add AMOEBA forces

* Add angle-related forces to createSystem

* Add placeholders for missing forces

* Beginning of support for AmoebaMultipoleForce

* Finished support for AmoebaMultipoleForce

* Support for AmoebaVdwForce

* TinkerFiles supports vdw

* Misc updates, and add AmoebaTorsionTorsion, AmoebaWcaDispersion, and AmoebaGeneralizedKirkwood

* Remove XML writer

* Fixes

* Fix wrong indentation in _findBitorsions

* Remove pdb debugging

* Documentation and fixes

* Remove files

* Revert checks in AmoebaVdwForceBuilder and ## @private  markers

* Remove duplicated static methods _getChiralAtomIndex

* Fix GK force

* Fix WcaDispersion force

* Fix WcaDisp

* Fixes and updates

* Cleanup and removing duplicated code

* Bug fixes

* A few more unit conversions

* Minor cleanup

* Misc fixes and updates

* Fix Add AmoebaStretchBendForce

* Simplify force builders

* Update ForceField

* Fix AmoebaPiTorsionForce

* Only add AmoebaWcaDispersionForce if using implicitSolvent

* Simplify amoebaforces

* Stretch torsion and angle torsion

* Misc. fixes

* Improve tests

* Fix cap group identification

* Add/improve tests

* Remove whitespaces from residue names

* Improve tests

* Consistent use of atomClasses list

* Fix match condition in AmoebaOutOfPlaneBendForceBuilder

* Fix AmoebaStretchBendForce

* Final fix for AmoebaStretchBendForce

* Fix AmoebaAngleForce

* Small fixes and improvements

* Update assertion tolerances

* Simplify torsion-torsion force creation

* Small fixes in the tests

* Review comments, type hints, docs for tinkerfiles.py

* Only use standard PDB for AA

* Type hint and docs for amoebaforces

* Reduce tolerances for failing tests

* Fixed error with ZOnly axis type when x particle is not specified

---------

Co-authored-by: peastman <peastman@stanford.edu>
2025-09-18 18:00:59 -07:00
feiglab
44524bd1e7 NBFIX in Gromacs for 1-4 pairs (#5050)
* fix to correctly read Gromacs topology files for CHARMM force field

* updated fix to correctly read topology files with NBFIX and different combination rules

* fixes to read topology files with NBFIX and different combination rules

* changed default for useDispersionCorrection to True

* changed docstring default for useDispersionCorrection to 'True'

* fix scaling of 1-4 LJ pairs when NBFIX is used

* apply NBFIXes to 1-4 pairs if no pair parameters are given

* rerun CI
2025-08-21 17:24:25 -07:00
feiglab
d2a5d7e409 fix for scaled 1-4 LJ interactions when NBFIX is present in Gromacs topology file (#5032)
* fix to correctly read Gromacs topology files for CHARMM force field

* updated fix to correctly read topology files with NBFIX and different combination rules

* fixes to read topology files with NBFIX and different combination rules

* changed default for useDispersionCorrection to True

* changed docstring default for useDispersionCorrection to 'True'

* fix scaling of 1-4 LJ pairs when NBFIX is used
2025-08-07 11:18:11 -07:00
feiglab
0a4edb841b Fix reading of Gromacs topologies created from CHARMM force field (#5026)
* fix to correctly read Gromacs topology files for CHARMM force field

* updated fix to correctly read topology files with NBFIX and different combination rules

* fixes to read topology files with NBFIX and different combination rules

* changed default for useDispersionCorrection to True

* changed docstring default for useDispersionCorrection to 'True'
2025-08-06 16:43:49 -07:00
Evan Pretti
8664eb15ed Update CHARMM36 2024 with fixes and add updated water models 2025-07-02 09:41:30 -07:00
Peter Eastman
fe0550bb7b Create bonds based on chem_comp_bond records (#4904)
* Create bonds based on chem_comp_bond records

* Fixed a test that assumed bonds would be in a particular order
2025-04-22 08:58:54 -07:00
Michael J. Schnieders
61a908cd1c Updates to AmoebaVdwForce, AmoebaGeneralizedKirkwoodForce and AmoebaWcaDispersionForce (#4647)
* Update the AMOEBA OpenMM API for vdW, GK and WCA

* Changes needed for the Corrigan et al Generalized Kirkwood model and minor changes to the vdW force to support CpHMD

* Add casts to real for uses of POW in GK; Pass force by reference within the WCA kernel

* Update swigInputConfig for Amoeba vdW and GK forces

* Update TestAPIUnits.testAmoebaVdwForce

* Set the units for getSolventDielectric and getSoluteDielectric to None

* Update default dispersion offset parameter for the AmoebaWcaDispersionForce

* Remove overloaded getParticleParameters and setParticleParameters from AmoebaGeneralizedKirkwoodForce

* Update the AmoebaWcaDispersionForce TestAPIUnits tests to reflect using the correct units for the C++ parameter default values; Update the alanine-dipeptide-amoeba-forces to reflect the updated GK model

* Move neck descreening constants into AmoebaGeneralizedKirkwoodForceImpl; set the default GK dielecticOffset to 0.09; set the default WCA shctd parameter to 0.82

* Fix Python test cases for WCA and GK

* Load AMOEBA/GK parameters into an array of float4

* Cleaned up the AmoebaGeneralizedKirkwoodForce based on feedback from Peter; the one case where backwards compatibility remains a challenge is application of the dielectric offset parameter - in the prior code this was only applied to the nonpolar cavity term, but not to calculation of Born radii; in this revision the dielectric offset is applied to BOTH the nonpolar cavity term and to calculation of Born radii. At this point I can't think of elegant way to maintain backwards compatibility that isn't confusing, nor does it make sense (at least to me) to only apply the concept of the dieletric offset to one aspect (i.e. only to nonpolar cavity or only to Born radii calculation) but not to both.

* Remove 'using std::vector' from AmoebaGeneralizedKirkwoodForceImpl.h; divide by 10 instead of multiplying by 0.1f in amoebaGk.cc

* Added a parameter called descreenOffset, which is applied during calculation of effective Born radii for GK. The parameter dielectricOffset is only used for the nonpolar cavity term consistent with its prior use. All tests in TestAmoebaGeneralizedKirkwoodForce.h are now backwards compatible with their behavior prior to this PR.

* Change two constants in amoebaGk.cc to single precision; Improved the documentation for getNeckConstants in AmoebaGeneralizedKirkwoodForceImpl.h

* Fix comment for setTanhRescaling in AmoebaGeneralizedKirkwoodForce.h, Fix comment for setTanhParameters in AmoebaReferenceGeneralizedKirkwoodForce.h; set the type of parameter GeneralizedKirkwoodTanhRescaling to bool in AmoebaGeneralizedKirkwoodForceProxy.cpp; In ReferenceCalcAmoebaGeneralizedKirkwoodForceKernel return references of per particle parameters instead of copies; update AmoebaReferenceKernels.h method signatures for per particle parameters to return const vector references

* Minor tweaks to the documentation for the tanh rescaling flag

* Improve the comments for the get and setTanhParameters in AmoebaGeneralizedKirkwoodForce.h and AmoebaReferenceGeneralizedKirkwoodForce.h
2024-11-20 12:18:10 -08:00
Alex Izvorski
fb50d37665 Fix formal charge reading from pdb files; store formal charges in topology (#4630)
* fix formal charge reading and writing in pdb files; store formal charge in topology

* use formalCharge in public api

* permissive reading

* fix writing

* fix

* add test for formal charges

---------

Co-authored-by: Alex Izvorski <alex@genesistherapeutics.ai>
2024-09-02 07:53:58 -07:00
Peter Eastman
51a112a336 GromacsTopFile supports virtual_sites3 function 4 (#4536) 2024-05-13 10:53:41 -07:00
Peter Eastman
25f4e9829f Support GROMACS files that use GROMOS force fields (#4028)
* Support GROMOS bond and angle types

* Support NBFIX with geometric combining rule

* Continuing GROMOS support

* Bug fixes

* Fixes to test case

* Update wrappers/python/openmm/app/gromacstopfile.py

Co-authored-by: Jason Swails <jason@entos.ai>

* Improve logic for handling dihedraltypes

---------

Co-authored-by: Jason Swails <jason@entos.ai>
2023-08-08 15:36:44 -07: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
d7da750ad3 GromacsTopFile supports three particle average vsites (#3634) 2022-06-10 16:56:26 -07:00
Peter Eastman
a6cd8c2263 Do not add constraints involving extra particles (#3506)
* Do not add constraints involving extra particles

* Added test case
2022-03-14 16:04:39 -07:00
Joe Greener
a76c2de14b Fix carboxylate atom radii in GB-Neck2 implicit solvent (#3505)
* Access atom element field

* Update GB-Neck2 force regression test
2022-03-08 11:51:41 -08:00
Peter Eastman
0993868a93 NBFIX is applied correctly to 1-4 interactions (#3324) 2021-11-11 15:43:53 -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
5cfa489f92 Improved handling of atoms with alternate locations (#3270)
* Improved handling of atoms with alternate locations

* Fixed a test failure caused by an invalid PDB file
2021-10-05 15:09:13 -07:00
kyw220
0118afa0ae Support of Amber FF19SB CMAP (#3143)
* Support of Amber FF19SB CMAP

* Update: Support of Amber FF19SB CMAP

Co-authored-by: Kye Won Wang <kyw220@sol.cc.lehigh.edu>
2021-06-21 10:59:41 -07:00
qiuzy
698769b901 fix Charmm NBThole calculation bug and Improper dihedral parameter match issue (#2952)
* nbthole

* Update charmmpsffile.py

* Update charmmpsffile.py

* Update charmmparameterset.py

fix multiple dihedral with the same periodicity and add a warning reminder for improper dihedral

* add test example for NBTHole

add system files of CYT-GUA-CYT DNA segment for testing NBThole

* Update TestCharmmFiles.py
2020-12-20 15:44:26 -08:00
peastman
5c83e4233b Added 2019 CHARMM polarizable force field 2020-06-11 15:20:10 -07:00
Zheng Gong
0c646acef0 bug fix for constraints and rigidWater in CharmmPsfFile 2020-03-16 16:50:13 +01:00
John Chodera
bf57b12eb3 Add missing test PDB file 2020-01-04 12:46:18 -08:00
peastman
c16db8e950 Fixed handling of insertion codes in PDBx/mmCIF files 2019-12-30 10:22:15 -08:00
Zheng Gong
71624456cd Add test for 1-2, 1-3 and 1-4 nonbonded exclusions 2019-12-10 11:51:46 +01:00
joaorodrigues
3a09cfe6c9 Modified test_addMembrane to be more thorough and use a realistic system. 2019-10-12 12:08:49 -07:00
peastman
a9ea2b9be1 Merge pull request #2397 from peastman/gbn2
Use correct parameters for nucleic acids with GBn2
2019-09-23 08:52:52 -07:00
peastman
12fa5430d0 Use correct parameters for nucleic acids with GBn2 2019-09-19 13:36:12 -07:00
peastman
0a21497098 Support all values of NBXMod in CHARMM parameter files 2019-09-05 12:31:49 -07:00
Andreas Krämer
1d3804dfc3 fixes for python2 and forcefield class 2019-08-06 10:37:49 -04:00
Andreas Krämer
040420761d Merge branch 'master' into charmmfixes 2019-08-02 20:31:55 -04:00
Andreas Krämer
59dfbc182b added broken tests for issue #2353 2019-08-02 19:16:13 -04:00
huangj
cbbc791146 Update the cgenff parameters files in tests/systems from version 3.1 to 4.1 2019-06-14 16:48:23 +08:00
egallicc
813772e874 Implementation of OPLS through DMS reader (#2199)
* Implementation of OPLS through DMS reader

* Improved Implementation of OPLS through DMS reader

* raise errors for invalid implicit solvent settings
2018-12-09 16:20:55 -08:00
huangj
ba8c16da99 Fix an indentation bug, and add a testcase for CHARMM Drude force field. 2018-08-01 23:51:20 +08:00
Peter Eastman
c30fa8e655 Support more features in Gromacs top files 2018-06-15 13:16:33 -07:00
peastman
d11c2f67ba Handle PDB files with altlocs correctly 2018-05-22 13:34:37 -07:00
Sunhwan Jo
0db10f6c2d add comment/modify test
- Test system is translated to the origin
- Energy is computed again after updating Gromacs input to reflect no-cutoff option (rcoulomb = rlist = rvdw = 0.0)
2018-03-06 01:24:03 -05:00
Sunhwan Jo
25e253cf48 add test case for virtual site/nbfix 2018-03-04 11:18:43 -05:00
João Rodrigues
42a6db2595 Changed format to 'pdbx' for consistency within the test framework. Added 'cif' to CMakeLists.txt for correctness for the future 2017-09-25 18:17:48 -07:00
João Rodrigues
9a5004bfa9 Added test for multiple chains in mmCIF files 2017-09-25 16:28:49 -07:00
peastman
b0c7239b67 Merge pull request #1560 from rafwiewiora/master
New code for impropers assignments
2017-05-05 09:45:43 -07:00
peastman
b37e257130 Merge pull request #1761 from jchodera/fix-charmm-impropers
Fix bug where CHARMM impropers did not respect toroidal boundary conditions
2017-04-25 13:58:57 -07:00
peastman
117ccbbf74 Created test case for CHARMM impropers fix 2017-04-25 11:39:45 -07:00
Rafal P. Wiewiora
4f11c10f56 move PDB to systems 2017-04-20 18:55:38 -04:00
peastman
fbf193fe36 Merge pull request #1778 from GrossfieldLab/improved-gromacs
Improved gromacs
2017-04-18 16:19:29 -07:00