-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from a-ws-m/ff-switching
* Use OOP forcefields: new `forcefields.Forcefield` class to bundle all ff related information; overall, should be backwards compatible from a user perspective but enable much cleaner extensions to other FFs. * fix #112 (Make default water model forcefield-specific) * made system.top files real templates and use Python templating * Add pytest settings for VSCode * Add typehinting * Tests for _get_forcefield() correct solvation identifier test + all new functionality. * docs: Martini example (Jupyter notebook and input files) * update CHANGELOG Summary This PR #267 implements several changes to make it easier for end-users to implement their own forcefields. Most of these changes revolve around the `Forcefield` class, which stores the path dictionaries that were previously separate entities. To use a non-default forcefield, make a new `Forcefield` instance and then pass it to `Simulation` using the `forcefield` argument (now accepts either `str` for predefined force fields or a `Forcefield` instance). This argument is optional; passing a string value for forcefield will still work, it's simply converted behind the scenes. Additional changes/code clean-up: * The `system.top` and `system_octwet.top` files have been changed to be compatible with Python's built-in Template functionality. This makes the code a bit easier to understand. * Water models are now attributes of the individual forcefields, and are read directly from the corresponding watermodels.dat file. As I understand it, `GROMACS_WATER_MODELS` is a master list of all water models, some of which are only available for OPLS-AA. If this is correct, it might be good to phase this out. I have changed the core functions that used this: `get_solvent_model` and `get_solvent_identifier`. The only other places in the code where `GROMACS_WATER_MODELS` is used is in the tests and in `get_water_model`, a function which is also unused in the code base except in tests. * I have changed one test to check for equality rather than equivalence (`is` -> `==`).
- Loading branch information
Showing
18 changed files
with
15,876 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"[python]": { | ||
"editor.formatOnSave": true | ||
} | ||
}, | ||
"python.testing.pytestArgs": [ | ||
"mdpow" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
REMARK GENERATED BY TRJCONV | ||
TITLE This is an auto generated system | ||
REMARK THIS IS A SIMULATION BOX | ||
CRYST1 150.000 150.000 180.000 90.00 90.00 90.00 P 1 1 | ||
MODEL 1 | ||
ATOM 1 R1 BENZ 1 30.920 6.600 24.160 1.00 0.00 | ||
ATOM 2 R2 BENZ 1 28.820 5.000 23.610 1.00 0.00 | ||
ATOM 3 R3 BENZ 1 29.860 6.580 21.680 1.00 0.00 | ||
TER | ||
ENDMDL | ||
CONECT 1 2 | ||
CONECT 2 3 | ||
CONECT 1 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
include = | ||
integrator = steep | ||
dt = 0.02 | ||
nsteps = 1000 | ||
nstxout = 0 | ||
nstvout = 0 | ||
nstlog = 100 | ||
nstxtcout = 100 | ||
xtc-precision = 1000 | ||
rlist = 1.0 | ||
coulombtype = Reaction-Field | ||
rcoulomb = 1.0 | ||
epsilon_r = 15 | ||
vdw-type = cutoff | ||
vdw-modifier = Potential-shift-verlet | ||
rvdw = 1.0 | ||
constraints = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
include = | ||
dt = 0.005 | ||
nsteps = 25000 | ||
nstxout = 0 | ||
nstvout = 0 | ||
nstlog = 1000 | ||
nstxout-compressed = 1000 | ||
cutoff-scheme = Verlet | ||
coulombtype = Reaction-Field | ||
rcoulomb = 1.1 | ||
epsilon_r = 15 | ||
vdw-type = cutoff | ||
vdw-modifier = Potential-shift-verlet | ||
rvdw = 1.1 | ||
tcoupl = v-rescale | ||
tc-grps = System | ||
tau-t = 1.0 | ||
ref-t = 300 | ||
Pcoupl = c-rescale | ||
Pcoupltype = isotropic | ||
tau-p = 3.0 | ||
compressibility = 3e-4 | ||
ref-p = 1.0 | ||
refcoord_scaling = all |
Oops, something went wrong.