Magnetic torque

27 views
Skip to first unread message

Mohammad Fazelzadeh

unread,
Jun 1, 2023, 4:32:56 AM6/1/23
to hoomd-users
Hi,  
we are interested in implementing magnetic torque (m x B) in version 3. A module that takes the quaternions of the particles and evaluate the cross product of that with a constant magnetic field in 3D is needed. Does hoomd have that?  If not, how deep shall one make modifications to the c++ source codes? 

Best,
MO

Joshua Anderson

unread,
Jun 1, 2023, 8:02:35 AM6/1/23
to hoomd...@googlegroups.com
MO,

The external potential framework in HOOMD-blue is currently limited to potentials as a function of position. To implement magnetic torque, you would:
1. Extend PotentialExternal and PotentialExternalGPU to evaluate torques.
2. Update EvaluatorWalls, EvaluatorExternalPeriodic, and EvaluatorExternalElectricField with the new API. Only function headers need to change, these methods would ignore orientation and compute a 0 torque.
3. Implement EvaluatorExternalMagneticDipole, the export methods, the Python interface, and unit tests.

I would prefer to see a general API that can compute torques as a function of both position and orientation. Please submit your changes with a pull request so that others in the community can make use of them. For detailed discussions on implementation details, open an issue on GitHub.

A Custom force (https://hoomd-blue.readthedocs.io/en/v3.11.0/module-md-force.html#hoomd.md.force.Custom) implemented in Python is also an option. Note that a C++ implementation will execute significantly faster, especially on the GPU.
------
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/4bcd982c-9f82-4583-81aa-915d4ef23e6an%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages