Smart stiffness computation of one-dimensional Finite Elements