Dear all,

I am doing a simulation where I am deforming the box using fix deform:

fix 2 all deform 1 xy erate 0.001 remap x

In this test run, I am using lj/cut potential and dumping the coordinates via following commands:

pair_style lj/cut 2.5

pair_coeff 1 1 1.0 1.0 2.5

dump d1 all custom 1000 dump.deform id x y z

Now, I want to calculate the potential energy of the system using deformed configurations obtained via the dump. I am able to calculate and match the potential energy of the system with thermo outputs when tilt is zero i.e., the box is orthogonal. But, for deformed configurations i.e., with nonzero tilts, I am not able to figure out the calculation for potential energy using appropriate PBC and MIC.

It would be really helpful if someone suggest the steps using which I could calculate potential energy of deformed configurations.

thanks and regards

Vinay

I am confused. You have LAMMPS compute the energy and then you try to compute it again?

What is the purpose? and how is this a LAMMPS question?

Please elaborate.

Thanks Axel for your response! Yesâ€¦there is indeed LAMMPS compute which can do this. But, I want to learn this concept because I need to calculate some structural correlations which is not available in LAMMPS. Once I get this idea of calculating potential energy then this would be helpful for me to calculate the structural correlations.

And really sorry, this is a general question.

There is nothing particular in how LAMMPS computes interactions in deformed cells versus orthogonal cells. The code for computing the energy and forces is **exactly** the same.

LAMMPS is not subject to minimum image conventions because it handles periodic boundaries the same way as it does domain decomposition: each box has **copies** of atoms up to the communication cutoff (usually the same as the neighborlist cutoff) from neighboring sub-domains. The only step that is different for deformed cells is the building of the neighbor lists where it cannot rely on certain symmetries that apply to orthogonal boxes.

As for writing and debugging your own force/energy kernel. That is something that is off-topic for this area of the forum. I suggest you look into one of the text books on MD simulations (the good ones have more practical information about programming) and take it from there.