A contact searching algorithm for general 3-D contact-impact problems