streamlines_evenly_spaced_2D: Segmentation fault when using vtk==8.2.0
See original GitHub issueDescribe the bug, what’s wrong, and what you expect:
When my test plot of a dipole field, changing some of the default parameters leads to a segmentation fault. I’m using the git dev0 version (e79c03369dcaf57292ae6b7b366410d82debcee7), NOT the 0.13.3 release (which does not have the streamlines_evenly_spaced_2d
feature).
I have also tested the data in Paraview using the corresponding filter and it worked fine.
To Reproduce
Please include a code snippet to reproduce the bug in the block below:
# Full code https://gist.github.com/liangwang0734/5d734a82dedefcfeaf078ffa9f18eb60
streamlines = grid.streamlines_evenly_spaced_2D(
vectors='bfield',
start_position=(-0.6, 0, 0),
integrator_type=2,
step_length=0.2,
step_unit='cl',
max_steps=2000,
terminal_speed=1e-12,
interpolator_type='point',
separating_distance=10,
separating_distance_ratio=0.004, # default is None
closed_loop_maximum_distance=0.5,
loop_angle=20,
minimum_number_of_loop_points=4,
compute_vorticity=True)
Screenshots If applicable, add screenshots to help explain your problem.
System Information: Please run the following code wherever you are experiencing the bug and paste the output below. This report helps us track down bugs and it is critical to addressing your bug:
# Get system info
import pyvista as pv
print(pv.Report())
Date: Fri Jul 09 22:40:43 2021 EDT
OS : Linux
CPU(s) : 8
Machine : x86_64
Architecture : 64bit
RAM : 31.2 GiB
Environment : Python
GPU Vendor : NVIDIA Corporation
GPU Renderer : NVIDIA GeForce MX130/PCIe/SSE2
GPU Version : 4.5.0 NVIDIA 465.31
Python 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0]
pyvista : 0.31.dev0
vtk : 8.2.0
numpy : 1.19.2
imageio : 2.9.0
appdirs : 1.4.4
scooby : 0.5.7
meshio : 4.4.6
matplotlib : 3.3.2
IPython : 7.25.0
scipy : 1.6.2
tqdm : 4.49.0
Intel(R) Math Kernel Library Version 2020.0.4 Product Build 20200917 for
Intel(R) 64 architecture applications
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
Sounds like you uncovered a bug in vtk that was fixed. I will update the title so it is easier to find for others that run into the same issue.
Thanks for testing this new feature before release. I cannot test your code directly for a little over a week, but I have some comments/questions until then. Is the segfault occurring during the streamline generation or plotting in matplotlib?
I find it isn’t uncommon for seg faults to occur in the streamlines filter with choices of small numbers for the
separating_distance
andseparating_distance_ratio
.separating_distance_ratio
in particular sets the distance to terminate adjacent streamlines according toseparating_distance*separating_distance_ratio
, so your value is equal to .04 cell lengths. You can try increasingseparating_distance_ratio
and see if it helps. It is unclear what the default value is in the underlying vtk filter.Was this with the exact same parameters that fails here? I’m not sure that the defaults in paraview are the same as in the underlying vtk filter or the values used in pyvista.