[lammps-users] How to apply PBC to a group

Lammps community,

I am wondering if this is possible and/or if someone else has done it. I would like to apply PBC in two directions for my polymer system, but not a foreign body I add to the system. I want to simulate a high velocity particle (foreign body) at a “brick” of polymer, but I don’t want the particle reflected along the PBC (that would be more like a shotgun blast). If this isn’t possible, that’s ok, but I am wondering if I can apply PBC to a group (polymer) like I apply other fixes to a group.

Kevin Hadley

hi kevin,

Lammps community,

I am wondering if this is possible and/or if someone else has done it. I
would like to apply PBC in two directions for my polymer system, but not a
foreign body I add to the system. I want to simulate a high velocity
particle (foreign body) at a “brick” of polymer, but I don’t want the
particle reflected along the PBC (that would be more like a shotgun blast).

there are no "reflections" with periodic boundaries.

If this isn’t possible, that’s ok, but I am wondering if I can apply PBC to
a group (polymer) like I apply other fixes to a group.

no. periodic boundary conditions are a system property.

however, what is commonly done in lammps for the kind of
study that you describe, is to setup a "slab" system with
periodic p p f
and sufficient space in z-direction and then tell lammps
to not crash when atoms are "lost" by passing through
the non-periodic boundary.

the alternative (if you cannot afford to "lose" atoms, e.g. due to
using visuzalization or analysis software that cannot handle
trajectory files with varying numbers of particles) would be
to use "shrinkwrap" boundaries in z-direction:
periodic p p s

then the system will expand as needed. in both cases it is
also recommended to set the processors keyword to

processors * * 1

for parallel runs to make sure you are parallelizing efficiently.
otherwise lammps will try to distribute the work mainly across
the z-direction, but that will lead to massive load imbalances.

cheers,
    axel.