Magnetization and magnetostriction curves from micromagnetics