VTK file for visualisation of stream line in paraview

1 month 4 days ago #3685 by Younghigh

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)
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(...)?

Di Yang

Please Log in or Create an account to join the conversation.

1 month 4 days ago #3686 by schruste
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.

The following user(s) said Thank You: Younghigh

Please Log in or Create an account to join the conversation.

© 2019 Netgen/NGSolve