Cartesian mesh generation with local refinement for immersed boundary approaches