Attempting to create a mesh of streamlines returns an empty mesh each time. My mesh is 2D and the cells are 2D as well. #7737
Replies: 1 comment
-
The default behavior of You could use the import pyvista as pv
import numpy as np
center = (0, 0, 0)
n=15
radius = 1
theta = np.linspace(0, 2 * np.pi, n, endpoint=False)
x_coords = radius * np.cos(angles) + center[0]
y_coords = radius * np.sin(angles) + center[1]
z_coords = np.zeros(n) + center[2]
points = np.column_stack((x_coords, y_coords, z_coords))
source = pv.PolyData(points)
grid.streamlines_from_source(source, surface_streamlines=True, ...) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First check
Commit to Help
Sample Code What is the problem, question, or error?
Write a short description telling me what you are doing, what you expect to happen, and what is currently happening.
Description
In the code below, I have created my original mesh as
domain
indolfinx
with cell type quadrilateral which is 2D, the domain is then used to created a mesh in Pyvista calledgrid
usingUnstructuredGrid
and dolfinx'svtk_mesh
to output the necessary input information, and this was inputted along with the topological dimension of the entities indomain
extracted which is 2. In the screenshots section, I added an image showing the dimensionality and type of the cells ingrid
.After going through the process of solving for
chi
, I've subsequently computed the vector quantityvc
and put the values stored in this variable inside thegrid
and then successfully created a mesh ofglyphs
out of this variable. When attempting to create a mesh ofstreamlines
out ofvc
, it fails each time.Below is the entirety of my code, hopefully users here have
dolfinx
and are able to run this:Here is a plot of the solution and the associated vector field ignoring the streamlines error message about
streamlines
being empty:My goal is to have a set of streamlines pointing out from the center connecting the arrows, but I can't get a single streamline to work. Not sure why as in another post, one of the requirements for streamlines was that the cells had to be 2D or 3D, so I have that requirement down.
System Information
Screenshots
Beta Was this translation helpful? Give feedback.
All reactions