Gap soliton dynamics in a nonuniform resonant structure.