Amber-MD / cpptraj

Biomolecular simulation trajectory/data analysis.
Other
139 stars 64 forks source link

Add energy decomposition (with PME) #1109

Closed drroe closed 1 month ago

drroe commented 1 month ago

Version 6.29.4.

Adds a new action command, enedecomp, which allows per-atom energy decomposition of a system:

  [help enedecomp]
        [<name>] [<mask>] [out <filename>]
        [ pme [cut <cutoff>] [dsumtol <dtol>] [ewcoeff <coeff>]
              [erfcdx <dx>] [skinnb <skinnb>] [ljswidth <width>]
              [order <order>] [nfft <nfft1>,<nfft2>,<nfft3>]

To make this work well under the hood and to avoid unnecessary duplication of code from the energy action, the entire Ewald framework was rewritten. There is also now a template class called PairListTemplate which can be assigned an "engine" class which should simplify (I hope) usage of pair lists going forward and replaces (and should be more robust than) the old hacky include/define framework (PairListLoop.h). I also managed to get about a 30% speedup over the old serial code for PME (so yay!).

The cool thing about this is that thanks to @andysim 's helPME library, we can fully decompose the nonbonded energies with PME, which is something that I think even SANDER doesn't do. I don't quite have the LJ PME decomposition fully working yet (I'm doing something wrong with the reciprocal term) but that's coming soon. This ended up taking about twice as long as I wanted to, but I think it will be worth it in the long run.

This can be sped up both via OpenMP and MPI. Adds a test, updates the manual.