Trouble exporting the pressure in a time-dependent Navier-Stokes simulation using the Taylor method for flow around a cylinder

Resolution of problem

xdmf_p = XDMFFile(mesh.comm,“preassure2.xdmf”, “w”)
xdmf_p.write_mesh(mesh)

xdmf_u = XDMFFile(mesh.comm, “velocity2.xdmf”, “w”)
xdmf_u.write_mesh(mesh)

t = 0.0

V0, dofs = W.sub(0).collapse()

Q0, dofs_p = W.sub(1).collapse()

u = up.sub(0)

up_old.x.array[:] = 0.0
ii = 0

while t < T:

        ii += 1
 
        t += float(dt)

        
        r = solver.solve(up)

        if mesh.comm.rank == 0:
            print(f"Step {ii}: Time {t}[s] : Num iterations: {r[0]}")


        u_mixed, p_mixed = up.split()
   

        p_interp = Function(Q0)
        p_interp.interpolate(p_mixed)
        xdmf_p.write_function(p_interp, t)
        

        u_proj = Function(V0)
        u_proj.interpolate(u_mixed)
        xdmf_u.write_function(u_proj,t)


        up_old.x.array[:] = up.x.array

xdmf_u.close()

I’m having serious difficulties exporting the pressure data in the “XDMFFile” format. The export works correctly for the velocity, but not for the pressure. This is my first question, and I would appreciate any suggestions or help.

Secondly, I’m trying to implement a non-intrusive inline model. If I manage to obtain the velocity and pressure vectors, how could I map them into a u,p\mathbf{u}, pu,p field that is compatible with time-step solution updates?

Thank you very much in advance.