Magnetization patterns of permalloy square frames