[lammps-users] Regarding Density and mass in Gay-Berne potential

Hi,
I am using Gay-Berne Potential for simulation. Before Starting Simulation I specify density,box size etc by following command
units lj
atom_style ellipsoid
dimension 3
lattice sc 0.01
region box block 0 5 0 5 0 5
create_box 1 box
create_atoms 1 box
set type 1 mass 1.0

If I specify mass 1.0 and do my simulation in that case simulation starts from initial density which I specify in this case i.e 0.01 but if I set mass 2 in that case density starts from 0.02 but I specify density 0.01 by using lattice sc 0.01. Why does this happen ?
If I give 0.01 density for mass 2 in that case should I get starting density 0.01 or not?

[…]

Hi,
I am using Gay-Berne Potential for simulation. Before Starting Simulation I specify density,box size etc by following command
units lj
atom_style ellipsoid
dimension 3
lattice sc 0.01
region box block 0 5 0 5 0 5
create_box 1 box
create_atoms 1 box
set type 1 mass 1.0

If I specify mass 1.0 and do my simulation in that case simulation starts from initial density which I specify in this case i.e 0.01 but if I set mass 2 in that case density starts from 0.02 but I specify density 0.01 by using lattice sc 0.01. Why does this happen ?

because you are comparing a “number density” with a “mass density”. The “lattice” command cannot know anything about the latter because it is only about defining a grid of points, which have no mass.

If I give 0.01 density for mass 2 in that case should I get starting density 0.01 or not?

You should not. You define the spacing first and then change the mass.
What you expect makes no sense from the point of a computer program that looks at and processes items in a line by line fashion.

If I want to change the mass by using set type 1 mass 2.0 where should I add this command

With Regards,
Sahire

You can change the mass wherever you want

But I want to give a starting density 0.01 and I don’t want to change it to 0.02 if I set mass 2 in the lj unit. Is it possible ? or I should not change mass from

set type 1 mass 1.0 then only it can possible

With Regards,
Sahire

LAMMPS will not do the thinking for you.
As I already have explained to you, the lattice command when used with reduced units will set a spacing for a number density. If you want to achieve a certain mass density you have to choose that accordingly if you are not assigning a unit mass.

This is all very elementary and logical. As a software LAMMPS will do exactly what it is programmed to do and that is described in the manual. How to apply that to achieve what you want to do is your job and a question of expressing your project in the terms given in the documentation.