-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to extend a force field? (Don't use inheritance) #103
Comments
Can you provide a complete input deck that reproduces this issue? As a general comment: it only makes sense to use the bond terms constraints if you need to distinguish a specific triplet using something other than the atom types. But I agree that the behaviour of |
See the end of this discussion for a workaround ("workaround 2")I posted several long comments. Feel free to skip to the end for my final recommendation. (Don't use inheritance. See "workaround 2".) It's actually not a bug. But your question reveals that I need to add more documentation. I'll do that today. |
This happens because when a force field inherits from another force-field there is a fundamental ambiguity regarding how wildcards ("*" or "?") are interpreted:
Workaround 1 (not recommended)You can clarify this using:
But you will still probably have issues. The same problem occurs for "@Atoms" as well as "@bonds" (and any other "@" variable).
And if you defined a new atom type in FF2 and you want to match it using *, you must clarify this the same way:
This method is ugly and treacherous. (It would be easy to accidentally cause moltemplate to think that you are trying to define a new atom type of type "@atom:a" in FF2, even if "@atom:a" already exists in FF1.) I have a better solution below. ("Workaround 2") |
This comment was marked as outdated.
This comment was marked as outdated.
Workaround 2 (recommended)I suggest you implement your forcefield extension this way instead:
Molecules that use the new force field version would import the new "ff2.lt" file.
That is how the LOPLS extension was implemented. Thanks for posting this question, by the way. |
Documentation updated in a few different places. Hopefully people will notice it in the future. (And if you want to share the new force-field you've created, please do!) I will leave this question open in case other people run into this problem. |
I have a force field which is an extension of another force field. The new force field is in it's own .lt file. Both force fields use 'Data XXX By Type', but I believe I found a bug. As an example if my new forcefield lt file is something like
then moltemplate fails to find the angles. After messing around with it for a bit, I found that it seems to be checking in the first forcefield file. The output from Moltemplate for generating 3-body interactions by atom/bond type looks similar to
If I remove the
@bond:*
variables from the data angles by type lines, it works correctly.The text was updated successfully, but these errors were encountered: