modulo operator for variable command (patch)

Hello list,
I needed a modulo operator today for the group variable command (to
quickly construct 111 oriented layers). It seems there was none
implemented in LAMMPS.
I used the symbol, but since LAMMPS variable expressions deal with floating point numbers it calls fmod internally \(this occured to me after implementing it 90 and I didn't want to change ther interface
from an operator to a function). Operator precedence is the same as
for * and /.
I have attached a patch in case this is of broader interest.
Daniel

modulo.patch (3.36 KB)

D'Oh, sorry, one line missing from that patch. Fixed version attached.

modulo.patch (3.57 KB)

Just posted this as a patch ... thanks

Also, for compute voronoi/atom - although you
said Voro++ doesn't do 2d systems, if you called
it from a 2d LAMMPS model where all the atoms
were in the xy place and the z box dimension was tiny
(-0.5 to 0.5 by default), would that return an answer
that was effectively the correct 2d result?

Steve

said Voro++ doesn't do 2d systems, if you called
it from a 2d LAMMPS model where all the atoms
were in the xy place and the z box dimension was tiny
(-0.5 to 0.5 by default), would that return an answer
that was effectively the correct 2d result?

If comm->cutghost[2] is 0 for 2d simulations then you are right, it
should return the correct result.