Heat transfer model and finite element formulation for simulation of selective laser melting