Apply a non-constant custom force to a specific particle #2167
-
|
Hello everyone, I'm trying to simulate a rod consisting of 4 particles that moves in the direction of its first particle. `def angle(pos_state): Custom force for movementclass per_body_force(hoomd.md.force.Custom): custom_force = per_body_force(1) LANGEVINlangevin = hoomd.md.methods.Langevin( simulation.operations.integrator = hoomd.md.Integrator( simulation.operations.writers.append(gsd_writer) try: It doesn’t work as expected; I can see some unreasonable rotation, even though there is no randomness in the system.
2.I suspect that HOOMD internally reorders particles during the simulation (for domain decomposition or optimization).
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, you welcome to write whatever custom code you like.
Yes, the documentation makes a clear distinction between index order and tag order. The reordering increases performance by improving cache coherency and is employed even in serial execution.
I do not know. I think you are over-complicating the solution to your stated goal. To drive an active rod, you can use Here is a work-in-progress tutorial on active matter simulations that explains more: https://github.com/glotzerlab/hoomd-examples/tree/activity-tutorial/11-Active-Particles-In-MD |
Beta Was this translation helpful? Give feedback.
Yes, you welcome to write whatever custom code you like.
Yes, the documentation makes a clear distinction between index order and tag order. The reordering increases performance by improving cache coherency and is employed even in serial execution.