Creating streamplot for visualisation #1174
-
Hi, I am trying to use scikit-fem for solving steady-state seepage flow. I was able to create the contour levels to represent equipotential lines. Is there a way to create unbroken stream plot to represent the streamlines? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The plotting functionality in scikit-fem is pretty rudimentary, it basically consists of a single file here, with some very basic features: https://github.com/kinnala/scikit-fem/blob/master/skfem/visuals/matplotlib.py If you need more complicated plots, I suggest that you save your results to VTK file and use Paraview to create visualizations. You can save a P1 finite element field to a file as follows: from skfem import *
m = MeshTri().refined(3)
basis = Basis(m, ElementTriP1())
# a field with x-, y- and z-components
fx = m.p[0]
fy = m.p[1]
fz = 0 * m.p[0]
m.save('output.vtk', point_data={'f': np.array([fx, fy, fz]).T}) Paraview is a designated tool for visualizing VTK files and it has lots of functionality, including the creation of streamline plots: |
Beta Was this translation helpful? Give feedback.
-
Thank you for your prompt reply! |
Beta Was this translation helpful? Give feedback.
The plotting functionality in scikit-fem is pretty rudimentary, it basically consists of a single file here, with some very basic features: https://github.com/kinnala/scikit-fem/blob/master/skfem/visuals/matplotlib.py
If you need more complicated plots, I suggest that you save your results to VTK file and use Paraview to create visualizations.
You can save a P1 finite element field to a file as follows:
Paraview is a designated tool for visualizing VTK files and it ha…