ansys-fluent-visualization 0.16.dev0__tar.gz → 0.17.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/LICENSE +7 -7
  2. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/PKG-INFO +10 -8
  3. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/README.rst +1 -1
  4. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/pyproject.toml +8 -5
  5. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/__init__.py +64 -0
  6. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/_config.py +63 -0
  7. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/containers.py +22 -0
  8. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/contour.py +22 -0
  9. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/graphics/__init__.py +28 -0
  10. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/graphics/abstract_graphics_defns.py +66 -0
  11. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/graphics/graphics_objects.py +22 -0
  12. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/graphics/graphics_windows.py +55 -14
  13. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/graphics/graphics_windows_manager.py +103 -9
  14. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/graphics/pyvista/__init__.py +21 -0
  15. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/graphics/pyvista/graphics_defns.py +198 -0
  16. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/matplotlib/__init__.py +39 -0
  17. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/plotter/__init__.py +28 -0
  18. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/plotter/abstract_plotter_defns.py +73 -0
  19. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +21 -0
  20. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/plotter/matplotlib/plotter_defns.py +41 -2
  21. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/plotter/plotly/__init__.py +21 -0
  22. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/plotter/plotly/plotter_defns.py +198 -0
  23. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/plotter/plotter_objects.py +22 -0
  24. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/plotter/plotter_windows.py +35 -15
  25. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/plotter/plotter_windows_manager.py +68 -30
  26. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +21 -0
  27. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/plotter/pyvista/plotter_defns.py +22 -0
  28. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/post_data_extractor.py +22 -0
  29. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/src/ansys/fluent/visualization/post_windows_manager.py +22 -0
  30. ansys_fluent_visualization-0.17.0/src/ansys/fluent/visualization/pyvista/__init__.py +39 -0
  31. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/__init__.py +0 -41
  32. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/_config.py +0 -38
  33. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/graphics/__init__.py +0 -6
  34. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/graphics/abstract_graphics_defns.py +0 -44
  35. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/graphics/pyvista/__init__.py +0 -0
  36. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/graphics/pyvista/graphics_defns.py +0 -116
  37. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/matplotlib/__init__.py +0 -17
  38. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/plotter/__init__.py +0 -6
  39. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/plotter/abstract_plotter_defns.py +0 -51
  40. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +0 -0
  41. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +0 -0
  42. ansys_fluent_visualization-0.16.dev0/src/ansys/fluent/visualization/pyvista/__init__.py +0 -17
  43. {ansys_fluent_visualization-0.16.dev0 → ansys_fluent_visualization-0.17.0}/AUTHORS +0 -0
@@ -1,13 +1,13 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 ANSYS, Inc. All rights reserved.
3
+ Copyright (c) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
11
 
12
12
  The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: ansys-fluent-visualization
3
- Version: 0.16.dev0
3
+ Version: 0.17.0
4
4
  Summary: A python wrapper for ansys Fluent visualization
5
- Home-page: https://github.com/ansys/pyfluent-visualization
6
5
  License: MIT
7
6
  Author: ANSYS, Inc.
8
7
  Author-email: ansys.support@ansys.com
@@ -17,12 +16,15 @@ Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
20
- Requires-Dist: ansys-fluent-core (>=0.28.dev0,<1.0)
19
+ Requires-Dist: ansys-fluent-core (>=0.29.0,<0.30.0)
20
+ Requires-Dist: imageio (>=2.36.1)
21
21
  Requires-Dist: importlib-metadata (>=4.0,<5.0) ; python_version < "3.9"
22
- Requires-Dist: matplotlib (>=3.9.0)
23
- Requires-Dist: pyside6 (>=6.7.2,<6.8.0)
24
- Requires-Dist: pyvista (>=0.44.1,<0.45.0)
22
+ Requires-Dist: matplotlib (>=3.6.0)
23
+ Requires-Dist: plotly (>=5.24.0)
24
+ Requires-Dist: pyside6 (>=6.8.1,<6.9.0)
25
+ Requires-Dist: pyvista[jupyter] (>=0.44.0)
25
26
  Requires-Dist: pyvistaqt (>=0.11.1,<0.12.0)
27
+ Requires-Dist: vtk (<9.4.0) ; python_version < "3.13"
26
28
  Project-URL: Documentation, https://visualization.fluent.docs.pyansys.com/
27
29
  Project-URL: Repository, https://github.com/ansys/pyfluent-visualization
28
30
  Project-URL: Source, https://github.com/ansys/pyfluent-visualization
@@ -82,7 +84,7 @@ the project support team, email `pyansys.core@ansys.com <pyansys.core@ansys.com>
82
84
  Installation
83
85
  ------------
84
86
  The ``ansys-fluent-visualization`` package supports Python 3.10 through Python
85
- 3.12 on Windows and Linux.
87
+ 3.13 on Windows and Linux.
86
88
 
87
89
  If you are using Python 3.10, download and install the wheel file for the ``vtk`` package from
88
90
  `here for Windows <https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-win_amd64.whl>`_
@@ -51,7 +51,7 @@ the project support team, email `pyansys.core@ansys.com <pyansys.core@ansys.com>
51
51
  Installation
52
52
  ------------
53
53
  The ``ansys-fluent-visualization`` package supports Python 3.10 through Python
54
- 3.12 on Windows and Linux.
54
+ 3.13 on Windows and Linux.
55
55
 
56
56
  If you are using Python 3.10, download and install the wheel file for the ``vtk`` package from
57
57
  `here for Windows <https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-win_amd64.whl>`_
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
5
  [tool.poetry]
6
6
  # Check https://python-poetry.org/docs/pyproject/ for all available sections
7
7
  name = "ansys-fluent-visualization"
8
- version = "0.16.dev0"
8
+ version = "0.17.0"
9
9
  description = "A python wrapper for ansys Fluent visualization"
10
10
  license = "MIT"
11
11
  authors = ["ANSYS, Inc. <ansys.support@ansys.com>"]
@@ -25,11 +25,14 @@ packages = [
25
25
  [tool.poetry.dependencies]
26
26
  python = ">=3.10,<4.0"
27
27
  importlib-metadata = {version = "^4.0", python = "<3.9"}
28
- ansys-fluent-core = "~=0.28.dev0"
29
- pyvista = "~=0.44.1"
28
+ ansys-fluent-core = "~=0.29.0"
29
+ pyvista = { version = ">=0.44.0", extras = ["jupyter"]}
30
+ matplotlib = ">=3.6.0"
31
+ vtk = {version = "<9.4.0", python = "<3.13"}
30
32
  pyvistaqt = "~=0.11.1"
31
- pyside6 = "~=6.7.2"
32
- matplotlib = ">=3.9.0"
33
+ pyside6 = "~=6.8.1"
34
+ plotly = ">=5.24.0"
35
+ imageio= ">=2.36.1"
33
36
 
34
37
  [tool.poetry.urls]
35
38
  "Documentation" = "https://visualization.fluent.docs.pyansys.com/"
@@ -0,0 +1,64 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """Python post processing integrations for the Fluent solver."""
24
+
25
+ try:
26
+ import importlib.metadata as importlib_metadata
27
+ except ModuleNotFoundError:
28
+ import importlib_metadata
29
+
30
+ _VERSION_INFO = "Build date: February 10, 2025 09:02 UTC ShaID: 3b0e9ea"
31
+ __version__ = importlib_metadata.version(__name__.replace(".", "-"))
32
+ PLOTTER = "matplotlib"
33
+ INTERACTIVE = False
34
+
35
+
36
+ def version_info() -> str:
37
+ """Method returning the version of PyFluent being used.
38
+ Returns
39
+ -------
40
+ str
41
+ The PyFluent version being used.
42
+ Notes
43
+ -------
44
+ Only available in packaged versions. Otherwise it will return __version__.
45
+ """
46
+ return _VERSION_INFO if _VERSION_INFO is not None else __version__
47
+
48
+
49
+ from ansys.fluent.visualization._config import get_config, set_config # noqa: F401
50
+ from ansys.fluent.visualization.containers import ( # noqa: F401
51
+ Contour,
52
+ Mesh,
53
+ Monitor,
54
+ Pathline,
55
+ Surface,
56
+ Vector,
57
+ XYPlot,
58
+ )
59
+ from ansys.fluent.visualization.graphics import Graphics # noqa: F401
60
+ from ansys.fluent.visualization.graphics.graphics_windows import ( # noqa: F401
61
+ GraphicsWindow,
62
+ )
63
+ from ansys.fluent.visualization.plotter import Plots # noqa: F401
64
+ from ansys.fluent.visualization.plotter.plotter_windows import PlotterWindow
@@ -0,0 +1,63 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """Global configuration state for visualization."""
24
+
25
+ _global_config = {"blocking": False, "set_view_on_display": None}
26
+
27
+
28
+ def get_config() -> dict:
29
+ """Retrieve visualization configuration.
30
+
31
+ Returns
32
+ -------
33
+ config : dict
34
+ Keys are parameter names that can be passed to :func:`set_config`.
35
+ """
36
+ import ansys.fluent.visualization as pyviz
37
+
38
+ _global_config["blocking"] = not pyviz.INTERACTIVE
39
+ return _global_config.copy()
40
+
41
+
42
+ def set_config(blocking: bool = False, set_view_on_display: str = "isometric"):
43
+ """Set visualization configuration.
44
+
45
+ Parameters
46
+ ----------
47
+ blocking : bool, default=False
48
+ If True, then graphics/plot display will block the current thread.
49
+ set_view_on_display : str, default=None
50
+ If specified, then graphics will always be displayed in the specified view.
51
+ Valid values are xy, xz, yx, yz, zx, zy and isometric.
52
+ """
53
+ if set_view_on_display not in set_config.allowed_views:
54
+ raise ValueError(
55
+ f"'{set_view_on_display}' is not an allowed view.\n"
56
+ f"Allowed views are: {set_config.allowed_views}"
57
+ )
58
+
59
+ _global_config["blocking"] = blocking
60
+ _global_config["set_view_on_display"] = set_view_on_display
61
+
62
+
63
+ set_config.allowed_views = ["xy", "xz", "yx", "yz", "zx", "zy", "isometric"]
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Containers for graphics."""
2
24
 
3
25
  from ansys.fluent.visualization.graphics import Graphics
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Contour objects based on field name and surfaces list."""
2
24
 
3
25
  from typing import List, Optional
@@ -0,0 +1,28 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """A package that provides interfacing Fluent with graphics renderer (PyVista)."""
24
+
25
+ from ansys.fluent.visualization.graphics.graphics_objects import Graphics # noqa: F401
26
+ from ansys.fluent.visualization.graphics.graphics_windows_manager import ( # noqa: F401
27
+ graphics_windows_manager,
28
+ )
@@ -0,0 +1,66 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """Abstract module providing graphics functionality."""
24
+
25
+ from abc import ABC, abstractmethod
26
+
27
+
28
+ class AbstractRenderer(ABC):
29
+ """Abstract class for renderer."""
30
+
31
+ @abstractmethod
32
+ def show(self):
33
+ """Show graphics."""
34
+ pass
35
+
36
+ @abstractmethod
37
+ def render(self, mesh, **kwargs):
38
+ """Render graphics in window."""
39
+ pass
40
+
41
+ @abstractmethod
42
+ def save_graphic(self, file_name: str):
43
+ """Save graphics to the specified file.
44
+
45
+ Parameters
46
+ ----------
47
+ file_name : str
48
+ File name to save graphic.
49
+ """
50
+ pass
51
+
52
+ @abstractmethod
53
+ def get_animation(self, win_id: str):
54
+ """Animate windows.
55
+
56
+ Parameters
57
+ ----------
58
+ win_id : str
59
+ ID for the window to animate.
60
+ """
61
+ pass
62
+
63
+ @abstractmethod
64
+ def close(self):
65
+ """Close graphics window."""
66
+ pass
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Module providing visualization objects for PyVista."""
2
24
 
3
25
  import sys
@@ -1,6 +1,30 @@
1
+ # Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """A wrapper to improve the user interface of graphics."""
2
24
 
25
+ from ansys.fluent.visualization import get_config
3
26
  from ansys.fluent.visualization.graphics import graphics_windows_manager
27
+ from ansys.fluent.visualization.plotter.plotter_windows import PlotterWindow
4
28
 
5
29
 
6
30
  class GraphicsWindow:
@@ -14,6 +38,7 @@ class GraphicsWindow:
14
38
  object,
15
39
  position: tuple = (0, 0),
16
40
  opacity: float = 1,
41
+ title: str = "",
17
42
  ) -> None:
18
43
  """Add data to a plot.
19
44
 
@@ -25,27 +50,43 @@ class GraphicsWindow:
25
50
  Position of the sub-plot.
26
51
  opacity: float, optional
27
52
  Transparency of the sub-plot.
53
+ title: str, optional
54
+ Title of the sub-plot (only for plots).
28
55
  """
29
56
  self._graphics_objs.append({**locals()})
30
57
 
58
+ def _all_plt_objs(self):
59
+ from ansys.fluent.core.post_objects.post_object_definitions import PlotDefn
60
+
61
+ for obj in self._graphics_objs:
62
+ if not isinstance(obj["object"].obj, PlotDefn):
63
+ return False
64
+ return True
65
+
31
66
  def show(self) -> None:
32
67
  """Render the objects in window and display the same."""
33
68
  self.window_id = graphics_windows_manager.open_window(grid=self._grid)
34
- self.graphics_window = graphics_windows_manager._post_windows.get(
35
- self.window_id
36
- )
37
- self._renderer = self.graphics_window.renderer
38
- self.plotter = self.graphics_window.renderer.plotter
39
- for i in range(len(self._graphics_objs)):
40
- graphics_windows_manager.add_graphics(
41
- object=self._graphics_objs[i]["object"].obj,
42
- window_id=self.window_id,
43
- fetch_data=True,
44
- overlay=True,
45
- position=self._graphics_objs[i]["position"],
46
- opacity=self._graphics_objs[i]["opacity"],
69
+ if self._all_plt_objs() and get_config()["blocking"]:
70
+ p = PlotterWindow(grid=self._grid)
71
+ for obj in self._graphics_objs:
72
+ p.add_plots(obj["object"], position=obj["position"], title=obj["title"])
73
+ p.show(self.window_id)
74
+ else:
75
+ self.graphics_window = graphics_windows_manager._post_windows.get(
76
+ self.window_id
47
77
  )
48
- graphics_windows_manager.show_graphics(self.window_id)
78
+ self._renderer = self.graphics_window.renderer
79
+ self.plotter = self.graphics_window.renderer.plotter
80
+ for i in range(len(self._graphics_objs)):
81
+ graphics_windows_manager.add_graphics(
82
+ object=self._graphics_objs[i]["object"].obj,
83
+ window_id=self.window_id,
84
+ fetch_data=True,
85
+ overlay=True,
86
+ position=self._graphics_objs[i]["position"],
87
+ opacity=self._graphics_objs[i]["opacity"],
88
+ )
89
+ graphics_windows_manager.show_graphics(self.window_id)
49
90
 
50
91
  def save_graphic(
51
92
  self,