Pattern formation in micromagnetics