molmod / yaff

Yaff is yet another force-field code
http://molmod.github.io/yaff
GNU General Public License v3.0
31 stars 18 forks source link

Lammps library #52

Closed stevenvdb closed 5 years ago

stevenvdb commented 5 years ago

First tests with a conda install of LAMMPS during Travis CI.

codecov-io commented 5 years ago

Codecov Report

Merging #52 into master will increase coverage by 0.23%. The diff coverage is 87.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
+ Coverage   82.07%   82.31%   +0.23%     
==========================================
  Files          91       94       +3     
  Lines       13586    13958     +372     
  Branches     1851     1934      +83     
==========================================
+ Hits        11151    11489     +338     
- Misses       2012     2027      +15     
- Partials      423      442      +19
Impacted Files Coverage Δ
yaff/pes/vlist.py 92.35% <ø> (+1.91%) :arrow_up:
yaff/pes/scaling.py 88.37% <0%> (+3.48%) :arrow_up:
yaff/pes/test/common.py 83.6% <100%> (+3.8%) :arrow_up:
yaff/__init__.py 100% <100%> (ø) :arrow_up:
yaff/sampling/utils.py 54.28% <100%> (+7.17%) :arrow_up:
yaff/pes/test/test_pair_pot.py 97.2% <100%> (-0.07%) :arrow_down:
yaff/sampling/test/test_utils.py 100% <100%> (ø) :arrow_up:
yaff/external/__init__.py 100% <100%> (ø)
yaff/external/liblammps.py 84.17% <84.17%> (ø)
yaff/external/lammpsio.py 87.83% <87.83%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6303b07...2559156. Read the comment docs.

stevenvdb commented 5 years ago

This PR implements a new ForcePart, which allows to outsource the calculation of noncovalent interactions to LAMMPS. Because interactions are tabulated (except for point-charge electrostatics), this should be compatible with any pair interaction available in Yaff.

Unit tests are included but only performed in Travis, where the LAMMPS library is installed using Conda. For Windows, no proper Conda package is available and the related unit tests are skipped in this case.

Information on how to use LAMMPS as a library is given in a new section of the Yaff manual. It should be possible to use it as a black box, by using the swap_noncovalent_lammps function. For a system with about 10 000 atoms, an NVT simulation runs about 7 times faster on a single core. Using LAMMPS in parallel, the speedup increases to 40 relative to a pure Yaff simulation.