GROMACS version: 2020.6
GROMACS modification: No
I have used the deform function in Gromacs-2020.6. However, when the deform was bigger than 30 degrees, the box was changed to another direction. I attached the images here. ( The image is the frame, where the deform angle is bigger than 30)
My understanding is that Gromacs utilizes what’s called modular invariance to reset the box and prevent it to deform too much. Basically, if the initial box were cubic with side length L and were deformed in a off diagonal direction with speed u, at time t such that t=L/(2u) you would see the box ‘jumping’ as your image shows.
For liquid that’s preferable, since they react to deformation rates and you would keep like to keep shearing indefinitely. For solids (I don’t know what your systems is but it is too ordered to be a liquid)… I think there is no workaround: modular invariance is hardcoded in Gromacs, anyone correct me if I am wrong.
If you want, you can try and edit BoxDeformation::apply in src/gromacs/mdlib/boxdeformation.cpp, removing the for loop that does the reset:
/* We correct the off-diagonal elements,
* which can grow indefinitely during shearing,
* so the shifts do not get messed up.
*/
for (int i = 1; i < DIM; i++)
{
for (int j = i - 1; j >= 0; j--)
{
while (updatedBox[i][j] - box[i][j] > 0.5 * updatedBox[j][j])
{
rvec_dec(updatedBox[i], updatedBox[j]);
}
while (updatedBox[i][j] - box[i][j] < -0.5 * updatedBox[j][j])
{
rvec_inc(updatedBox[i], updatedBox[j]);
}
}
}
I don’t think the checked criterion is on the deformation angle itself, but rather on the deformation tensor (that is: you would probably reach a different max angle if your simulation box were taller or shorter).
Nevertheless, I tried to removed that for loop and my run crashed, so I don’t think there is a easy fix.
Hi,
My polymer material is viscoelastic. I did shear deformation in xz-plane and I observed box is more deformed than the polymer. Can we avoid this in deformation simulation? I used deformation rate as 10e-4 nm ps-1. My aim to calculate shear modulus and Young’s modulus of the material.
Hi,
I am pretty sure that’s just a visualization “issue”, probably having to do on how the coordinates are mapped to the triclininc box. I was seeng the same thing when testing the deform code on water.
The deformation rate itself doesn’t seem to large to me, you should do a convergence study by taking smaller and smaller rates.
Thank you for your response. I checked the coordinates of the .gro file. Unfortunately, while the box has deformed into a triclinic shape, the polymer remains confined within a rectangular form in 3D. Only the box seems deformed, but the polymer remains unchanged. Please advise to overcome this.
Again. I think it’s just the effect of mapping between triclining and orthogonal box when coordinates are dumped. For the calculation of viscosity the “absolute” position of particles are not important, velocities are.
Have you looked at the relation between deformation velocity and shear stresses? Is it reasonable?
I only noticed the original post now. There is no issue at all here, apart from visualization. Change or no change in box direction is mathematically fully equivalent. The behavior of the system is identical in both cases.