Inducing energy gaps in monolayer and bilayer graphene: Local density approximation calculations