36 Commits

Author SHA1 Message Date
Peter Eastman
74912095a9 Refactor reference PME (#5131) 2025-11-11 15:31:38 -08:00
Evan Pretti
05472c9a81 Update file headers (#5074)
* Replace SimTK-containing file headers

* Update file headers for new Tinker reader files added
2025-09-23 10:27:26 -07:00
Evan Pretti
f55abcaa5f Add constant potential method (#4870)
* Initial implementation of C++ API

* Add kernel interface and information for API generation

* API updates for updating electrode parameters

* Add serialization proxy for ConstantPotentialForce

* Update file headers

* Add CG error tolerance and fix units on getCharges() return value

* Initial implementation of matrix solver

* Fixes and conjugate gradient solver

* Try to fix Linux and Windows builds

* Make sure charge constraint target is on total charge

* Restore handling of exceptions like NonbondedForce since they won't involve electrode atoms

* Ameliorate numerical instability in constrained conjugate gradient

* Fix uninitialized pointers, memory leak, and style

* Set CG tolerance units in Python API

* Test ConstantPotentialForce serialization

* Read/write ExceptionsUsePeriodicBoundaryConditions as bool

* Improve constrained conjugate gradient robustness to roundoff error accumulation

* Recompute matrix if electrode atoms move due to setPositions()

* Tolerance is now in gradient (potential) units again

* Add neutralizing background correction

* Add Python API tests

* Fixes for CG and nonbonded exceptions

* Add initial tests checking against existing NonbondedForce behavior

* Expand test suite and fix some implementation issues

* Add additional tests using larger reference system

* Add Gaussian test

* Finish test against reference computation

* CPU platform implementation

* Fixes for compilation on some platforms

* Fixes for constant potential with AVX/AVX2

* Test linking CPU PME library to constant potential test directly

* Older SWIG versions don't support Python set to C++ set conversion

* Add user guide entry

* Increase speed of reference test

* Conditional building constant potential CPU test is unreliable

* Debugging

* Miscellaneous fixes and improvements for CI

* Cache charges so solver will not run if system and coordinates have not changed

* Preconditioner flag, stability, and automatic detection improvements

* Add GPU platform-specific constant potential kernel classes

* PME and device-host I/O changes to support constant potential

* Initial common constant potential implementation

* Constant potential fixes:

* Fix preconditioner PME position/charge save/restore logic

* Fix reduction synchronization in constant potential solver kernels

* Add double-float accumulation for conjugate gradient solver when
  double unsupported by hardware

* Improve conditioning of a test system, and make sure particles are in or
out of cutoff for consistency and ease of comparing between platforms

* Reorder guess charges for CG when atom reordering changes positions

* Remove PME queue for now

* Trying to debug optimized direct space derivative kernel

* Remove extraneous debugging lines

* Style updates; just make CPU preconditioner double precision

* Debugging updated optimized direct derivatives kernel for all but OpenCL CPU

* OpenCL CPU implementation of direct space derivatives, and cleanup

* Try to make test even shorter to not time out on CI

* Temporary - Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Remove debugging code and fix reduction synchronization

* Fix other reductions

* Debugging - are tests hanging or just slow on CI?

* Debugging

* Debugging

* Fix macro for case when double precision is available on hardware

* Remove changes for debugging again

* Try to improve matrix solver cache locality by uploading transpose

* Fixes for atom ordering and periodic images

* Can't rely on reorder listener for cell offset updates

* Test reducing number of contexts and timing for CI

* Debugging

* Remove timing code and revert debugging changes

* Matrix solver and plasma term optimizations

* Reduce CG solver kernel calls and downloads

* Don't read back convergence flag from global memory

* Update PME due to refactoring in master branch

* Faster matrix solver (1st step)

* Faster matrix solver for CUDA

* Faster matrix solver compatibility with non-CUDA platforms

* Matrix solver fixes

* Use warp shuffle reductions when possible

* Attempt to work around intermittent compiler crash in Intel CPU OpenCL

* Optimize CG solver kernel 1

* Rework CG solver so some kernels can use more than 1 block

* Don't run out of shared memory

* Asynchronously download convergence flag while clearing buffers

---------

Co-authored-by: Evan Pretti <pretti@sh03-17n15.int>
2025-09-12 13:55:50 -07:00
Peter Eastman
2f553a66c6 Continuing to refactor tests 2015-09-23 11:37:06 -07:00
peastman
4c6d48ba05 Added NonbondedForce::getPMEParametersInContext() 2015-09-03 11:54:33 -07:00
peastman
f66c9b6184 Simplification to reference platform tests 2015-03-19 13:41:06 -07:00
peastman
9c6011f8cc Implemented PME for triclinic boxes in reference platform 2014-12-09 10:35:33 -08:00
Jason Swails
f716900a31 Typo fix (represnted -> represented) and remove the execution permission bit
from all .cpp and .h files.
2014-04-05 09:38:34 -04:00
peastman
c9eef8cf65 Added option to explicitly set PME parameters 2014-03-11 12:42:44 -07:00
peastman
300758a54e Platform specific header files get installed. This allows plugins to be built with just an OpenMM installation, not a full source tree. 2013-07-08 16:34:35 -07:00
Peter Eastman
b723e4af33 Replaced lots of tabs with spaces 2013-03-22 21:42:19 +00:00
Peter Eastman
a566a07487 Added index bounds checking to lots of methods 2012-01-31 00:07:41 +00:00
Peter Eastman
3bcd80b397 Reduced size of PME grid, since it was being made unnecessarily large for the requested accuracy. 2010-07-07 18:41:16 +00:00
Peter Eastman
4fd3493af5 Made Ewald test cases run slightly faster 2010-06-03 20:12:18 +00:00
Peter Eastman
b06fc4a7a4 Moved SFMT into libraries folder, and restructured it to allow multiple independent random number generators 2010-05-10 20:39:57 +00:00
Peter Eastman
bcc6216dd0 Periodic box dimensions can be changed in the middle of a simulation 2010-05-07 20:48:48 +00:00
Peter Eastman
00b5aa4d46 Bug fixes 2010-03-04 21:25:17 +00:00
Peter Eastman
87815e8c1a Fixed an overly strict tolerance in a test case 2009-11-19 21:42:28 +00:00
Peter Eastman
a5a368d091 Bug fixes 2009-10-23 18:29:35 +00:00
Peter Eastman
b5eda392f2 Implemented new method for selecting Ewald and PME parameters 2009-10-23 00:24:52 +00:00
Rossen Apostolov
71d5992513 Comparison of the forces in the Ewald/PME reference tests is disabled by default. If set, they are compared to the double precision output from Gromacs. 2009-10-13 12:03:44 +00:00
Rossen Apostolov
6b0b0a26e9 New test systems for Ewald/PME methods. 2009-10-07 15:03:37 +00:00
Rossen Apostolov
d95e723d5a Updated the Ewald/PME tests. 2009-10-04 09:21:53 +00:00
Rossen Apostolov
21d6707456 Fixed a typo in Madelung energy formula. 2009-09-21 18:03:39 +00:00
Rossen Apostolov
fd64ac97e1 Ewald method potential is now compared to the exact value of the Madelung energy. 2009-09-21 17:23:44 +00:00
Rossen Apostolov
68ef42c078 New tests for Ewald and PME on both Reference and Cuda platforms. 2009-09-21 13:49:39 +00:00
Peter Eastman
15811b7c56 Periodic box size is specified by System rather than NonbondedForce 2009-09-12 00:46:43 +00:00
Peter Eastman
49aa594d4a Changes to fix compilation errors under Windows 2009-08-17 22:55:17 +00:00
Rossen Apostolov
68e02e809d Combined the Ewald and PME routines into a single one and added calculation of vdW interactions. 2009-07-17 13:17:52 +00:00
Peter Eastman
a402046652 Renamed OpenMMContext to Context 2009-07-14 21:46:06 +00:00
Rossen Apostolov
c66dd5a360 Implemented the PME method in the reference platform. 2009-07-07 16:00:42 +00:00
Peter Eastman
83d5792286 Automatically select Ewald parameters based on error tolerance 2009-07-02 18:21:24 +00:00
Peter Eastman
644cc275ab Moved header files into an openmm subdirectory 2009-04-21 20:52:40 +00:00
Peter Eastman
64493da664 Modified the API for lots of classes so that the number of particles/bonds/etc. need not be specified in the constructor. 2009-04-17 23:19:00 +00:00
Peter Eastman
29e3fa5762 Redesigned the API for specifying exclusions and 1-4 interactions. 2009-04-17 20:42:25 +00:00
Rossen Apostolov
d3b512ad95 Implemented the Ewald summation method in the reference platform. Preliminary cuda prototype is included. 2009-04-06 13:56:12 +00:00