GOMC-WSU / GOMC

GOMC - GPU Optimized Monte Carlo is a parallel molecular simulation code designed for high-performance simulation of large systems
https://gomc-wsu.org
MIT License
73 stars 36 forks source link

GOMC should detect Forcefield files with duplicate dihedral definitions with the same periodicity #529

Open LSchwiebert opened 1 month ago

LSchwiebert commented 1 month ago

Is your feature request related to a problem? Please describe.

GOMC produces incorrect intrabond energies if the forcefield file includes duplicate dihedral entries (the same atoms) with the same periodicity (value of n). Since all of these entries are used in the energy calculation, duplicate energy changes are made, so the energy calculation is incorrect.

Describe the solution you'd like

GOMC should generate an informative error message and terminate.

Describe alternatives you've considered

N/A. The result is incorrect, but that may not be obvious, so better to terminate with an error so the force field file can be corrected.

Additional context

None.

LSchwiebert commented 1 month ago

Instead of terminating with an error, the patch will remove the duplicates and generate a warning. This way, the user knows that a modification has been made to do something other than what the forcefield input file requested.