Hello everyone,

I am currently working with a system containing one atom type with the interactions between the atoms divided into bonded and non-bonded contributions. In the case of both contributions, the underlying potentials are not analytical but rather table potentials. In my Hamiltonian, I also happen to have an explicit volume dependent term, U_V(V). So my potential would look something as shown below, where U_R(R) denotes the sum of all the usually-existent bonded and non-bonded contributions that depend solely on relative spacing between my atoms (which in my case are tables) and U_V(V) is this â€śunusualâ€ť explicit volume dependent term.

Itâ€™s not a problem to address the dynamics in the NPT ensemble in such special condition (where I have an explicit volume dependent term) given that LAMMPS has a package (BOCS) that allows me to do so in the context of a modified version of the Nose-Hoover approach.

Naturally, like for many properties, the default compute (and output) pressure of LAMMPS would be missing the contribution related to delta(U_V(V))/deltaV. For example, below there is the version of pressure calculation that would be the â€ścompleteâ€ť one in a scenario where there is this explicit volume dependent addend in the Hamiltonian. The phi(r,V) would be my U_V(V).

Computing and outputting the â€śdue pressureâ€ť is not so complicated given that I know the function U_V(V) and could manually add the missing term to the default pressure value by defining variables. Even easier, there is an option to already output the â€śdue pressureâ€ť with a thermo_modify command specific of the BOCS package. Anyways, this is not the problem.

My problem is that now I would very much like to output the stress tensor. I have been trying to find (in a reliable yet effective (low time cost) way) a ready-to-go, complete formula for P_ij. My plan was to do the calculation of the the stress tensor by means of me defining variables as mentioned previously. However, what I am finding seems a little bit out of my league at the moment to be honest as the formulas are â€śa bit not straightforwardâ€ť and so are their derivation :"D

Before grabbing my hat and coat and trying to hardcoreâ€™ly understand the paper and book I have found in order to do things properly, I thought of asking if there is some command within LAMMPS I could use to compute this in an easier/faster way where I can remain ignorant on the formula for P_ij under such condition but be sure that I am computing and outputting it correctly. It doesnt seem that there is one within the BOCS packageâ€¦ but maybe in some other package or some fancy thing that I dont yet knowâ€¦