Skip to content

Add "plot streamlines" capabilities #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Jul 26, 2023
Merged

Add "plot streamlines" capabilities #1036

merged 36 commits into from
Jul 26, 2023

Conversation

anslpa
Copy link
Contributor

@anslpa anslpa commented Jul 18, 2023

Enhancement

Add streamlines plotting capabilities to the DpfPlotter.

Work done

  • add "helpers" module in ansys.dpf.core, with a first "utils" and "streamlines" submodules.
  • add a "compute_streamlines" method in the helpers module, with:
    • capability to return source (source is displayed with this argument)
    • all the kwargs of "pyvista.DataSetFilters.streamlines" and "pyvista.DataSetFilters.streamlines_from_source"
  • add "add_streamline" method with:
    • capability to change the radius of the streamline when plotting
    • a permissive option to allow the plot (to see the source location) even if the streamline is empty
  • add examples for computing and plotting 2D and 3D models
  • add "plane" capability for "show_figure" method (allows to plot in a defined plane, e.g. (XY))
  • performance testing (see report below)
  • tested with PyVista 0.38.1 and 0.40.*

Performances

image

Streamline plot example

image

@anslpa anslpa added documentation Improvements or additions to documentation enhancement New feature or request examples Related to PyDPF-Core examples labels Jul 18, 2023
@anslpa anslpa requested a review from PProfizi July 18, 2023 10:15
@anslpa anslpa requested review from rafacanton and MichaelNale July 18, 2023 10:24
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #1036 (fa409b3) into master (6267e78) will decrease coverage by 0.50%.
The diff coverage is 41.83%.

@@            Coverage Diff             @@
##           master    #1036      +/-   ##
==========================================
- Coverage   88.14%   87.65%   -0.50%     
==========================================
  Files          78       80       +2     
  Lines        8998     9078      +80     
==========================================
+ Hits         7931     7957      +26     
- Misses       1067     1121      +54     

@anslpa anslpa requested a review from JennaPaikowsky July 18, 2023 13:18
@anslpa anslpa requested a review from cbellot000 July 19, 2023 11:56
anslpa and others added 2 commits July 25, 2023 15:54
* Add helpers

* enhance descr

* Prepare "compute_streamlines" method and adapt the examples/plot code. Remaining is the implementation.

* try pyvista import

* protoype working return pv.DataSets and pv.PolyData

* fix raising

* create helpers module as folder

* update src

* use translation methods

* typo

* first tries for creating pvDataSet

* Add streamlines and streamlinessource classes

* Remove meshed_region and field attributes from add_streamline, update all examples to use "compute_streamline"

* replace computed_streamlines and computed_source

* update docstring

* update docstring and fix computed_streamlines

* style check

* style check

* use pv_data_set

* Fix doc
@PProfizi PProfizi added this to the v0.9.0 milestone Jul 25, 2023
…ects (#1070)

* Implement base class for streamlines object, to prepare the conversion of the _pv_data_set to the _fc

* fix faces

* style check

* style check

* style check
@anslpa anslpa merged commit 4786dbc into master Jul 26, 2023
@anslpa anslpa deleted the plot/streamlines branch July 26, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request examples Related to PyDPF-Core examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants