Accessing spatial data

I want to access the data that I write to the paraview file by

V = FunctionSpace(mesh,'CG',1)
pnew = Function(V)
p_p = LinearVariationalProblem(lhs(E_p),rhs(E_p),pnew)
pfile = File ("phi.pvd")
pfile << pnew

during the simulation.
So in the above code, I see the coordinates and the corresponding values of the pnew in the Paraview file. How can I get them during the simulation?
Thank you.

Tabulate the dof coordinates of the function space,
Which relates to the ith input of the p_new.vector()[i]