-
I am trying to implement a force clamp of the form where is the sum of all individual force contributions stored in In other words, I am trying to apply an operation to the total force sum in each time step, before the integration of velocities and positions is executed. Assuming the forces in the force vector are computed sequentially (is that the case?), I wonder whether I can introduce a I also tried to implement a Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Use hoomd-blue/hoomd/md/IntegratorTwoStep.cc Lines 98 to 113 in 6297fb3 |
Beta Was this translation helpful? Give feedback.
-
Hi @joaander, thank you for your answer, that is exactly what I am looking for! Can I access the net forces in a derived Python Could you point me to a sample implementation of a half-step hook, if there is one available? |
Beta Was this translation helpful? Give feedback.
Use
cpu_local_snapshot
(orgpu_local_snapshot
) in Python: https://hoomd-blue.readthedocs.io/en/v4.7.0/package-hoomd.html#hoomd.State.cpu_local_snapshotUse
ParticleData
from C++: https://github.com/glotzerlab/hoomd-blue/blob/trunk-patch/hoomd/ParticleData.hThe only demonstration of
HalfStepHook
I see in a code search (https://github.com/search?q=repo%3Aglotzerlab%2Fhoomd-blue%20half_step&type=code) is the unit test: https://github.com/glotzerlab/hoomd-blue/blob/trunk-patch/hoomd/md/pytest/test_half_step_hook.py