VTK file for visualisation of stream line in paraview

Hi,

After running the following code:

V = VectorL2(mesh, order=2, dgjumps=True)
Q = L2(mesh, order=1, dgjumps=True)
X = FESpace([V,Q])
...
gfu = GridFunction(X)
...
uh, ph = gfu.components
vtk = VTKOutput(ma=mesh, coefs=[uh,uh[0],uh[1],ph,grad(uh)[0,0]+grad(uh)[1,1]],\
                             names=["velsol","usol","vsol","psol","divsol"], filename="plot_ex", subdivision=3)
vtk.Do()

I cannot see the stream line graph of the velocity field but just a plane plot of Norm(uh). How can we recieve stream line graph, i.e., a vector graph with vector-valued (uh[0], uh[1]) in VTKOutput(…)?

Best,
Di Yang

Hi Di Yang,

This is not a problem of ngsolve or vtk, it’s a Paraview thing (you can also find it in the forum several times). Paraview only treats 3D vector fields for streamlines and other filters. So, extend your 2D by a third component and you are fine. You can do this during export or on the Paraview side using the Calculator filter.

Best,
Christoph