Molecular-dynamic modeling of processes of heating and melting of metals. Part I. Model and computational algorithm