How is elastic potential energy in a body attained?