Module containing the helpers for streamlines.
Streamlines#
- ansys.dpf.post.helpers.streamlines.plot_streamlines(dataframe: DataFrame, sources: List[dict], set_id: int = 1, streamline_thickness: float | List[float] = 0.01, plot_mesh: bool = True, mesh_opacity: float = 0.3, plot_contour: bool = True, contour_opacity: float = 0.3, **kwargs)#
Plot streamlines based on a vector field DataFrame.
- Parameters:
dataframe (
DataFrame
) – A post.DataFrame object containing a vector field. If present, merges the DataFrame across its zone label before plotting.sources (
List
[dict
]) – A list of dictionaries defining spherical point sources for the streamlines. Expected keywords are “center”, “radius”, “max_time” and “n_points”. Keyword “max_time” is for the maximum integration pseudo-time for the streamline computation algorithm, which defines the final length of the lines. More information is available atpyvista.DataSetFilters.streamlines()
.set_id (
int
, default:1
) – ID of the set (time-step) for which to compute streamlines if the DataFrame object contains temporal data.streamline_thickness (
Union
[float
,List
[float
]], default:0.01
) – Thickness of the streamlines plotted. Use a list to specify a value for each source.plot_contour (
bool
, default:True
) – Whether to plot the field’s norm contour along with the streamlines.contour_opacity (
float
, default:0.3
) – Opacity to use for the field contour in case “plot_contour=True”.plot_mesh (
bool
, default:True
) – Whether to plot the mesh along the streamlines in case “plot_contour=False”.mesh_opacity (
float
, default:0.3
) – Opacity to use for the mesh in case “plot_contour=False” and “plot_mesh=True”.**kwargs