Illegal group command

Hi, all,
I am trying to put atoms that meet a certain boolean condition to a group called “inwardatom”. This is the code:

variable eatom2 atom “(v_DH>50e-6)&&(v_inOut<0)”
group inwardatom variable eatom2

The error message says:

ERROR: Illegal group command (group.cpp:341)

Can anyone tell me what causes it?

Thanks a lot!

What is your LAMMPS version and what platform are you running on?
You need to provide more context, e.g. the complete log / screen output.

These two lines are syntactically correct. Are you sure the error is happening at this specific part of the input and not elsewhere?

Hi, Axel,
Thank you very much for your reply. The LIGGGHTS version I am using is 2.3.8. I am running it on the cluster.

Following is the complete log. Can you please check it for me? Thank you a lot.


LIGGGHTS (Version LIGGGHTS-PUBLIC 2.3.8, compiled 2022-11-01-14:40:17 by bellc based on LAMMPS 20 Apr 2012)


units si
dimension 3
boundary f f f
atom_style hybrid granular charge
#atom_style granular
neighbor 5e-8 bin
newton off
neigh_modify every 1
#processors 1 2 1
communicate single vel yes
neigh_modify delay 0
neigh_modify page 1000000 one 100000

Atom definition

read_data start.pos.dat
orthogonal box = (-0.00064493 -0.00064977 -0.0006) to (0.00064266 0.00064214 0.00092022)
1 by 1 by 1 MPI processor grid
114 atoms
114 velocities

mass 1 18.02
set type * density 1000
114 settings made for density

fix m1 all property/global youngsModulus peratomtype 70e9 70e9
fix m2 all property/global poissonsRatio peratomtype 0.31 0.31
fix m3 all property/global Gamman peratomtypepair 2 5.0e-9 5e-9 5e-9 5e-9
fix m4 all property/global coefficientFriction peratomtypepair 2 0.0 0.0 0.0 0.0
fix m6 all property/global cohesionEnergyDensity peratomtypepair 2 0.025 0.025 0.025 0.025


thermo_modify lost ignore
#pair_style gran/hertz/history2 cohesion sjkr
pair_style hybrid/overlay gran/hertz/history2 cohesion sjkr coul/cut 1e-4

pair_coeff * * gran/hertz/history2 #cohesion sjkr
pair_coeff * * coul/cut 1e-4
#pair_coeff * *

timestep 5e-11

fixes & compute

fix 2 all nve/sphere

variable radius equal 50e-6 # Radius of the cylinder

group all_atoms type 1
114 atoms in group all_atoms

variable R equal radius # Replace with the desired value for the boundary radius
variable C equal 0.5 # Replace with your chosen reduction value between 0 and 1
variable K equal 1 # Replace <spring_constant> with your chosen spring constant

Compute DH and inOut per atom

variable DH atom “sqrt(x^2 + y^2)”
variable inOut atom “xvx + yvy”

variable eatom1 atom “(v_DH>50e-6)&&(v_inOut>0)”

group outwardatom variable eatom1
ERROR: Illegal group command (group.cpp:341)

This is a forum for LAMMPS and not LIGGGHTS. You have to check the LIGGGHTS documentation and ask in the LIGGGHTS forum for help. Since LIGGGHTS was forked from LAMMPS a long time ago, the error message is probably correct and the variable keyword not available.