"fix rigid" NPT stationary hack

<[email protected]...>, [email protected]..., Yuchong Shao
<[email protected]...>, [email protected]...

Very good analysis Trung - I think that is the correct diagnosis
of Andrew's difficulties. I think Trung has verified my
earilier point that it should be
possible to run NPT on a system with a rigid, immobile
portion w/out needing fix rigid.

Using "fix_modify ... temp tempMobile" seems like a good idea. As far
as "fix rigid", I'm agnostic.
Starting from Trung's input script, I made a few variants and ran
several new tests, at low pressure (1atm), and at high pressure (10000
atm). Some of them use fix rigid. Some of them don't. None of them
explode. None of them work flawlessly. (For example the
high-pressure red and green curves curves either indicate that "fix
rigid" causes the pressure to be reported incorrectly, or something
worse could be happening.) Input scripts are attached. (data file
not included.)

In another thread, Axel raised the concern that there could also be
spurious numerical crashes caused by rescaling some of the atoms and
not others ("dilate partial").

Laurent Joly suggested getting using "fix spring" or "fix spring/self"
as an alternative.
That solution sounds promising to me. (However "fix spring" currently
makes no modification to the virial, so I don't know if it needs to be
patched to work under NPT conditions. Perhaps I should test "fix
spring" and post a follow-up message.)

I will add a cautionary note to the fix npt doc page
in the section about using "dilate partial", to indicate
the user should carefully define the right temperature
compute to use with the partial system.

Great! (By the way, "neigh_modify exclude" must also be applied to
turn off interactions between atoms within the immobile group.)

Thank you and Trung and Axel so much for your feedback!
I hope somebody else will find this discussion helpful!

Cheers
Andrew
(Feel free to ignore all the attached input scripts.)

comparison_low_pressure.png

comparison_high_pressure.png

npt.in (3.49 KB)

nptdilatepartial+exclude+fixmodify.in (4.14 KB)

nptdilatepartial+exclude+fixmodify+rigid.in (4.09 KB)

nptdilatepartial+exclude+rigid.in (4.09 KB)

npt_highp.in (3.51 KB)

nptdilatepartial+exclude+fixmodify_highp.in (4.15 KB)

nptdilatepartial+exclude+fixmodify+rigid_highp.in (4.1 KB)

nptdilatepartial+exclude+rigid_highp.in (4.1 KB)

Here is the data file for the high-pressure tests. (It was too large
to fit in my last post.)
As always, feel free to ignore! Cheers
Andrew
(The low pressure tests use the data file posted in the first message.)

system.data.gz (125 KB)

In another thread, Axel raised the concern that there could also be
spurious numerical crashes caused by rescaling some of the atoms and
not others ("dilate partial").

Laurent Joly suggested getting using "fix spring" or "fix spring/self"
as an alternative.
That solution sounds promising to me. (However "fix spring" currently
makes no modification to the virial, so I don't know if it needs to be
patched to work under NPT conditions. Perhaps I should test "fix
spring" and post a follow-up message.)

Alas, this fix failed my NPT tests. I guess it does need to be patched.
As currently implemented "fix spring/self" did not perform as well as
any of the other methods mentioned above. (Can post test results if
interested.)

Hello
I just thought I'd post an update to this old thread. The syntax for
the "fix npt ... dilate" command has changed, so I wanted to provide
some update example input files (for search-engine users who land on
that old thread). I included an updated version of Trung's input file
and mine.

I'm also attaching a to the "fix_nh.cpp" file which fixes a small bug
with "fix npt ... dilate". If the examples attached to this file
don't work for you (if lammps crashes), then try copying this file to
the "src" directory of you lammps distribution and recompile lammps.
(Hopefully by the time you are reading this, you won't need this.)

Cheers
Andrew

fixrigid_test_npt.tar.gz (182 KB)

fix_nh.cpp (66.6 KB)