Output total force between particles in HOOMD?

141 views
Skip to first unread message

zhang...@gmail.com

unread,
Sep 14, 2022, 11:27:02 AM9/14/22
to hoomd-users
Hi all,

Is there possible to output total force between particles in HOOMD?

many thanks!
Yunhan

Brandon Butler

unread,
Sep 14, 2022, 12:22:45 PM9/14/22
to hoomd...@googlegroups.com

Hey Yunhan,

Yes, you can access the total force acting on a particle through the local snapshot see (https://hoomd-blue.readthedocs.io/en/v3.4.0/module-hoomd-data.html#hoomd.data.ParticleLocalAccessBase).

If you want force specific look at the forces property of a potential object (https://hoomd-blue.readthedocs.io/en/v3.4.0/module-md-force.html#hoomd.md.force.Force.forces) or the local force buffers if you know the force has not changed since it was last evaluated (https://hoomd-blue.readthedocs.io/en/v3.4.0/module-md-force.html#hoomd.md.force.Force.cpu_local_force_arrays).

Best,

Brandon

--
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/af4590e3-9c69-4c07-bb2a-9eff4132aa59n%40googlegroups.com.
--
Brandon Butler
MolSSI Fellow
PhD Candidate, Chemical Engineering and Scientific Computing | Glotzer Lab, University of Michigan
Email: butl...@umich.edu

zhang...@gmail.com

unread,
Sep 15, 2022, 11:03:06 AM9/15/22
to hoomd-users
I see,  thanks a lot Brandon!

Sebastian R

unread,
Aug 3, 2023, 4:46:05 PM8/3/23
to hoomd-users
Hi, is this still valid in 4.0? I'm adding individual forces using 
logger = hoomd.logging.Logger()
logger.add(coulomb, quantities=['energies', 'forces'])
but I have no idea how to add the net force on particle 0, for example (how to integrate  hoomd.data.ParticleLocalAccessBase with logging). 

Thanks!
Sebastian 
Reply all
Reply to author
Forward
0 new messages