We present numerical calculations of lamellar phases of block copolymers at patterned surfaces.We model symmetric di-block copolymer films forming lamellar phases and the effect of geometrical and chemical surface patterning on the alignment and orientation of lamellar phases. The calculations are done within self-consistent field theory (SCFT), where the semi-implicit relaxation scheme is used to solve the diffusion equation. Two specific set-ups, motivated by recent experiments, are investigated. In the first, the film is placed on top of a surface imprinted with long chemical stripes. The stripes interact more favorably with one of the two blocks and induce a perpendicular orientation in a large range of system parameters. However, the system is found to be sensitive to its initial conditions, and sometimes gets trapped into a metastable mixed state composed of domains in parallel and perpendicular orientations. In a second set-up, we study the film structure and orientation when it is pressed against a hard grooved mold. The mold surface prefers one of the two components and this set-up is found to be superior for inducing a perfect perpendicular lamellar orientation for a wide range of system parameters.