Logging velocity for all particles over all time steps

112 views
Skip to first unread message

molecular dynamics

unread,
Apr 5, 2022, 10:15:24 AM4/5/22
to hoomd-users
Hello all,

I am a CPARC student working with HOOMD with the goal of obtaining the viscosity of a molecular system using Green-Kubo relations. To accomplish this, I'll be using the integration of the velocity auto-correlation function, which requires the velocity of all particles over all time steps. I've been able to get the (x,y,z) velocity for all the particles in a single frame by initializing the simulation at a certain frame and using "system.particles.velocity". However, when I try to loop over the frames in the simulation or even manually change the frame without restarting the system, I get the error:
"**ERROR**: Cannot initialize more than once"
Does anybody have a script for obtaining these velocities, or if there is another method I should be using? I am self-taught in Python, so any help would be appreciated.

Thank you,
Drake Ghaderi

Joshua Anderson

unread,
Apr 6, 2022, 1:41:41 PM4/6/22
to hoomd...@googlegroups.com
Drake,

If you need to perform analysis on the particle velocities on every time step, use a custom operation. Use local snapshots for performance. There is a complete tutorial here: https://hoomd-blue.readthedocs.io/en/v3.0.0/tutorial/04-Custom-Actions-In-Python/00-index.html

If you need the velocity less often, you can save it to a GSD file for offline analysis.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/504a1cb1-d9f4-42ee-9e9b-096f818dc15dn%40googlegroups.com.

molecular dynamics

unread,
Apr 7, 2022, 9:42:13 AM4/7/22
to hoomd-users
Thank you very much for your prompt reply, I will give it a try!
Reply all
Reply to author
Forward
0 new messages