Skip to content
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

combining rule not read from xml file when saving a .top file #1152

Closed
GuiLingfeng opened this issue Nov 11, 2023 · 4 comments
Closed

combining rule not read from xml file when saving a .top file #1152

GuiLingfeng opened this issue Nov 11, 2023 · 4 comments
Assignees

Comments

@GuiLingfeng
Copy link
Contributor

GuiLingfeng commented Nov 11, 2023

Bug summary

I was using mbuild.Compound().save() to generate a Gromacs topology file using the oplsaa xml file in which the geometic combining rule is specified <ForceField name="OPLS-AA" version="0.0.3" combining_rule="geometric"> but in the generated toplogy file the comb-rule is 2, i.e., Lorentz-Berthelot rules.
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ 1 2 yes 0.5 0.5
This issue should be related to

structure.combining_rule = combining_rule
.

Code to reproduce the behavior

Please include a code snippet that can be used to reproduce this bug.

import mbuild as mb
molecule = mb.load('CCCCCC', smiles = True)
molecule.save('hexane.top', forcefield_files='./ff_xml/oplsaa.xml', overwrite=True)

Software versions

  • Which version of mBuild are you using? 0.16.4
  • Which version of Python (python --version)? 3.10.12
  • Which operating system? Ubuntu WSL
@daico007
Copy link
Member

Since this is going through the Compound.save method, the combining rule is actually an option/parameter that need to be specified (and is actually default to lorentz, i.e., what's being written out). I can open a PR to make a new default option using that pulled from the force field XML instead. In the mean time, you can specify the combining_rule="geometric" in the save() call.

@daico007 daico007 self-assigned this Nov 11, 2023
@GuiLingfeng
Copy link
Contributor Author

Sounds good! Thanks!

@CalCraven
Copy link
Contributor

As Griffin and I were discussing, this issue as whole raises the concern that the mBuild tutorials are out of date. I think we need to raise this issue higher to either go through and update them or archive them altogether.

@daico007
Copy link
Member

I lean toward updating the old tutorials (and maybe append the newer one we created for CECAM to it too), just because those have a very solid instruction for the very basic of mbuild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants