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

save hoomd_xml files #73

Closed
evanmiller326 opened this issue Feb 24, 2017 · 6 comments
Closed

save hoomd_xml files #73

evanmiller326 opened this issue Feb 24, 2017 · 6 comments

Comments

@evanmiller326
Copy link

In the ethane.py example it is possible to save .top and .gro files. It would be nice to save hoomd_xml, gsd and lammpsdata files as it is done in mbuild.

@summeraz
Copy link
Contributor

In mBuild when saving as .hoomdxml, .gsd, and .lammpsdata the save function is calling internal save_hoomdxml, save_gsd, and save_lammpsdata writers that actually take a ParmEd structure as an argument rather than an mBuild Compound (this conversion is performed within mBuild prior to calling the individual writers). So it should be easy to support saving ParmEd structures in these formats. However, in the long term what we would like to do is to add the save_hoomdxml, save_gsd, and save_lammpsdata functions to ParmEd, so that ParmEd is handling all of the saving. These are only incorporated into mBuild right now because ParmEd does not have writers for these file formats. I'm sure @ctk3b has a vision for how we should handle this in the short term, but it might be time for us to work on actually adding these writers into ParmEd

@mikemhenry
Copy link
Member

I think adding the writers into ParmEd makes the most sense long term but short term would it be easier to copy writing code from mbuild or import the mbuild save_hoomdxml function?

@summeraz
Copy link
Contributor

summeraz commented Feb 24, 2017

My mistake, the functions are write_hoomdxml, write_gsd, and write_lammpsdata.

As @mikemhenry suggested, these can be imported by using:

from mbuild.formats.hoomdxml import write_hoomdxml
from mbuild.formats.gsdwriter import write_gsd
from mbuild.formats.lammpsdata import write_lammpsdata

These functions are not currently included in the mBuild documentation, but we have actually been working on updating the documentation today, so I can make sure that soon information is available for those functions so you will know what arguments to pass.

@mikemhenry
Copy link
Member

Thanks! @evanmiller326 and I are presenting mbuild and foyer to our lab today and hoomd is pretty critical to our workflow.

@summeraz
Copy link
Contributor

Okay for now then (since we won't have the docs updated for a bit) it would probably be best to look at the source code for mBuild (in the formats directory). The writers are pretty well documented there, so that should give you an idea of what arguments you will need to pass to them.

@ctk3b
Copy link
Member

ctk3b commented Feb 27, 2017

I'm gonna close this now but for the record the straightforward way to access these writers is with Compound.save

E.g.

ethane.save('ethane.hoomdxml', forcefield_name='oplsaa')
ethane.save('ethane.hoomdxml', forcefield_files='my_ff.xml')

@ctk3b ctk3b closed this as completed Feb 27, 2017
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

4 participants