mass of particles

I am working with a binary mixture of particles; particles of type 1 have mass m1 and particles of type 2 have mass m2.

The masses are set in read_data data file:

Masses

1 1
2 5

How can I access to those quantities in the simulation, for example to print out the masses or to compute a formula in which the mass is needed?

(I found nothing on the “mass command” page of the manual)

I am working with a binary mixture of particles; particles of type 1 have
mass m1 and particles of type 2 have mass m2.

The masses are set in read_data data file:

Masses

1 1
2 5

How can I access to those quantities in the simulation, for example to print
out the masses or to compute a formula in which the mass is needed?

(I found nothing on the "mass command" page of the manual)

try this page instead: LAMMPS Molecular Dynamics Simulator

Thanks.

The problem is that if I use this command I obtain a vector, while I would like a scalar.

Moreover, I would need the mass before the run, but if I do for example

compute m1 1 property/atom mass
variable mass1 equal c_m1[1]
print ${mass1}

before the run command, I get the error

Compute used in variable between runs is not current

By the way, I’ve noticed that if I do

variable m1 equal mass[1]

I get what I want. The problem is since my data file contains first all the particles of type 1 and then all the particles of type 2, to get the mass of a particle of type 2 in this way I would need to know exactly how many particles of type 1 are in the data file…

Thanks.

The problem is that if I use this command I obtain a vector, while I would
like a scalar.
Moreover, I would need the mass before the run, but if I do for example

compute m1 1 property/atom mass
variable mass1 equal c_m1[1]
print ${mass1}

at that point, it would probably be simpler and easier to not even
have a Masses section in the data file and instead define them in the
input.

then you can just do:

variable mass1 index 12.0
mass 1 ${mass1}

and so on.

axel.

Yes, it is probably better… Thank you!