fix rigid/npt with triclinic

fix rigid/npt has not yet been implemented to work with triclinic boxes in LAMMPS. I’m interested if any users or devs have any kind of implementation of this feature in their own code.

I’ve got a system of 32 nanoparticles functionalized with polymer grafts. The NP’s are each a collection of points where the center interacts with the system using lj/expand and the grafts are tethered to non-interacting points on the surface. The surface points and center of each nanoparticle compose a rigid body.

I’m interested in allowing the nanoparticles to pack efficiently in the periodic box. If isotropic pressure coupling is used, their movement is restricted. When I use anisotropic pressure coupling I can already see some changes in packing. We’re thinking it would be worthwhile to explore using a triclinic box if there is an implementation available using fit rigid/npt.

Thanks,

fix rigid/npt has not yet been implemented to work with triclinic boxes in
LAMMPS. I'm interested if any users or devs have any kind of implementation
of this feature in their own code.

​since nobody has responded publicly, i'd like to add, that i am not aware
that this is on the TODO list of any LAMMPS developer. i am copying Trung,
who was involved in the nose-hoover based rigid body integrators.

you may look into the regular fix rigid integrators for inspiration.​ the
code structure is very similar, watch out for differences in variable names.

I've got a system of 32 nanoparticles functionalized with polymer grafts.
The NP's are each a collection of points where the center interacts with
the system using lj/expand and the grafts are tethered to non-interacting
points on the surface. The surface points and center of each nanoparticle
compose a rigid body.

I'm interested in allowing the nanoparticles to pack efficiently in the
periodic box. If isotropic pressure coupling is used, their movement is
restricted. When I use anisotropic pressure coupling I can already see some
changes in packing. We're thinking it would be worthwhile to explore using
a triclinic box if there is an implementation available using fit rigid/npt.

​as a workaround, you may try the following (off the top of my head, check
docs for details):

group none type 999
fix 1 all rigid/nvt ....
fix 2 none nph ... dilate none
fix_modify 2 press thermo_press

axel.​

Hi Wes,

it’s possible to support triclinic boxes for fix rigid/npt and rigid/nph either by following the reference cited the fix rigid doc (Kamberaj et al), or by borrowing what is implemented in fix nh for updating the full box dimension tensor.

However, please note that fix rigid/npt and rigid/nph with triclinic boxes would be mostly useful for the cases where you only have rigid bodies in the system. For systems of polymer-grafted rigid bodies like yours, I think the workaround along the line Axel suggested would work to the similar effect:

assuming you’re having a triclinic box setup

group nanoparticles type 1

group tethers type 2
fix 1 nanoparticles rigid/nvt temp …
fix 2 tethers npt temp 1.0 1.0 1.0 xy 1.0 1.0 10.0 … dilate all
fix_modify 2 press thermo_press

The reason that it would work is that the simulation triclinic box is to be barostatted by the fix npt, which uses the system pressure tensor as feedback.

Hope it helps,
-Trung

Thanks Axel and Trung, this helps. I now see that this method is one of the
options listed on the "fix rigid" page for using pressure coupling with a
mixture of rigid and non-rigid molecules.

Is the thermo_press compute modification (the last line) always necessary
in a system like this? That's one step I did not see on the "fix rigid"
page's section on how to use pressure coupling with a system containing
both rigid and non-rigid bodies.

Hi Wes,

it's possible to support triclinic boxes for fix rigid/npt and rigid/nph
either by following the reference cited the fix rigid doc (Kamberaj et al),
or by borrowing what is implemented in fix nh for updating the full box
dimension tensor.

However, please note that fix rigid/npt and rigid/nph with triclinic
boxes would be mostly useful for the cases where you only have rigid bodies
in the system. For systems of polymer-grafted rigid bodies like yours, I
think the workaround along the line Axel suggested would work to the
similar effect:

# assuming you're having a triclinic box setup

group nanoparticles type 1
group tethers type 2
fix 1 nanoparticles rigid/nvt temp ...
fix 2 tethers npt temp 1.0 1.0 1.0 xy 1.0 1.0 10.0 ... dilate all
fix_modify 2 press thermo_press

The reason that it would work is that the simulation triclinic box is to
be barostatted by the fix npt, which uses the system pressure tensor as
feedback.

Thanks Axel and Trung, this helps. I now see that this method is one of
the options listed on the "fix rigid" page for using pressure coupling with
a mixture of rigid and non-rigid molecules.

Is the thermo_press compute modification (the last line) always necessary
in a system like this?

​it is a case of "better safe than sorry". you can have only one fix
changing the cell shape and volume, and that has to be coupled to the
complete system pressure. that is usually for group all, i.e. what the
thermo press keyword outputs. that should be done correctly by the npt or
nph fix, but there is no harm in making it explicit.

i would be careful with dilate all. it can mess up your rigid body
geometries if you run multi-part trajectories. if your system is large
enough and the pressure fluctuations small enough (and the damping constant
long enough), then it may be better to not update particle positions with
the box change. this a "lesser of two evils" kind of situation.

​axel.​

​[...]

​it is a case of "better safe than sorry". you can have only one fix

changing the cell shape and volume, and that has to be coupled to the
complete system pressure. that is usually for group all, i.e. what the
thermo press keyword outputs. that should be done correctly by the npt or
nph fix, but there is no harm in making it explicit.

Interestingly with iso or aniso pressure I am able to have more than one
fix npt without any errors or warnings. If I do:

fix 1 rigidGroup rigid/nvt molecule temp 1.0 1.0 0.5
fix 2 nonRigidGroup npt temp 1.0 1.0 0.5 iso 5.0 5.0 5.0

Is that the same as the following practically speaking?

fix 1 rigidGroup rigid/npt molecule temp 1.0 1.0 0.5 iso 5.0 5.0 5.0
fix 2 nonRigidGroup npt temp 1.0 1.0 0.5 iso 5.0 5.0 5.0

​no.​

The manual says that I "cannot" use both "fix npt" and "fix rigid/npt"
since only one is coupled to system pressure, so I would have expected an
error message. Is the last example above supported by LAMMPS or should it
be avoided?

​there is currently no simple test for that. the problem is, that there are
cases, where you would want, say, fix deform coupled to one dimension and
fix npt to the other two dimensions, which should be allowed, even though
there are two different fixes trying to modify the system box.

an invalid setup should reveal itself quickly by producing a bogus
trajectory or even a crash.

axel.