ansys-fluent-visualization 0.17.dev0__tar.gz → 0.18.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.17.dev0 → ansys_fluent_visualization-0.18.0}/LICENSE +7 -7
  2. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/PKG-INFO +3 -8
  3. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/pyproject.toml +3 -7
  4. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/__init__.py +64 -0
  5. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/_config.py +70 -0
  6. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/containers.py +22 -0
  7. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/contour.py +22 -0
  8. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/graphics/__init__.py +28 -0
  9. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/graphics/abstract_graphics_defns.py +66 -0
  10. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/graphics/graphics_objects.py +22 -0
  11. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/graphics/graphics_windows.py +86 -2
  12. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/graphics/graphics_windows_manager.py +27 -21
  13. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/graphics/pyvista/__init__.py +21 -0
  14. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/graphics/pyvista/graphics_defns.py +29 -2
  15. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/matplotlib/__init__.py +39 -0
  16. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/plotter/__init__.py +28 -0
  17. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/plotter/abstract_plotter_defns.py +73 -0
  18. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +21 -0
  19. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/plotter/matplotlib/plotter_defns.py +22 -0
  20. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/plotter/plotly/__init__.py +21 -0
  21. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/plotter/plotly/plotter_defns.py +22 -0
  22. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/plotter/plotter_objects.py +22 -0
  23. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/plotter/plotter_windows.py +22 -0
  24. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/plotter/plotter_windows_manager.py +22 -0
  25. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +21 -0
  26. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/plotter/pyvista/plotter_defns.py +22 -0
  27. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/post_data_extractor.py +22 -0
  28. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/src/ansys/fluent/visualization/post_windows_manager.py +22 -0
  29. ansys_fluent_visualization-0.18.0/src/ansys/fluent/visualization/pyvista/__init__.py +39 -0
  30. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/__init__.py +0 -42
  31. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/_config.py +0 -41
  32. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/graphics/__init__.py +0 -6
  33. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/graphics/abstract_graphics_defns.py +0 -44
  34. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/graphics/pyvista/__init__.py +0 -0
  35. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/matplotlib/__init__.py +0 -17
  36. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/plotter/__init__.py +0 -6
  37. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/plotter/abstract_plotter_defns.py +0 -51
  38. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +0 -0
  39. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/plotter/plotly/__init__.py +0 -0
  40. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +0 -0
  41. ansys_fluent_visualization-0.17.dev0/src/ansys/fluent/visualization/pyvista/__init__.py +0 -17
  42. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/AUTHORS +0 -0
  43. {ansys_fluent_visualization-0.17.dev0 → ansys_fluent_visualization-0.18.0}/README.rst +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
1
  Metadata-Version: 2.3
2
2
  Name: ansys-fluent-visualization
3
- Version: 0.17.dev0
3
+ Version: 0.18.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,15 +16,11 @@ 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.29.dev0,<1.0)
21
- Requires-Dist: imageio (>=2.36.1)
22
- Requires-Dist: importlib-metadata (>=4.0,<5.0) ; python_version < "3.9"
19
+ Requires-Dist: ansys-fluent-core (==0.29.0)
23
20
  Requires-Dist: matplotlib (>=3.6.0)
24
- Requires-Dist: plotly (>=5.24.0)
25
21
  Requires-Dist: pyside6 (>=6.8.1,<6.9.0)
26
- Requires-Dist: pyvista[jupyter] (>=0.44.0)
22
+ Requires-Dist: pyvista (>=0.44.0)
27
23
  Requires-Dist: pyvistaqt (>=0.11.1,<0.12.0)
28
- Requires-Dist: vtk (<9.4.0) ; python_version < "3.13"
29
24
  Project-URL: Documentation, https://visualization.fluent.docs.pyansys.com/
30
25
  Project-URL: Repository, https://github.com/ansys/pyfluent-visualization
31
26
  Project-URL: Source, https://github.com/ansys/pyfluent-visualization
@@ -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.17.dev0"
8
+ version = "0.18.0"
9
9
  description = "A python wrapper for ansys Fluent visualization"
10
10
  license = "MIT"
11
11
  authors = ["ANSYS, Inc. <ansys.support@ansys.com>"]
@@ -24,15 +24,11 @@ packages = [
24
24
 
25
25
  [tool.poetry.dependencies]
26
26
  python = ">=3.10,<4.0"
27
- importlib-metadata = {version = "^4.0", python = "<3.9"}
28
- ansys-fluent-core = "~=0.29.dev0"
29
- pyvista = { version = ">=0.44.0", extras = ["jupyter"]}
27
+ ansys-fluent-core = "==0.29.0"
28
+ pyvista = ">=0.44.0"
30
29
  matplotlib = ">=3.6.0"
31
- vtk = {version = "<9.4.0", python = "<3.13"}
32
30
  pyvistaqt = "~=0.11.1"
33
31
  pyside6 = "~=6.8.1"
34
- plotly = ">=5.24.0"
35
- imageio= ">=2.36.1"
36
32
 
37
33
  [tool.poetry.urls]
38
34
  "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 20, 2025 13:32 UTC ShaID: d8bef97"
31
+ __version__ = importlib_metadata.version(__name__.replace(".", "-"))
32
+ PLOTTER = "matplotlib"
33
+ SINGLE_WINDOW = 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,70 @@
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
+ import warnings
25
+
26
+ _global_config = {"blocking": False, "set_view_on_display": None}
27
+
28
+
29
+ def get_config() -> dict:
30
+ """Retrieve visualization configuration.
31
+
32
+ Returns
33
+ -------
34
+ config : dict
35
+ Keys are parameter names that can be passed to :func:`set_config`.
36
+ """
37
+ import ansys.fluent.visualization as pyviz
38
+
39
+ if pyviz.SINGLE_WINDOW:
40
+ _global_config["blocking"] = False
41
+ return _global_config.copy()
42
+
43
+
44
+ def set_config(blocking: bool = False, set_view_on_display: str = "isometric"):
45
+ """Set visualization configuration.
46
+
47
+ Parameters
48
+ ----------
49
+ blocking : bool, default=False
50
+ If True, then graphics/plot display will block the current thread.
51
+ set_view_on_display : str, default=None
52
+ If specified, then graphics will always be displayed in the specified view.
53
+ Valid values are xy, xz, yx, yz, zx, zy and isometric.
54
+ """
55
+ import ansys.fluent.visualization as pyviz
56
+
57
+ if set_view_on_display not in set_config.allowed_views:
58
+ raise ValueError(
59
+ f"'{set_view_on_display}' is not an allowed view.\n"
60
+ f"Allowed views are: {set_config.allowed_views}"
61
+ )
62
+
63
+ if pyviz.SINGLE_WINDOW:
64
+ warnings.warn("'blocking' cannot be set from PyConsole.")
65
+ else:
66
+ _global_config["blocking"] = blocking
67
+ _global_config["set_view_on_display"] = set_view_on_display
68
+
69
+
70
+ 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,9 +1,41 @@
1
- """A wrapper to improve the user interface of graphics."""
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.
2
22
 
23
+ """A wrapper to improve the user interface of graphics."""
24
+ from PySide6.QtWidgets import (
25
+ QApplication,
26
+ QMainWindow,
27
+ QTabWidget,
28
+ QVBoxLayout,
29
+ QWidget,
30
+ )
31
+
32
+ import ansys.fluent.visualization as pyviz
3
33
  from ansys.fluent.visualization import get_config
4
34
  from ansys.fluent.visualization.graphics import graphics_windows_manager
5
35
  from ansys.fluent.visualization.plotter.plotter_windows import PlotterWindow
6
36
 
37
+ _qt_window = None
38
+
7
39
 
8
40
  class GraphicsWindow:
9
41
  def __init__(self, grid: tuple = (1, 1)):
@@ -64,7 +96,20 @@ class GraphicsWindow:
64
96
  position=self._graphics_objs[i]["position"],
65
97
  opacity=self._graphics_objs[i]["opacity"],
66
98
  )
67
- graphics_windows_manager.show_graphics(self.window_id)
99
+ if pyviz.SINGLE_WINDOW:
100
+ global _qt_window
101
+ if not _qt_window:
102
+ QApplication.instance() or QApplication()
103
+ _qt_window = MainWindow()
104
+ _qt_window.show()
105
+ _qt_window._add_tab(
106
+ self.plotter,
107
+ title=self.window_id.replace(
108
+ self.window_id[-1], str(int(self.window_id[-1]) + 1)
109
+ ),
110
+ )
111
+ else:
112
+ graphics_windows_manager.show_graphics(self.window_id)
68
113
 
69
114
  def save_graphic(
70
115
  self,
@@ -146,3 +191,42 @@ class GraphicsWindow:
146
191
  graphics_windows_manager.close_windows(
147
192
  windows_id=[self.window_id], session_id=session_id
148
193
  )
194
+
195
+
196
+ # Define the main window
197
+ class MainWindow(QMainWindow):
198
+ def __init__(self):
199
+ super().__init__()
200
+ self.setWindowTitle("PyFluent Visualization Plots")
201
+ screen = QApplication.primaryScreen().availableGeometry()
202
+ width = int(screen.width() * 0.75)
203
+ height = int(screen.height() * 0.75)
204
+ self.setGeometry(
205
+ (screen.width() - width) // 2, # Center X
206
+ (screen.height() - height) // 2, # Center Y
207
+ width,
208
+ height,
209
+ )
210
+ self.tabs = QTabWidget()
211
+ self.setCentralWidget(self.tabs)
212
+ self.tabs.setMovable(True)
213
+ self.plotters = []
214
+
215
+ def _add_tab(self, plotter, title="-"):
216
+ tab = QWidget()
217
+ layout = QVBoxLayout()
218
+
219
+ self.plotters.append(plotter)
220
+ layout.addWidget(plotter.interactor)
221
+ tab.setLayout(layout)
222
+
223
+ # Add tabs with PyVista BackgroundPlotters
224
+ self.tabs.addTab(tab, f"PyViz ({title})")
225
+
226
+ def closeEvent(self, event):
227
+ """Ensure proper cleanup of plotter instances on window close."""
228
+ for plotter in self.plotters:
229
+ plotter.close() # Properly close each PyVista plotter
230
+ event.accept()
231
+ global _qt_window
232
+ _qt_window = None
@@ -1,8 +1,29 @@
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 for graphics windows management."""
2
24
 
3
25
  from enum import Enum
4
26
  import itertools
5
- import os
6
27
  import threading
7
28
  from typing import Dict, List, Optional, Union
8
29
 
@@ -21,6 +42,7 @@ try:
21
42
  except ModuleNotFoundError:
22
43
  BackgroundPlotter = None
23
44
 
45
+ import ansys.fluent.visualization as pyviz
24
46
  from ansys.fluent.visualization import get_config
25
47
  from ansys.fluent.visualization.post_data_extractor import (
26
48
  FieldDataExtractor,
@@ -554,11 +576,7 @@ class GraphicsWindowsManager(PostWindowsManager, metaclass=AbstractSingletonMeta
554
576
  with self._condition:
555
577
  if not window_id:
556
578
  window_id = self._get_unique_window_id()
557
- if (
558
- in_notebook()
559
- or get_config()["blocking"]
560
- or os.getenv("FLUENT_PROD_DIR")
561
- ):
579
+ if in_notebook() or get_config()["blocking"] or pyviz.SINGLE_WINDOW:
562
580
  self._open_window_notebook(window_id, grid)
563
581
  else:
564
582
  self._open_and_plot_console(None, window_id, grid=grid)
@@ -617,11 +635,7 @@ class GraphicsWindowsManager(PostWindowsManager, metaclass=AbstractSingletonMeta
617
635
  with self._condition:
618
636
  if not window_id:
619
637
  window_id = self._get_unique_window_id()
620
- if (
621
- in_notebook()
622
- or get_config()["blocking"]
623
- or os.getenv("FLUENT_PROD_DIR")
624
- ):
638
+ if in_notebook() or get_config()["blocking"] or pyviz.SINGLE_WINDOW:
625
639
  self._plot_notebook(object, window_id, fetch_data, overlay)
626
640
  else:
627
641
  self._open_and_plot_console(object, window_id, fetch_data, overlay)
@@ -660,11 +674,7 @@ class GraphicsWindowsManager(PostWindowsManager, metaclass=AbstractSingletonMeta
660
674
  if not isinstance(object, (GraphicsDefn, PlotDefn)):
661
675
  raise RuntimeError("Object type currently not supported.")
662
676
  with self._condition:
663
- if (
664
- in_notebook()
665
- or get_config()["blocking"]
666
- or os.getenv("FLUENT_PROD_DIR")
667
- ):
677
+ if in_notebook() or get_config()["blocking"] or pyviz.SINGLE_WINDOW:
668
678
  self._add_graphics_in_notebook(
669
679
  object, window_id, fetch_data, overlay, position, opacity
670
680
  )
@@ -676,11 +686,7 @@ class GraphicsWindowsManager(PostWindowsManager, metaclass=AbstractSingletonMeta
676
686
  def show_graphics(self, window_id: str):
677
687
  """Display the graphics window."""
678
688
  with self._condition:
679
- if (
680
- in_notebook()
681
- or get_config()["blocking"]
682
- or os.getenv("FLUENT_PROD_DIR")
683
- ):
689
+ if in_notebook() or get_config()["blocking"] or pyviz.SINGLE_WINDOW:
684
690
  self._show_graphics_in_notebook(window_id)
685
691
 
686
692
  def save_graphic(
@@ -0,0 +1,21 @@
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.
@@ -1,8 +1,31 @@
1
- """Module for pyVista windows management."""
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.
2
22
 
23
+ """Module for pyVista windows management."""
3
24
  import numpy as np
4
25
  import pyvista as pv
5
26
 
27
+ import ansys.fluent.visualization as pyviz
28
+
6
29
  try:
7
30
  from pyvistaqt import BackgroundPlotter
8
31
  except ModuleNotFoundError:
@@ -22,7 +45,11 @@ class Renderer(AbstractRenderer):
22
45
  self.plotter: BackgroundPlotter | pv.Plotter = (
23
46
  pv.Plotter(title=f"PyFluent ({win_id})", shape=grid)
24
47
  if in_notebook or non_interactive
25
- else BackgroundPlotter(title=f"PyFluent ({win_id})", shape=grid)
48
+ else BackgroundPlotter(
49
+ title=f"PyFluent ({win_id})",
50
+ shape=grid,
51
+ show=False if pyviz.SINGLE_WINDOW else True,
52
+ )
26
53
  )
27
54
  self._init_properties()
28
55
  self._colors = {