Simulation of celestial body mechanics using finite element method