Is there any examples about using pyvista to visualize scalar solution in dynamic mixed-element problem?

This is the setup of my fenicsx and pyvista code

plotter = pyvista.Plotter()
plotter.open_gif("deformation.gif", fps=3)
p_vis_space = Y.sub(0).collapse().function_space
topology, cells, geometry = plot.vtk_mesh(p_vis_space)
grid = pyvista.UnstructuredGrid(topology, cells, geometry)
grid["pressure"] = Y.sub(0).collapse().x.array
grid.set_active_scalars("pressure")
warped = grid.warp_by_scalar("pressure")
actor = plotter.add_mesh(warped, show_edges=True, lighting=False)

and I invoke this via

warped.point_data["pressure"][:] = Y.sub(0).collapse().x.array

#filename = os.path.join(image_output_dir, f"pressure_t_{t:.4e}.png")
#plotter.screenshot(filename)
plotter.write_frame()

But when I render it, it only shows the bar and not the result, I wonder whether there is an example about using pyvista to visualize scalar in dynamic mixed-element case, I want to save screenshot of each visualization of each step, but the examples I can find only show how to do it in static case or just save it to gif, my FEnicsx version is 0.9

First of all, warping by pressure that has a magnitude of 1e6 doesn’t seem like a good idea.

Secondly, I would do the following:

p_vis_space, p_map = Y.function_space.sub(0).collapse()
topology, cells, geometry = plot.vtk_mesh(p_vis_space)
grid = pyvista.UnstructuredGrid(topology, cells, geometry)
grid["pressure"] = Y.x.array[p_map]

and then

warped.point_data["pressure"][:] = Y.x.array[p_map]

However, as stated before, warping with the magnitude that you are doing is probably what is causing the issue, try to use the factor parameter: pyvista.DataSetFilters.warp_by_scalar — PyVista 0.46.3 documentation