Hammer load on a pile

How can I set up a cyclic impact of a hammer while pile loading (preferably in 2D)? I would like to see the displacement in the surrounding soil while the pile was hit 100 times (for example).

Thank you