[lammps-users] call a class

Dear all;

I want to call some private functions of PairTersoff class in Compute_ke
class.
I called PairTersoff class in Compute_ke class:

class PairTersoff *name1;

Then I used the following command to call a private function of
PairTersoff class such as func1:

name1->func1()

but it says this is a private function and I am not allowed to use this
function.

Is there any way to solve my problem?
Any help would be appreciated.

Ali Rajabpour

Ali,

What about simply making that private function a public function in your version of LAMMPS? It might risk data corruption, but would probably give you the access from outside the class that you want.

Paul

Learn about using the "friend" statement in a class to allow another
class access to the private methods.

Steve