Using Fix External

Quick Q. I am helping someone couple a CFD code to a LAMMPS library. The issue of inputting forces appears well-documented. Is the communication of torques to Lammps using fix external as straightforward?

Quick Q. I am helping someone couple a CFD code to a LAMMPS library. The
issue of inputting forces appears well-documented. Is the communication of
torques to Lammps using fix external as straightforward?

yes and no. it depends on whether you have extended particles with a
per particle torque or you have to apply the torque to groups of atoms
(e.g. molecules).

axel.

I take it the per-atom is straight-forward.

I take it the per-atom is straight-forward.

yes. torque is just another another per atom property for sphere and
ellipsoid atom styles.

axel

This should be easy to do, but to make it general, we should probably
add some additional options to FixExternal to have it work for
torques instead of forces, or torques and forces. Can you outline

how/when you want the other code to pass stuff to LAMMPS?

The simplest option would probably be to define one fix external
for forces, another for torques. The only change would then
be to have an optionl flag for summing fexternal to the force
array vs the torque array.

Steve

Having the torque work right out of the box would be nice. In general, all I am currently looking to pass to LAMMPS are forces and torques as calculated from an instantaneous fluid flow field. I am only looking to have LAMMPS pass new coordinates and linear and angular velocities, essentially just using LAMMPS as our MD(DEM for gran folks) solver.

Communication is still something we are working out. As of now we would like the flow and MD solvers to occupy the same processors, i.e. having the same domain decomposition. Although, I am not sure if this sort of local communication to lammps is actually that straightforward. I would appreciate comments along this direction as well.

That direct overlap is the simplest. From the driver side

you can grab pointers to all the per-atom vectors
you mention: x,f,torque,v,omega. So your calling
program can read/write any of those quantities you like.

I’ll look at generalizing fix external a bit to work with
torque as well as force.

Steve