Density/Mass Calculation

Greetings,

I intend to calculate mass and ultimately the density of a system as a pretty simple attempt to learn lammps and it may be required to mention I'm totally a new lammps user. I got error On fix ave/spatial command as an illegal command but can not figure out the inconsistency. No similar command could be found through the lammps examples and also the emails so I highly appreciate your guidance to help me solve the mistake. Here is a related part of my input file and the simulation box is triclinic as well.

neighbor 0.3 bin
neigh_modify every 2 delay 10 check yes
thermo 100
thermo_style custom step press vol lx ly lz
timestep 1
fix 1 all nve/limit 0.1
fix 2 all temp/rescale 100 298 298 0 1.0
compute 1 all property/atom mass
fix 3 all ave/spatial 100 1 100 z lower o.3 c_1 units reduced norm all ave running
compute 2 all reduce sum c_1

Additionally, I was wondering if the last compute command is required to be applied according to the existence of fix ave/spatial command.

Thank you in advance,
Negin

Hi, Negin,

If you only want the system density, this line suffices: (for unit real)

variable density equal mass(all)10/(6.0221417930vol)

LC Liu

fix 3 all ave/spatial 100 1 100 z lower o.3 c_1 units reduced norm all ave running

It looks like you have o,3 instead of 0.3.

Steve