passing arrays between different classes

Dear lammps users and developers,

I was wondering how I can pass an array between stillinger weber and tersoff. I have a 2D array ( W[i][0]) which contains some values that are calculated from forces in SW potential at each time step. I defined this array as “public” in header of SW file. Please note that “i” is the atom index.
My question is about passing this array to Tersoff potential every time step to do some calculation on it in Tersoff file. Please help me how I can do this.

Thanks

Hossein

Dear lammps users and developers,
I was wondering how I can pass an array between stillinger weber and
tersoff. I have a 2D array ( W[i][0]) which contains some values that are
calculated from forces in SW potential at each time step. I defined this
array as "public" in header of SW file. Please note that "i" is the atom
index.
My question is about passing this array to Tersoff potential every time step
to do some calculation on it in Tersoff file. Please help me how I can do
this.

please improve your C++ knowledge. since both classes are derived from
Pair, the "hackish": solution would be to set this array up in Pair.
the _clean_ solution would be to have a fix allocate and maintain this
data and then *any* style can look up the fix and access the data.
fix property/atom does this, for example.

axel.

Thank you Alex for your answer.

Hossein