Fix move linear, how to prohibit rotation?

Dear LAMMPS users and developers,

I want a group of atoms to move linearly regardless of its interaction with other atoms.
When I use fix move linear, it still may rotate under impact of other atoms.
To prevent it, I have to use fix move transrot with a huge period.
How to set period to infinity? Should I just keep using a huge number?
Is there other way to prohibit rotation while setting fixed linear move ?

Hello,

Have you you tried to use:

fix myfix mygroup setforce 0 0 0 # erase all forces applied on the atoms from mygroup
velocity mygroup set 0 1 0 # set the velocity of the atoms from mygroup

Simon

Please provide a reproducer input example for your claim. There is no reason why applying fix move linear should induce a rotation. Fix move moves atoms with complete disregard of the forces on them. So there must be an error in your input. Please check the log for warnings.

I am on Ubuntu 22.04.4 LTS, LAMMPS (2 Aug 2023 - Update 2) running lmp -in in.script

in.script:

units       lj
boundary    f f f
comm_modify vel yes

atom_style  body rounded/polyhedron 1 8
atom_modify map array


region		reg block 0 60 0 60 0 30 units box
create_box	4 reg

read_data     data.2polyhedrons add append


variable cut_inner  equal 0
variable k_n        equal 1000
variable k_na       equal 0
variable c_n        equal 10
variable c_t        equal 10
variable mu         equal 0
variable A_ua       equal 1

pair_style body/rounded/polyhedron ${c_n} ${c_t} ${mu} ${A_ua} ${cut_inner}
pair_coeff * * ${k_n} ${k_na}

neighbor     0.5 bin
neigh_modify every 1 delay 0 check yes

timestep     0.001

group g1 id 1                     
group g2 id 2                 

fix    g1l g1 move linear 0 1 0


fix          g all gravity 1.0 vector 0 0 -1
fix          1 all nve/body

thermo_style custom step atoms ke pe etotal press
thermo       1000
thermo_modify lost ignore flush yes

dump	     2 all image 500 *.gif type type &
	     zoom 1.5 adiam 1.5 body type 0 0 view 75 15
dump_modify  2 pad 6

run	     10000

with
data.2polyhedrons:

Two polyhedrons
2 atoms
2 bodies
1 atom types
0 50 xlo xhi
0 50 ylo yhi
0 10 zlo zhi

Atoms

1 1 1 1 30 30 5
2 1 1 1 35 30 10

Velocities

1 0 0 0 0 0 0
2 0 0 0 0 0 0

Bodies

1 3 79
8 12 6
1 1 1 0 0 0
4.75 4.75 0.25
4.75 -4.75 0.25
-4.75 -4.75 0.25
-4.75 4.75 0.25
4.75 4.75 -0.25
4.75 -4.75 -0.25
-4.75 -4.75 -0.25
-4.75 4.75 -0.25
0 1
1 2
2 3
3 0
4 5
5 6
6 7
7 4
0 4
1 5
2 6
3 7
0 1 2 3
4 5 6 7
0 1 5 4
1 2 6 5
2 3 7 6
3 0 4 7
0.5
2 3 79
8 12 6
1 1 1 0 0 0
0.75 0.75 0.75
0.75 -0.75 0.75
-0.75 -0.75 0.75
-0.75 0.75 0.75
0.75 0.75 -0.75
0.75 -0.75 -0.75
-0.75 -0.75 -0.75
-0.75 0.75 -0.75
0 1
1 2
2 3
3 0
4 5
5 6
6 7
7 4
0 4
1 5
2 6
3 7
0 1 2 3
4 5 6 7
0 1 5 4
1 2 6 5
2 3 7 6
3 0 4 7
0.5

yields
a
I would expect the small cube bounce off the plate, and the plate keep moving without rotation. That is not what actually happening.

Thank you, Simon. I’ve tried it, but the result was the same: collision causes rotation (please, see the animation above).

Don’t include the particle from g1 group in the fix nve/body group. With the setup you have now, this particle is first moved by fix move and then its trajectory is further modified by fix nve/body.

1 Like

The simulation is executed correctly. If you want polyhedron 1 to be unaffected by its interaction with id 2, you need to remove their interactions with

neigh_modify exclude group g1 g2

No.

That will make one object “pass through” the other, not bounce off it.

To me, this can only happen if the two particles do not interact. I missed the part about them bouncing :stuck_out_tongue:

This (unphysical) situation is also indicated by a warning in the output:

WARNING: One or more atoms are time integrated more than once (src/modify.cpp:289)

LAMMPS warnings should not be ignored unless you know exactly what you are doing.

LAMMPS does not support writing out images in GIF format. Those files will be in Netpbm “raw” format:

$ file *.gif
000000.gif: Netpbm image data, size = 512 x 512, rawbits, pixmap
000500.gif: Netpbm image data, size = 512 x 512, rawbits, pixmap
001000.gif: Netpbm image data, size = 512 x 512, rawbits, pixmap
001500.gif: Netpbm image data, size = 512 x 512, rawbits, pixmap
002000.gif: Netpbm image data, size = 512 x 512, rawbits, pixmap
1 Like

I’ve changed the script to

group g1         id 1   # moving linear                                           
group g2         id 2   # falling                                                    
fix              1 g2 nve/body
fix              g1l g1 move linear 0 1 0

as @mkanski and @akohlmey suggested.
There are no warnings now, but the g1 plane is still rotating after collision.
[False. Works fine, see my post below]

Not for me.

Sorry, yes, works fine now, looked at the old images.
Thank you very much!