In many applications of multilevel/multiscale methods, an active zone must be modeled by a high-level electronic structure method, while a larger environmental zone can be safely modeled by a lower-level electronic structure method, molecular mechanics, or an analytic potential energy function. In some cases though, the active zone must be redefined as a function of simulation time. Examples include a reactive moiety diffusing through a liquid or solid, a dislocation propagating through a material, or solvent molecules in a second coordination sphere (which is environmental) exchanging with solvent molecules in an active first coordination shell. In this article, we present a procedure for combining the levels smoothly and efficiently in such systems in which atoms or groups of atoms move between high-level and low-level zones. The method dynamically partitions the system into the high-level and low-level zones and, unlike previous algorithms, removes all discontinuities in the potential energy and force whenever atoms or groups of atoms cross boundaries and change zones. The new adaptive partitioning (AP) method is compared to Rode's "hot spot" method and Morokuma's "ONIOM-XS" method that were designed for multilevel molecular dynamics (MD) simulationis. MD simulations in the microcanonical ensemble show that the AP method conserves both total energy and momentum, while the ONIOM-XS method fails to conserve total energy and the hot spot method fails to conserve both total energy and momentum. Two versions of the AP method are presented, one scaling as O(2N) and one with linear scaling in N, where N is the number of groups in a buffer zone separating the active high-level zone from the environmental low-level zone. The AP method is also extended to systems with multiple high-level zones to allow, for example, the study of ions and counterions in solution using the multilevel approach.