streamlines_evenly_spaced_2D

ExplicitStructuredGrid.streamlines_evenly_spaced_2D(vectors=None, start_position=None, integrator_type=2, step_length=0.5, step_unit='cl', max_steps=2000, terminal_speed=1e-12, interpolator_type='point', separating_distance=10, separating_distance_ratio=0.5, closed_loop_maximum_distance=0.5, loop_angle=20, minimum_number_of_loop_points=4, compute_vorticity=True, progress_bar=False)

Generate evenly spaced streamlines on a 2D dataset.

This filter only supports datasets that lie on the xy plane, i.e. z=0. Particular care must be used to choose a separating_distance that do not result in too much memory being utilized. The default unit is cell length.

Warning

This filter is unstable for vtk<9.0. See pyvista issue 1508.

Parameters
vectorsstr, optional

The string name of the active vector field to integrate across.

start_positionsequence(float), optional

The seed point for generating evenly spaced streamlines. If not supplied, a random position in the dataset is chosen.

integrator_type{2, 4}, optional

The integrator type to be used for streamline generation. The default is Runge-Kutta2. The recognized solvers are: RUNGE_KUTTA2 (2) and RUNGE_KUTTA4 (4).

step_lengthfloat, optional

Constant Step size used for line integration, expressed in length units or cell length units (see step_unit parameter).

step_unit{‘cl’, ‘l’}, optional

Uniform integration step unit. The valid unit is now limited to only LENGTH_UNIT ('l') and CELL_LENGTH_UNIT ('cl'). Default is CELL_LENGTH_UNIT: 'cl'.

max_stepsint, optional

Maximum number of steps for integrating a streamline. Defaults to 2000.

terminal_speedfloat, optional

Terminal speed value, below which integration is terminated.

interpolator_typestr, optional

Set the type of the velocity field interpolator to locate cells during streamline integration either by points or cells. The cell locator is more robust then the point locator. Options are 'point' or 'cell' (abbreviations of 'p' and 'c' are also supported).

separating_distancefloat, optional

The distance between streamlines expressed in step_unit.

separating_distance_ratiofloat, optional

Streamline integration is stopped if streamlines are closer than SeparatingDistance*SeparatingDistanceRatio to other streamlines.

closed_loop_maximum_distancefloat, optional

The distance between points on a streamline to determine a closed loop.

loop_anglefloat, optional

The maximum angle in degrees between points to determine a closed loop.

minimum_number_of_loop_pointsint, optional

The minimum number of points before which a closed loop will be determined.

compute_vorticitybool, optional

Vorticity computation at streamline points. Necessary for generating proper stream-ribbons using the vtkRibbonFilter.

progress_barbool, optional

Display a progress bar to indicate progress.

Returns
pyvista.PolyData

This produces polylines as the output, with each cell (i.e., polyline) representing a streamline. The attribute values associated with each streamline are stored in the cell data, whereas those associated with streamline-points are stored in the point data.

Examples

Plot evenly spaced streamlines for cylinder in a crossflow. This dataset is a multiblock dataset, and the fluid velocity is in the first block.

>>> import pyvista
>>> from pyvista import examples
>>> mesh = examples.download_cylinder_crossflow()
>>> streams = mesh[0].streamlines_evenly_spaced_2D(start_position=(4, 0.1, 0.),
...                                                separating_distance=3,
...                                                separating_distance_ratio=0.2)
>>> plotter = pyvista.Plotter()
>>> _ = plotter.add_mesh(streams.tube(radius=0.02), scalars="vorticity_mag")
>>> plotter.view_xy()
>>> plotter.show()
../../../_images/pyvista-ExplicitStructuredGrid-streamlines_evenly_spaced_2D-1_00_00.png

See 2D Streamlines for more examples using this filter.