Phase singularity analysis provides a quantitative description of spiral wave patterns observed in chemical or biological excitable media. The configuration of phase singularities (locations and directions of rotation) is easily derived from phase maps in two-dimensional manifolds. The question arises whether one can construct a phase map with a given configuration of phase singularities. The existence of such a phase map is guaranteed provided that the phase singularity configuration satisfies a certain constraint associated with the topology of the supporting medium. This paper presents a constructive mathematical approach to numerically solve this problem in the plane and on the sphere as well as in more general geometries relevant to atrial anatomy including holes and a septal wall. This tool can notably be used to create initial conditions with a controllable spiral wave configuration for cardiac propagation models and thus help in the design of computer experiments in atrial electrophysiology.