I am not sure whether the utils.getViscoelasticFromSpheres function
could not be avoided... Why not compute all relevant data in the Ip2
functor, since all the input is in input materials and other data
accessible from the Ip2? The viscous constants are interaction property
(not material property in the proper sense).
In Ip2_FrictMat_FrictMat_MindlinPhys for instance, restitution
coefficients are specified using MatchMaker objects (see
https://www.yade-dem.org/sphinx/yade.wrapper.html#yade.wrapper.Ip2_FrictMat_FrictMat_MindlinPhys),
which let one prescribe different values for different material
combinations easily.
Would you think that this would be a viable solution for your
viscoelastic model as well?