Print charges on 2 types atoms in thermo output.

Hello lammps users

I want to print charges on 2 types on atoms in BN . How can I print charge on particular atom in thermo output. I can dump them in dump file but I want to print it. Is there any command in lammps for that? I tried by making 2 groups each containing single atom using compute property/atom but when I put it equal to to a variable it shows per-atom property in variable formula. Any suggestion?

thanks

rajesh.

Hello lammps users

I want to print charges on 2 types on atoms in BN . How can I print charge
on particular atom in thermo output. I can dump them in dump file but I
want to print it. Is there any command in lammps for that? I tried by
making 2 groups each containing single atom using compute property/atom but
when I put it equal to to a variable it shows per-atom property in variable
formula. Any suggestion?

​the canonical way to convert a data from a group to a global scalar is to
use "compute reduce"​.
but why can't you just access the data from the specific atom by using the
index (aka tag) as to the "q[i]" array.
check the documentation for the variable command.

axel

Thank you Axel. I tried and its working fine.