Closed uppittu11 closed 1 year ago
I will test this out and see if I can identify the issue.
I was able to reproduce the issue you have @uppittu11. Turn out this have to due with foyer Forcefield.apply
, specifically the use_residue_map
option. This option supposed to speed up the atomtyping and parametrization step by grouping residue by name (without checking underlying components), so when you create two compounds container with same name but different underlying particles, it will only atomtype the first one and copy the type info over to the other and cause the issue you posted above. I opened a PR in foyer to change the default of the use_residue_map
to False
since the user should be aware of the catch when deciding to use that speed up.
To fix your case right now (without having to wait for the foyer PR), you can supply the foyer_kwargs
({"use_residue_map": False}
) which will be passed to the atomtyping step.
Setting use_residue_map to false by default is a good quick change. We might add some sort of minimal checking beyond the name, e.g., similar to print_hierarchy where it compares a string representation of some of the underlying characteristics. I feel like a small, extra comparison would not add much computational overhead.
Bug summary I recently updated mbuild from a very old version (I don't recall which version) and ran into an issue where the wrong atom types were saved in my hoomdxml output file. I created a test system below to reproduce the issue. The GSD, hoomdxml, and lmp files all have the wrong atom types for the last 10 atoms in the attached output files (mbuild_outputs.zip). This doesn't seem like the intended output, but maybe I'm doing something wrong in this workflow. My mbuild, foyer, and gmso repos are all up to date at the time of this issue.
Is this only on my computer or does anyone else see the same results?
Code to reproduce the behavior
Output:
Software versions
python -c "import mbuild as mb; print(mb.__version__)"
) : 0.16.1python --version
)? 3.10.10