# Changing boundary conditions in polymer

Dear lammps users
I am simulating polyethylene with initial p p p conditions and want to change the conditions to s p p. But when I do this, polymer chains at boundary have broken bonds due to change in boundary conditions. Is there any way in lammps so that whole polymer chain can be confined in in simulation box so that no bonds are broken at boundary?

thanks
Rajesh

before you can change boundaries from periodic to non-periodic without breaking bonds, you have to make certain, that are are no bonds crossing periodic boundaries. as simple as that. in other words, you first have to “disentangle” your system, so that all atoms are inside the same periodic image. for example, you can try to increase your box in that dimension (without changing atom positions) until there is a sufficient separation between the periodic images.

that said, it is probably simpler to start your simulation with s p p boundaries from the very beginning, or when you are using p p p, then you need to insert some kind of barrier that prevents crossings. what is the reason to do a fully periodic simulation first?

axel.

p.s.: giacomo, this is a different question.

before you can change boundaries from periodic to non-periodic without
breaking bonds, you have to make certain, that are are no bonds crossing
periodic boundaries. as simple as that. in other words, you first have to
"disentangle" your system, so that all atoms are inside the same periodic
image. for example, you can try to increase your box in that dimension
(without changing atom positions) until there is a sufficient separation
between the periodic images.

that said, it is probably simpler to start your simulation with s p p
boundaries from the very beginning, or when you are using p p p, then you
need to insert some kind of barrier that prevents crossings. what is the
reason to do a fully periodic simulation first?

axel.

p.s.: giacomo, this *is* a different question.

You're right, I misunderstood "ps p p" as a typo for "s p p".

Dear Axel
Thank you for your quick response. Actually initial structure was prepared using some other software and that software does not go give other option than p p p. So, no choice than to start with p p p. Can owrap command in pizza.py accomplish this or any command in vmd?

It may be possible, depending on the length of the chains, to simulate the system above the melting temperature in the NVT ensemble, and then use fix deform to gradually increase one unit cell dimension. This should create eventually an air gap. It’s up to you then whether to continue running with p p p, or switch to s p p.

But if the polymer chains as so long as to have multiple entanglements each, you should probably look into rebuilding the initial configuration without PBCs in one direction.

Giacomo

Dear Fiorin,

Thank you for your response. Its really difficult to obtain desired polymer density if I use s p p from starting itself. If I deform other 2 dimensions third with s will expand. And if use p p p initially to obtained desired polymer density, chains will broke while shiting to s p p. Its is really difficult situation.

Starting from shrink-wrapped conditions won’t work if your system is not at equilibrium yet. You are probably not even at equilibrium for p p p conditions.

Giacomo

Yes, my system is of very low density initially and need to be equilibrated. But if I use p p p to equilibrate it, atoms will cross boundaries and this will again create same situation as shifting from p p p to s p p. Initial s p p wont let the system to gain desired density.

Dear Fiorin,

Thank you for your response. Its really difficult to obtain desired
polymer density if I use s p p from starting itself. If I deform other 2
dimensions third with s will expand. And if use p p p initially to obtained
desired polymer density, chains will broke while shiting to s p p. Its is
really difficult situation.

​it is not all that difficult. however, it does require some creative
thinking​ of your own. none of us will do this for you.

axel.