Help getting 2D plot from 3d diffusion equation solution

Hi, I’m solving a point diffusion equation on a 3d boxmesh. The solution is u(t,x,y,z) and looks like this in paraview


but I want to be able to get a 2D plot where I fix say x, y and t and plot u(t_{fixed},x_{fixed},y_{fixed},z) on the vertical axis versus z on the horizontal axis. I have tried looking at slices in paraview but I want to be able to obtain a vector with these values in my python script. I should be able to access them like this?!

You can use PlotOverLine and Save Data to export the results as a csv file for instance.

1 Like

Is it not possible to do this in my for loop when solving for different time values?

Solved this by storing values in loop for each time step

x_fixed_density = 10000
    for n in  np.linspace(x0,1,x_fixed_density):
     P_vals.append(u(n,1,1))