set type mass not working

Hello,

I’m using LAMMPS (12 Dec 2018).

I am trying to set the mass of an atom type using the set command:

“set type 5 mass 1.0”

but, I am getting the error:

“”"
set type 5 mass 1.0
ERROR: Cannot set this attribute for this atom style (…/set.cpp:179)
Last command: set type 5 mass 1.0

“”"

I am reading data from a restart file and the atom style is “full”. Here is the meat of the input:

“”"
units real
atom_style full

read_restart MD_FILENAME.restart

pair_style lj/cut/coul/long/opt 10.0 12.0
kspace_style pppm 1.0e-4
bond_style harmonic
angle_style harmonic
dihedral_style fourier

special_bonds amber

Hello,

I’m using LAMMPS (12 Dec 2018).

I am trying to set the mass of an atom type using the set command:

“set type 5 mass 1.0”

but, I am getting the error:

“”"
set type 5 mass 1.0
ERROR: Cannot set this attribute for this atom style (…/set.cpp:179)
Last command: set type 5 mass 1.0

“”"

that is the correct error. using the set command is not correct in this case. it works for atom styles where you have per-atom masses. in most cases, however, you have per atom type masses, and then you have to use the “mass” command. this is the case for atom style full.

BTW: this is all explained in the documentation. here is what is written about “set mass”:

Keyword mass sets the mass of all selected particles. The particles must have a per-atom mass attribute, as defined by the atom_style command. See the “mass” command for how to set mass values on a per-type basis.

axel.

Hey Axel,

Thanks for the reply! Using the “mass” command did the trick. Also, thanks for clarifying the documentation. My original thoughts from the documentation is that style full would have a “per-atom mass” (probably should have read the documentation of the style full…but now it makes sense.

Thanks again,
Stacey