Skip to content

Creating streamplot for visualisation #1174

Answered by kinnala
tritechgit asked this question in Q&A
Discussion options

You must be logged in to vote

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 ha…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tritechgit
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants