Code Monkey home page Code Monkey logo

Comments (6)

summeraz avatar summeraz commented on June 24, 2024

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

from foyer.

mikemhenry avatar mikemhenry commented on June 24, 2024

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?

from foyer.

summeraz avatar summeraz commented on June 24, 2024

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.

from foyer.

mikemhenry avatar mikemhenry commented on June 24, 2024

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

from foyer.

summeraz avatar summeraz commented on June 24, 2024

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.

from foyer.

ctk3b avatar ctk3b commented on June 24, 2024

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')

from foyer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.