Hello all,

I am trying to count the number of liquid and vapor atoms in a unit simulation box every timestep. I have calculated each atom’s coordination number using compute coord/atom. but I am confused how to define a conditional piece of commands to count the number of atoms with (coord. number > N) and atoms with (coord. number < N) . Could anyone please help me?

Thanks

Hello all,

I am trying to count the number of liquid and vapor atoms in a unit

simulation box every timestep. I have calculated each atom's coordination

number using compute coord/atom. but I am confused how to define a

conditional piece of commands to count the number of atoms with (coord.

number > N) and atoms with (coord. number < N) . Could anyone please help

me?

create an atom style variable, that computes to either 1 or 0 depending

on whether your atom meets your condition. then use compute reduce with the

"sum" option to sum that variable over your system.

you can do this for multiple variables at the same time, if needed.

axel.

Sorry Dr.Kohlmeyer for this possibly elementary question , how can I write a conditional statement in variable definition command?

I have looked it up in the manual document but found nothing.

Sorry Dr.Kohlmeyer for this possibly elementary question , how can I write

a conditional statement in variable definition command?

I have looked it up in the manual document but found nothing.

look again, it is there.

axel.

Thanks Professor. It’s done.

Math operators were the solution.