Visualizing HOOMD results

963 views
Skip to first unread message

Michael Goytia

unread,
Aug 30, 2016, 6:20:26 PM8/30/16
to hoomd-users
Hello,

I am trying to figure out how to visualize results for the new version of HOOMD.

I was first trying to make my own .xyz file at the end of the simulation so after
 
hoomd.run(1000)

I  then run

system = system.data.system_data.take_snapshot(all=True)

Which I'm hoping store all data about particles in the variable system. However I get the error.

TypeError: unbound method take_snapshot() must be called with system_data instance as first argument (got nothing instead)


I am not sure how to define a variable in order to get the the positions from this snapshot. Once I get that information I want to make .xyz file. I then want to used a dcd file. Can hoomd.dump.dcd be used with a .xml or .xyz in order to visualize results in VMD

Thanks,

Michael Goytia 

Joshua Anderson

unread,
Aug 30, 2016, 7:21:35 PM8/30/16
to hoomd...@googlegroups.com
Yes, VMD can read hoomd XML files. It does not care if you write them out from hoomd or create them by some other means. "vmd -hoomd file.xml file.dcd"

You cannot call take_snapshot directly. You need to save a system data object "system = init.read_...(....)" and later use it: "snap = system.take_snapshot". There is nothing special about the name "system" it is a variable name that you assign in your script.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Phone: 734-647-8244
http://www-personal.umich.edu/~joaander/

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users+unsubscribe@googlegroups.com.
To post to this group, send email to hoomd...@googlegroups.com.
Visit this group at https://groups.google.com/group/hoomd-users.
For more options, visit https://groups.google.com/d/optout.

Michael Howard

unread,
Aug 31, 2016, 9:21:38 AM8/31/16
to hoomd-users
hoomd xml is still reasonably well-supported in the deprecated package (deprecated.dump.xml), so that would do the trick for vmd with a dcd file. The only thing that changed about it between 1.3 and 2.0 was that it requires a particle group.

Regards... Mike



On Tuesday, August 30, 2016 at 7:21:35 PM UTC-4, Joshua A. Anderson wrote:
Yes, VMD can read hoomd XML files. It does not care if you write them out from hoomd or create them by some other means. "vmd -hoomd file.xml file.dcd"

You cannot call take_snapshot directly. You need to save a system data object "system = init.read_...(....)" and later use it: "snap = system.take_snapshot". There is nothing special about the name "system" it is a variable name that you assign in your script.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Phone: 734-647-8244
http://www-personal.umich.edu/~joaander/

On Tue, Aug 30, 2016 at 6:20 PM, Michael Goytia <goy1...@gmail.com> wrote:
Hello,

I am trying to figure out how to visualize results for the new version of HOOMD.

I was first trying to make my own .xyz file at the end of the simulation so after
 
hoomd.run(1000)

I  then run

system = system.data.system_data.take_snapshot(all=True)

Which I'm hoping store all data about particles in the variable system. However I get the error.

TypeError: unbound method take_snapshot() must be called with system_data instance as first argument (got nothing instead)


I am not sure how to define a variable in order to get the the positions from this snapshot. Once I get that information I want to make .xyz file. I then want to used a dcd file. Can hoomd.dump.dcd be used with a .xml or .xyz in order to visualize results in VMD

Thanks,

Michael Goytia 

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.

Michael Goytia

unread,
Aug 31, 2016, 10:35:32 AM8/31/16
to hoomd-users
Thanks All for the response,

I know to see the method to the madness(I enjoy HOOMD). So If I understand this correctly I could still manually write out an initial shot .xml (manually as .dmp.xml is no longer in use in the current version) then use .dump.dcd to save the rest of the snapshots in binary the then visualize in vmd? This is in regards to versions 2.0.X and later 

Thanks,

Michael Goytia

Joshua Anderson

unread,
Aug 31, 2016, 10:42:32 AM8/31/16
to hoomd...@googlegroups.com
You do not need to write out xml files manually. I only stated that you *could* do that if you wanted to, as you specifically asked "Can hoomd.dump.dcd be used with a .xml or .xyz in order to visualize results in VMD" and the answer is yes.

dump.xml has not been removed from hoomd 2.0, only deprecated: <http://hoomd-blue.readthedocs.io/en/stable/module-deprecated-dump.html#hoomd.deprecated.dump.xml> which means it may be removed at some unspecified later time. In long term planning, I hope that someone from the community can step forward and write a gsd reader plugin for VMD. This is not a priority for me as I no longer use VMD for visualization.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Phone: 734-647-8244
http://www-personal.umich.edu/~joaander/

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users+unsubscribe@googlegroups.com.

Michael Goytia

unread,
Aug 31, 2016, 6:45:07 PM8/31/16
to hoomd-users
Hello all,

Thanks this helped immensely 

Michael Goytia
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.

François Landes

unread,
Oct 7, 2016, 9:33:05 AM10/7/16
to hoomd-users
Hello all,

my exact question is: What is the natural way to visualize trajectories produced in Hoomd?

I'm sorry I am new to HOOMD and MD in general. I tried really hard reading the docs and searching the web, but did not find a solution. Your answer above was not very clear to me. Since xml is now deprecated, what should one do?

For instance using VMD, I can read DCD files: there is no error, just warnings, which also show on working example xyz files. However my VMD screen remains black. It says I have 320 atoms and 100 frames, which is correct. But nothing appears. Maybe I just need to learn to use VMD? Or there's a trick?

I saw there is a possibility to send visuals in real-time to VMD, through TCP/IP. ( hoomd.analyze.imd ), but I want to do post-mortem visualization.

For now my only guess is to write down *.xyz files using (my_snap.particles.position) and (np.savetxt), but I wonder if there is better than this?

Best,
François
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.

Joshua Anderson

unread,
Oct 7, 2016, 10:28:18 AM10/7/16
to hoomd...@googlegroups.com
VMD requires both a structure file and a trajectory file. For HOOMD now, that means using an XML and DCD together. If you read only a DCD into VMD, particle type information does not get assigned and VMD does not know what color or radius to draw particles at. This is why XML is only deprecated, not removed. For now, continue to use XML if you want to use VMD for visualization. I hope one day that VMD has a direct GSD reader plugin, but right now I do not have time to implement such myself and hope that someone in the community will step up and contribute one.

If you wish to use GSD directly, OVITO (http://ovito.org/) has already implemented a GSD reader.

I will add visualization in VMD/OVITO to the list of basic tutorials to make this more clear to new users and explicitly list the necessary steps.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Phone: 734-647-8244
http://www-personal.umich.edu/~joaander/

To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users+unsubscribe@googlegroups.com.

François Landes

unread,
Oct 7, 2016, 10:52:44 AM10/7/16
to hoomd...@googlegroups.com
Thank you very much Joshua!
Indeed GSD support was added to ovito... 2 days ago! (right now only the -dev version has it)

Since I'm new, I don't care for VMD and will use ovito.

Hopefully someone will add GSD support to VMD some day soon.

Best and thank you for your awesome work!
François

--
You received this message because you are subscribed to a topic in the Google Groups "hoomd-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hoomd-users/Y02jRAzJ6Vw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hoomd-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages