LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

### mass command

Syntax:

    mass I value

- I = atom type (see asterik form below)
- value = mass

Examples:

    mass 1 1.0
    mass * 62.5
    mass 2* 62.5

Description:

Set the mass for all atoms of one or more atom types. Mass values can also be set in the read_data data file. See the units command for what mass units to use.

Most atom styles require masses to be specified. One exception is atom_style granular, where masses are defined for individual atoms, not types. Pair_style eam defines the masses of atom types in the EAM potential file.

I can be specified in one of two ways. An explicit numeric value can be used, as in the 1st example above. Or a wild-card asterik can be used to set the mass for multiple atom types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the number of atom types, then an asterik with no numeric values means all types from 1 to N. A leading asterik means all types from 1 to n (inclusive). A trailing asterik means all types from n to N (inclusive). A middle asterik means all types from m to n (inclusive).

A line in a data file that specifies mass uses the same format as the arguments of the mass command in an input script, except that no wild-card asterik can be used. For example, under the "Masses" section of a data file, the line that corresponds to the 1st example above would be listed as

    1 1.0

Restrictions:

This command must come after the simulation box is defined by a read_data, read_restart, or create_box command.

All masses must be defined before a simulation is run (if the atom style requires masses be set). They must also all be defined before a velocity or fix shake command is used.

Related commands: none

Default: none