[lammps-users] together fix nvt and fix deform(continue)

Dear Steve Plimpton,

I asked lammps mail list before

Dear lammps users,

I want to simulation a system for region box block 0 8 0 8 0 8 and density=0.3.

The program were giving the error (nans) for region box block 0 8 0 8 0 8 and density=0.3 before.
I use fix_deform to compress the box. The target length of the box is determined by the concentration:

Vbox_target = N / rho = 512 / 0.3 = 1706.7

Lbox_target = pow(Vbox_target, 1/3) = 11.95

Now I have input script the following after some change. When I run it I don’t have any error.But I have doubts it’s correct or not.

For example:
1-I am using together fix nvt and fix deform???
2-I have specified compute ids as 1_temp, 3_temp, 4_temp for compute_modify command???

Could any tell me it’s correct or not or any suggest?

Thanks in advance


Fixed volume is not implemented in a active way like thermostatting (for fixing temperature) and barostatting (for fixing pressure) in MD codes. I wonder tough how volume dependent quantities are calculated inside LAMMPS in such a situation. Moreover, I would “fix deform” in tandem with “fix nvt/sllod” so that the streaming velocity due to the fix deform is removed from the thermostatting.

Best Regards,


Manoj is correct. If you want to thermostat with fix deform,
you should use fix nvt/sllod (if you are shearing) or fix langevin,
rather than fix nvt. You can also take a look a compute temp/deform
whcih can be coupled with a thermostat like fix langevin and which
takes out the deformation component of velocity.


I used the command region box prism 0 8 0 8 0 8 0 0 0 instead of region box block 0 8 0 8 0 8.

Now the input script is running but Volume value remains constant as a 51200( for density=0.01, V=512/0.01=51200).Furthermore it is giving the error after 5000000 steps.

ERROR: Cannot use fix npt with triclinic box

I think I could not tell my troubles. I want to simulation a system for region box block 0 8 0 8 0 8 and density=0.3 (that is volume=512/0.3=1706.7) but the input script is giving the error (nans) when I used density=0.3.

Afterwards, I used fix_deform to compress the box until the box size gives the right density, 0.3. Now when I run it(it is below) I don’t have any error.

May I have been misunderstood?

Thanks in advance

First my input script( this is running):

units lj

atom_style ellipsoid

lattice sc 0.01

region box block 0 8 0 8 0 8

create_box 1 box

create_atoms 1 box

set group all quat/random 982381

mass 1 1.5

shape 1 1 1 3

compute rot all temp/asphere

group spheroid type 1

variable dof equal count(spheroid)+2

compute_modify rot extra ${dof}

velocity all create 2.0 41787 loop geom

pair_style gayberne 1.0 3.0 1.0 4.0

pair_coeff 1 1 1.0 1.0 1.0 1.0 0.2 1.0 1.0 0.2 4.0

neighbor 0.3 bin

timestep 0.002

thermo_style custom step temp etotal vol epair press pe

thermo 100

Do the box rescaling with an NVT thermostat for 5 million time steps or longer to avoid overlapping while compressing because the initial box length is now 37.1

fix 1 all nvt/asphere 2.0 2.0 1.0 drag 1.0

fix 2 all deform 10 x final 0 11.95 y final 0 11.95 z final 0 11.95 units box

compute_modify 1_temp extra ${dof}
restart 1000000 restart_*.dat
run 5000000 upto

This unfix is to remove the box rescaling

unfix 1
unfix 2

Now actually run the simulation at the target concentration

fix 3 all npt/asphere 2.0 2.0 0.1 xyz 0.0 8.0 0.1

compute_modify 3_temp extra ${dof}

run 5100000 upto

unfix 3

fix 4 all npt/asphere 2.0 2.0 0.1 xyz 8.0 8.0 0.1

compute_modify 4_temp extra ${dof}

run 5200000 upto