- Thank you received: 0
VTK file for visualisation of stream line in paraview
3 years 7 months ago #3685
by Younghigh
VTK file for visualisation of stream line in paraview was created by Younghigh
Hi,
After running the following code:
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
After running the following code:
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()
Best,
Di Yang
3 years 7 months ago #3686
by schruste
Replied by schruste on topic VTK file for visualisation of stream line in paraview
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
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
The following user(s) said Thank You: Younghigh
Time to create page: 0.093 seconds