This work concerns with the following problem. Given a two-dimensional domain whose boundary is a closed polygonal line with internal boundaries defined also by polygonal lines, it is required to generate a grid consisting only of quadrilaterals with the following features: (1) conformal, that is, to be a tessellation of the two-dimensional domain such that the intersection of any two quadrilaterals is a vertex, an edge or empty (never a portion of one edge), (2) structured, which means that only four quadrilaterals meet at a single node and the quadrilaterals that make up the grid need not to be rectangular, and (3) the mesh generated must be supported on the internal boundaries. The fundamental technique for generating such grids, is the deformation of an initial Cartesian grid and the subsequent alignment with the internal boundaries. This is accomplished through the numerical solution of an elliptic partial differential equation based on finite differences. The large nonlinear system of equation arising from this formulation is solved through spectral gradient techniques. Examples of typical structures corresponding to a two-dimensional, areal hydrocarbon reservoir are presented.