Magnetic phase transition and the corresponding magnetostriction of intermetallic compounds RMn2Ge2 (R=Sm, Gd)