Requesting pair style parameters in compute

Dear fellow LAMMPS users,

I am in the process of making a new compute function, one that requires a parameter defined in my pair style. More specifically, I would like this compute to request the normal stiffness (Kn) as used in the pair_gran_hooke style. Is there a way to communicate these kind of parameters between the different classes in LAMMPS?

For your information: I am using the rather old version 2013/04/02.

Thanks and regards,

Martijn van den Ende

Dear fellow LAMMPS users,

I am in the process of making a new compute function, one that requires a
parameter defined in my pair style. More specifically, I would like this
compute to request the normal stiffness (Kn) as used in the pair_gran_hooke
style. Is there a way to communicate these kind of parameters between the
different classes in LAMMPS?

the established protocol to do this would be to add an "extract()"
method to the pair style and then use that accordingly.
see compute_fep.cpp and pair styles like pair_lj_cut_coul_long.cpp for
an example.

For your information: I am using the rather old version 2013/04/02.

which means, that you are missing out on a lot of bugfixes and
enhancements. also, nobody will want to help in case any changes to
the baseline LAMMPS code are necessary (though this is unlikely for
this specific case). since you are doing development, an upgrade to
the current version is strongly recommended.

axel.

Dear Axel,

Thanks for your reply, I will look into the extract() function. I am aware that running an older version is not ideal, but my research group has chosen to stick to that particular version, so leaping forward in time is not desired, as there will likely be compatibility issues.

Regards,

Martijn van den Ende