Simulation of electroforming of the Pt/NiO/Pt switching memory structure