We perform a zero-$beta$ magnetohydrodynamic simulation for the C7.7 class flare initiated at 01:18 UT on 2011 June 21 using the Message Passing Interface Adaptive Mesh Refinement Versatile Advection Code (MPI-AMRVAC). The initial condition for the simulation involves a flux rope which we realize through the regularized Biot-Savart laws, whose parameters are constrained by observations from the Atmospheric Imaging Assembly (AIA) on the Solar Dynamics Observatory (SDO) and the Extreme Ultraviolet Imager (EUVI) on the twin Solar Terrestrial Relations Observatory (STEREO). This data-constrained initial state is then relaxed to a force-free state by the magneto-frictional module in MPI-AMRVAC. The further time-evolving simulation results reproduce the eruption characteristics obtained by SDO/AIA 94 A, 304 A, and STEREO/EUVI 304 A observations fairly well. The simulated flux rope possesses similar eruption direction, height range, and velocities to the observations. Especially, the two phases of slow evolution and fast eruption are reproduced by varying the density distribution in light of the filament material draining process. Our data-constrained simulations also show other advantages, such as a large field of view (about 0.76 solar radii). We study the twist of the magnetic flux rope and the decay index of the overlying field, and find that in this event, both the magnetic strapping force and the magnetic tension force are sufficiently weaker than the magnetic hoop force, thus allowing the successful eruption of the flux rope. We also find that the anomalous resistivity is necessary in keeping the correct morphology of the erupting flux rope.