  In this paper we study the switching properties of the dynamics of magnetic
moments, that interact with an elastic medium. To do so we construct a
Hamiltonian framework, that can take into account the dynamics in phase space
of the variables that describe the magnetic moments in a consistent way. It is
convenient to describe the magnetic moments as bilinears of anticommuting
variables that are their own conjugates. However, we show how it is possible to
avoid having to deal directly with the anticommuting variables themselves, only
using them to deduce non-trivial constraints on the magnetoelastic couplings.
We construct the appropriate Poisson bracket and a geometric integration
scheme, that is symplectic in the extended phase space and that allows us to
study the switching properties of the magnetization, that are relevant for
applications, for the case of a toy model for antiferromagnetic NiO, under
external stresses. In the absence of magnetoelastic coupling, we recover the
results reported in the literature and in our previous studies. In the presence
of the magnetoelastic coupling, the characteristic oscillations of the
mechanical system have repercussions on the N\'eel order parameter dynamics.
This is particularly striking for the spin accumulation which is more than
doubled by the coupling to the strain ; here as well, the mechanical
oscillations are reflected on the magnetic dynamics. As a consequence of such a
stress induced strain, the switching time of the magnetization is slightly
faster and the amplitude of the magnetization enhanced.
