Implementing extract() for MANYBODY potentials

I’m trying to perform free energy computations with the Vashishta potential (part of the MANYBODY package) and would therefore like to use fix adapt which requires the implementation of the extract() method.

I have looked at the source code for already implemented cases in i.e pair_lj_cut.cpp, and think i have understood more or less how extract() should work.

However, it seems like pair_vashishta.cpp (and other potentials in MANYBODY) deviates a bit in how the coefficients of the potential are stored. i.e the epsilon coefficients in pair_lj_cut.cpp are contained in a double** with shape [ntypes+1, ntypes+1]. However, in the Vashishta potential the parameters are stored in an array of “Params” structs.

So from what i understand it is not possible to implement the extract method for MANYBODY potentials. Am i correct in this assumption? If not, any tips as to how i can move forward with this would be greatly appreciated!

The Pair::extract() method can be implemented for any pair style. The issue is more a question of what property do you access and how does it map to a free energy calculation. While for a pairwise additive potential, it is very straightforward to vary a potential between pairs of atom types, with a manybody potential, this is not so simple, since you have also interaction terms for triples of atoms or even larger tuples.

One possible way to work around this would be to introduce a “scale” factor like it is done for EAM.

Thank you for the helpful response. I’ll take a look at how its done in EAM and try to see if i can introduce a similar term to Vashishta.