I would deeply appreciate your advice of this question regarding LAMMPS usage:

I am working on metallic multilayered composites. The simulation box is a block with periodic BC all around and contains two metals in the form of two layers on top of each other filling the upper half and the lower half of the box with the interface normal along say the z-direction (i.e. one metal fills INF INF INF INF 0.0 0.5lz and the other INF INF INF INF 0.5lz lz)

When this structure is in equilibrium we know that each layer should have zero Szz stress (normal to the interface) and the over all structure should have zero net Sxx and Syy in the plane.

Based on my knowledge of LAMMPS, my first attempt was to use the iso 0 box/relax fix along with structure relaxation procedure (either using minimization and/or molecular dynamics) but this results in final Pxx, Pyy and Pzz which are way off zero.

This led me to start with the z-direction first to make sure at least the pressures are right in that direction using the fix box/relax in the z direction first which relaxing the structure. This fix does achieve an overall zero Pzz but NOT in each individual layer. I looked for the possibility of modifying the pressure compute to base it on a group that is made of one material at the time but it seems that the pressure compute has to be associated with group all. I also defined two groups based on the atom type and tried using those groups in the box/relax fix but that did not make a difference either.

Ideally, I would like to be able to adjust the upper bound of the box based on the pressure in the upper layer to achieve the zero stress condition and do the same for the other material.

thanks in advance for your kind support.

best

Firas