2D minimization

I want to do minimization energy graphene in a 2D periodic way, including optimizing the lattice constant. I have a 3D graphene model. But when i minimize it using discover, other graphene layers automatically pack onto it. How shall i minimize it, while keeping its 2D characteristic?