Dipolar Halbach magnet stacks made from identically shaped permanent magnets for magnetic resonance