"Plot over line" the graph of analytical expression (as a function of x,t) over various time

I have a function u(x,t) = 10\sin(\frac{\pi}{10} t)\left(x^3 - 10 x^2 + 25 x\right) i.e. a function of time ‘t’ and 1D space co-ordinate ‘x’.

A numerical approximation of this solution has been obtained by solving a PDE and has been written as .vtu files to disk. I have managed to visualize these numerical solutions by using the ‘plot over line’ filter. Attached first 10 time-step files.solution-dopri-000.vtu (1.6 KB) solution-dopri-010.vtu (2.0 KB) solution-dopri-020.vtu (2.0 KB) solution-dopri-030.vtu (2.0 KB) solution-dopri-040.vtu (2.0 KB) solution-dopri-050.vtu (2.0 KB) solution-dopri-060.vtu (2.0 KB) solution-dopri-070.vtu (2.0 KB) solution-dopri-080.vtu (2.0 KB) solution-dopri-090.vtu (2.0 KB) solution-dopri-100.vtu (2.0 KB)

I now want to superimpose the spatial plot of the analytical equation for u(x,t) at each time-step. How can I do this in Paraview?

Sounds like the filter “Python Calculator” should be able to compute this function.

@mwestphal can you elaborate just a bit more? I am fairly new to Paraview. I wish to plot over the 1D spatial domain, the numerical solution in red, the analytical solution in blue, and have them both evolve as I click the time-animation control buttons. Ideally, the numerical and analytical curves should lie on top of each other.

Why a filter? I don’t want to filter any existing data. I think you meant a ‘source’, right? However, the python calculator source is greyed out.

  • Open ParaView
  • File -> Open -> solution-dopri-* -> Apply
  • Filters -> PlotData -> Apply
  • Use “Point X” as an X array.
  • Change “solution” color to red -> That’s your first curve
  • Filters -> Python Calculator
  • Write your expression. inputs[0].Points[:,0] is your x, time_value is your t
  • Apply
  • Change result color to blue -> That’s your second curve