Cycling the movement of border and mesh

Hi, I am a new user of Freefem and need to cycle movement of border and mesh following displacement for an elastoplasticity problem. I first tried a lengthy procedure with movemesh but it does not include border movement and does not work. I guess I should use adaptmesh but how? Thank you for helping.

I’m new to FreeFEM too and thought adaptmesh would fix everything
but there are limitations in particular I don’t think it worked with 3D mesh.
Are you working in 2D or 3D or maybe someone can explain that
it does not matter.