On Mar 31, 2023, at 2:41 PM, Benjamin Sykes <bb...@email.unc.edu> wrote:
Hi,I am attempting to change the particle orientation so that they face the point (0,0) in the center of my 2d box, but I am running into issues when y< 0. When y is less than 0, the particles orient toward the left side of the box rather than the center. It works correctly if y>0 which seems even stranger to me. I have attached the custom action I am using to accomplish this.
--
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/649a19af-8dfe-45ce-9bdf-74e0ca831d29n%40googlegroups.com.
<rereorient(2).py>
Active computes an active force and torque on all particles selected by the filter:\begin{split}\vec{F}_i = \mathbf{q}_i \vec{f}_i \mathbf{q}_i^* \\\vec{\tau}_i = \mathbf{q}_i \vec{u}_i \mathbf{q}_i^*,\end{split}where \vec{f}_i is the active force in the local particle coordinate system (set by `active_force`) and \vec{u}_i is the active torque in the local particle coordinate system (set by `active_torque`.
On Apr 11, 2023, at 11:53 AM, Benjamin Sykes <bb...@email.unc.edu> wrote:
Hi,I've attached the main code I am using. I am getting the correct angle as far as I can tell but have issues with either the forces or the quaternion part of my code. I ran the sim with a single particle in the lower left and made the reorientation updater print out the [cos(theta),0,0, sin(theta)] part, and I was getting the quaternion 0.708042353482036 + 0i+ 0j+ 0.7061699693952015k which is pointing in the correct direction. My current active force is added as active.active_force['A'] = (mag/np.sqrt(3), mag/np.sqrt(3),0) as I was told that should point in the direction of the particle's orientation in a 2d sim. Could that be where my problem lies? Thanks for any help you can provide
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/c5e6faaf-2812-4925-8d3d-7b25a1f9c801n%40googlegroups.com.
<code.py>