Updated the implementation of the kinetic energy computation in the solid mechanics model.
This commit does something similar to the solid mechanics model as 7be0c462 does to the structural mechanics model.
It adds checks that ensures that the matrices, which are needed in the computation of the kinetic energy realy exists.