-
Notifications
You must be signed in to change notification settings - Fork 5
Feat/plug in pyvista as plotter #437
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
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
5fe273b
build: Bump version to v0.11.dev0
prmukherj 7da40a0
Merge branch 'main' into release/v0.11.dev0
prmukherj cd34356
Merge branch 'release/v0.11.dev0' of https://github.com/pyansys/pyflu…
prmukherj d17fb8a
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj fe41ed1
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj de52b2e
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 9c7a215
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 616dea1
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 30e5c5c
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 0d91d78
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 2a1d92f
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 03be4f5
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 14c2013
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj 1c410d7
Merge branch 'main' of https://github.com/pyansys/pyfluent-visualizat…
prmukherj b4df79e
feat: Plug in pyvista as an alternate plotter.
prmukherj 5c3ca7f
Update test.
prmukherj 39f22ec
Update docs.
prmukherj 425e6b9
Update docs.
prmukherj 2faf80f
Add abstract class for plotters.
prmukherj 932c9ca
Restructure pyvista -> graphic
prmukherj 9ec22a2
Rename docs.
prmukherj 56020e6
Add docstring.
prmukherj cfda0f3
Refactor graphics.
prmukherj 413a2fd
Refactor.
prmukherj fcd8c96
Fix docs.
prmukherj 1a6ecfa
Refactor.
prmukherj 5bca610
Refactor.
prmukherj e5964cd
Refactor.
prmukherj 3a6e960
Refactor.
prmukherj ffede36
Bug fix for notebook.
prmukherj ed48d1d
Merge branch 'main' into feat/plug_in_pyvista_as_plotter
prmukherj d520b0d
Set a default value for config.
prmukherj c36573a
Merge branch 'feat/plug_in_pyvista_as_plotter' of https://github.com/…
prmukherj ffbd5ad
Bug fixing in multi-plotter.
prmukherj f2708a2
Added exapmple script for additional testing.
prmukherj 96047f2
Update examples.
prmukherj e3f8dfd
Merge branch 'main' into feat/plug_in_pyvista_as_plotter
prmukherj 2b7b34d
Merge branch 'main' into feat/plug_in_pyvista_as_plotter
prmukherj ea62f91
Add deprecated modules.
prmukherj f57e86c
Merge branch 'main' into feat/plug_in_pyvista_as_plotter
prmukherj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| """.. _ref_script_manifold: | ||
| Triggering callbacks and Animation | ||
| ---------------------------------- | ||
| This example uses PyVista and Matplotlib to demonstrate the use | ||
| of callback mechanisms. The 3D model in this example | ||
| is an exhaust manifold. | ||
| """ | ||
|
|
||
| ############################################################################### | ||
| # Run the following in command prompt to execute this file: | ||
| # exec(open("script_manifold.py").read()) | ||
|
|
||
| import ansys.fluent.core as pyfluent | ||
|
|
||
| session = pyfluent.connect_to_fluent(ip="10.18.44.105", port=62599, password="hzk1dhbc") | ||
|
|
||
| from ansys.fluent.visualization import set_config | ||
|
|
||
| set_config(blocking=False) | ||
|
|
||
|
|
||
| from ansys.fluent.visualization import Graphics, Plots | ||
| from ansys.fluent.visualization.graphics import graphics_windows_manager | ||
| from ansys.fluent.visualization.plotter import plotter_windows_manager | ||
|
|
||
| # get the graphics objects for the session | ||
| graphics_session1 = Graphics(session) | ||
| graphics_session1_1 = Graphics(session) | ||
|
|
||
| # mesh | ||
| mesh1 = graphics_session1.Meshes["mesh-1"] | ||
| mesh1.show_edges = True | ||
| mesh1.surfaces_list = ["solid_up:1:830"] | ||
|
|
||
| # pathlines | ||
| pathlines1 = graphics_session1.Pathlines["pathlines-1"] | ||
| pathlines1.field = "velocity-magnitude" | ||
| pathlines1.surfaces_list = ["inlet"] | ||
|
|
||
| # contour | ||
| contour1 = graphics_session1.Contours["contour-1"] | ||
| contour1.field = "velocity-magnitude" | ||
| contour1.surfaces_list = ["solid_up:1:830"] | ||
|
|
||
|
|
||
| graphics_session1.Contours["contour-2"] | ||
| graphics_session1_1.Contours["contour-3"] | ||
|
|
||
| # vector | ||
| vector1 = graphics_session1_1.Vectors["vector-1"] | ||
| vector1.surfaces_list = ["solid_up:1:830"] | ||
| vector1.scale = 4.0 | ||
| vector1.skip = 0 | ||
| vector1.field = "temperature" | ||
| vector1.display() | ||
|
|
||
| # iso surface | ||
| surface1 = graphics_session1_1.Surfaces["surface-1"] | ||
| surface1.definition.type = "iso-surface" | ||
| surface1.definition.iso_surface.field = "velocity-magnitude" | ||
| surface1.definition.iso_surface.rendering = "contour" | ||
| surface1.definition.iso_surface.iso_value = 0.0 | ||
|
|
||
|
|
||
| local_surfaces_provider = Graphics(session).Surfaces | ||
| matplotlib_plots1 = Plots(session, local_surfaces_provider=local_surfaces_provider) | ||
|
|
||
|
|
||
| p1 = matplotlib_plots1.XYPlots["p1"] | ||
| p1.surfaces_list = ["solid_up:1:830", "surface-1"] | ||
| p1.surfaces_list = ["solid_up:1:830"] | ||
| p1.y_axis_function = "temperature" | ||
| p1.plot("p1") | ||
|
|
||
| session.monitors.get_monitor_set_names() | ||
| residual = matplotlib_plots1.Monitors["residual"] | ||
| residual.monitor_set_name = "residual" | ||
| residual.plot("residual") | ||
|
|
||
| mtr = matplotlib_plots1.Monitors["mass-tot-rplot"] | ||
| mtr.monitor_set_name = "mass-tot-rplot" | ||
| mtr.plot("mass-tot-rplot") | ||
|
|
||
| mbr = matplotlib_plots1.Monitors["mass-bal-rplot"] | ||
| mbr.monitor_set_name = "mass-bal-rplot" | ||
| mbr.plot("mass-bal-rplot") | ||
|
|
||
| mesh1.display("mesh-1") | ||
| vector1.display("vector-1") | ||
| contour1.display("contour-1") | ||
| pathlines1.display("pthlines-1") | ||
| plotter = graphics_windows_manager.get_plotter("contour-1") | ||
| plotter.view_isometric() | ||
| surface1.display("surface-1") | ||
|
|
||
|
|
||
| def auto_refersh_call_back_iteration(session_id, event_info): | ||
| if event_info.index % 1 == 0: | ||
| graphics_windows_manager.refresh_windows(session_id, ["contour-1"]) | ||
| plotter_windows_manager.refresh_windows( | ||
| session_id, ["residual", "mass-tot-rplot", "mass-bal-rplot"] | ||
| ) | ||
|
|
||
|
|
||
| def auto_refersh_call_back_time_step(session_id, event_info): | ||
| graphics_windows_manager.refresh_windows(session_id) | ||
| plotter_windows_manager.refresh_windows("", ["residual"]) | ||
|
|
||
|
|
||
| def initialize_call_back(session_id, event_info): | ||
| graphics_windows_manager.refresh_windows(session_id) | ||
| plotter_windows_manager.refresh_windows("", ["residual", "mass-tot-rplot"]) | ||
|
|
||
|
|
||
| cb_init_id = session.events.register_callback("InitializedEvent", initialize_call_back) | ||
| cb_data_read_id = session.events.register_callback( | ||
| "DataReadEvent", initialize_call_back | ||
| ) | ||
| cb_itr_id = session.events.register_callback( | ||
| "IterationEndedEvent", auto_refersh_call_back_iteration | ||
| ) | ||
|
|
||
prmukherj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| graphics_windows_manager.animate_windows(session.id, ["contour-1"]) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.