Magnetic Field and Stress Analysis for a Ferromagnetic Material