In this paper, we present an algorithm for partitioning any given 2d domain into regions suitable for quadrilateral meshing. It can deal with multi-domain geometries with ease, and is able to preserve the symmetry of the domain. Moreover, this method keeps the number of singularities at the junctions of the regions to a minimum. Each part of the domain, being four-sided, can then be meshed using a structured method. The partitioning stage is achieved by solving a PDE constrained problem based on the geometric properties of the domain boundaries.