Adding a new C++ ContactModelΒΆ

This file explains how to create a new ContactModel in Mpacts. ContactModels are certainly the most complex piece of code in Mpacts and there is a very large number of them available > 1000. This is caused by the fact that there are many types of contact models, which has to be multiplied by the combination of possible geometries. For instance the Hertz ContactModel can be defined between Sphere-Sphere, Sphere-Cylinder, Sphere-Triangle, Sphere-Quads, ...

Between these different geometries, much of the work that needs to be done is identical, but a part is different. In order to avoid massive code duplication, there is something called a “ContactChain” in Mpacts. The idea is that we split up the work necessary to calculate a contact into small generic pieces, and combine them all together.