NVT with barostat in shear


I’d like to apply shear to a system at constant volume. From previous emails on this list and the LAMMPS manual, it seems the best option would be to use fix deform at a very slow rate to avoid oscillations.

I was wondering if its conceptually, and practically (with LAMMPS) possible to have an NVT ensemble with a shear stress barostat only, as the shear strain will not affect the volume. I’m doing this in an attempt to reach a strained state quickly via pressure relaxation with drag, rather than fix deform which sets up shear stress oscillations that may not die quickly.

Kindly let me know if this is possible.


Also, I’d like to add that I’m working with a solid.

You can use fix npt and set the barostat params to only apply shear, and also

have a Nose/Hoover thermostat. No fix deform in that case.


Dear Steve,

I tried using fix npt with a shear stress only in xy.

fix 1 all npt temp 0.1 0.1 10.0 xy ${pxy} 20.0 1000 drag 2.0

However, that gave me an error (nan), right after the first step.
I looked up the triclinic formulae in the LAMMPS manual and I saw that xy and ly are sorta related, so I added

a y direction barostat to it.

fix 1 all npt temp 0.1 0.1 10.0 y {pyy} {pyy} 1000 xy ${pxy} 20.0 1000 drag 2.0

And it worked fine, although ly oscillated a bit, as was expected.
Then I tried to check if this is true with other dimensions too so instead of adding a y-barostat, I added an x-barostat
and it worked fine. Similarly with z-barostat.

I’m adding a small example to help illustrate the issue. I’m not sure why the shear only barostat in the example fails.


Fe555.lmp (16.3 KB)

Fe_2.eam.fs (739 KB)

in_555 (1.47 KB)

Also, I’d like to point out that I initially used the May-15 version but this problem persists in the Aug-2015 version as well.

If I run your script with the current version, putting in the xy barostat line

you list, it runs fine. No Nans and no valgrind errors.


Well, that is quite interesting. I’ll recompile using a different compiler and hope for the best.

Thank you,

Note that I didn’t run your script to completion, I just ran a few 1000 steps.
If you get NANs later in a simulation it is typically a bad model that
causes it, not a LAMMPS problem.