ansys-fluent-visualization 0.20.dev0__tar.gz → 0.20.dev1__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 (32) hide show
  1. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/PKG-INFO +2 -2
  2. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/pyproject.toml +2 -2
  3. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/__init__.py +5 -3
  4. ansys_fluent_visualization-0.20.dev1/src/ansys/fluent/visualization/containers.py +221 -0
  5. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/graphics_windows.py +27 -3
  6. ansys_fluent_visualization-0.20.dev0/src/ansys/fluent/visualization/containers.py +0 -89
  7. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/AUTHORS +0 -0
  8. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/LICENSE +0 -0
  9. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/README.rst +0 -0
  10. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/_config.py +0 -0
  11. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/contour.py +0 -0
  12. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/__init__.py +0 -0
  13. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/abstract_graphics_defns.py +0 -0
  14. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/graphics_objects.py +0 -0
  15. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/graphics_windows_manager.py +0 -0
  16. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/pyvista/__init__.py +0 -0
  17. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/graphics/pyvista/graphics_defns.py +0 -0
  18. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/matplotlib/__init__.py +0 -0
  19. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/__init__.py +0 -0
  20. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/abstract_plotter_defns.py +0 -0
  21. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +0 -0
  22. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/matplotlib/plotter_defns.py +0 -0
  23. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/plotly/__init__.py +0 -0
  24. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/plotly/plotter_defns.py +0 -0
  25. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/plotter_objects.py +0 -0
  26. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/plotter_windows.py +0 -0
  27. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/plotter_windows_manager.py +0 -0
  28. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +0 -0
  29. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/plotter/pyvista/plotter_defns.py +0 -0
  30. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/post_data_extractor.py +0 -0
  31. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/post_windows_manager.py +0 -0
  32. {ansys_fluent_visualization-0.20.dev0 → ansys_fluent_visualization-0.20.dev1}/src/ansys/fluent/visualization/pyvista/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ansys-fluent-visualization
3
- Version: 0.20.dev0
3
+ Version: 0.20.dev1
4
4
  Summary: A python wrapper for ansys Fluent visualization
5
5
  License: MIT
6
6
  Author: ANSYS, Inc.
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
- Requires-Dist: ansys-fluent-core (==0.31.dev0)
19
+ Requires-Dist: ansys-fluent-core (>=0.31.dev0)
20
20
  Requires-Dist: imageio (>=2.36.1)
21
21
  Requires-Dist: importlib-metadata (>=4.0,<5.0) ; python_version < "3.9"
22
22
  Requires-Dist: matplotlib (>=3.6.0)
@@ -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.20.dev0"
8
+ version = "0.20.dev1"
9
9
  description = "A python wrapper for ansys Fluent visualization"
10
10
  license = "MIT"
11
11
  authors = ["ANSYS, Inc. <ansys.support@ansys.com>"]
@@ -25,7 +25,7 @@ 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.31.dev0"
28
+ ansys-fluent-core = ">=0.31.dev0"
29
29
  pyvista = ">=0.44.0"
30
30
  matplotlib = ">=3.6.0"
31
31
  pyvistaqt = "~=0.11.1"
@@ -27,7 +27,7 @@ try:
27
27
  except ModuleNotFoundError:
28
28
  import importlib_metadata
29
29
 
30
- _VERSION_INFO = "Build date: March 11, 2025 19:30 UTC ShaID: 89c5220"
30
+ _VERSION_INFO = "Build date: March 21, 2025 07:32 UTC ShaID: 8cc6c7a"
31
31
  __version__ = importlib_metadata.version(__name__.replace(".", "-"))
32
32
  PLOTTER = "matplotlib"
33
33
  SINGLE_WINDOW = False
@@ -35,13 +35,15 @@ SINGLE_WINDOW = False
35
35
 
36
36
  def version_info() -> str:
37
37
  """Method returning the version of PyFluent being used.
38
+
38
39
  Returns
39
40
  -------
40
41
  str
41
42
  The PyFluent version being used.
43
+
42
44
  Notes
43
- -------
44
- Only available in packaged versions. Otherwise it will return __version__.
45
+ -----
46
+ Only available in packaged versions. Otherwise it will return __version__.
45
47
  """
46
48
  return _VERSION_INFO if _VERSION_INFO is not None else __version__
47
49
 
@@ -0,0 +1,221 @@
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
+ """Containers for graphics."""
24
+
25
+ from ansys.fluent.visualization.graphics import Graphics
26
+ from ansys.fluent.visualization.plotter import Plots
27
+
28
+
29
+ class _GraphicsContainer:
30
+ """Base class for graphics containers."""
31
+
32
+ def __getattr__(self, attr):
33
+ return getattr(self.obj, attr)
34
+
35
+ def __setattr__(self, attr, value):
36
+ setattr(self.obj, attr, value)
37
+
38
+
39
+ class Mesh(_GraphicsContainer):
40
+ """Mesh.
41
+
42
+ Examples
43
+ --------
44
+ >>> from ansys.fluent.visualization import Mesh
45
+
46
+ >>> mesh_object = Mesh(
47
+ >>> solver=solver_session, show_edges=True, surfaces=["in1", "in2", "in3"]
48
+ >>> )
49
+ """
50
+
51
+ def __init__(self, solver, **kwargs):
52
+ """__init__ method of Mesh class."""
53
+ self.__dict__["obj"] = Graphics(session=solver).Meshes.create(**kwargs)
54
+
55
+
56
+ class Surface(_GraphicsContainer):
57
+ """Surface.
58
+
59
+ Examples
60
+ --------
61
+ >>> from ansys.fluent.visualization import Surface
62
+
63
+ >>> # For plane-surface
64
+ >>> surf_xy_plane = Surface(
65
+ >>> solver=solver_session,
66
+ >>> type="plane-surface",
67
+ >>> creation_method="xy-plane",
68
+ >>> z=-0.0441921
69
+ >>> )
70
+
71
+ >>> # For iso-surface
72
+ >>> surf_outlet_plane = Surface(solver=solver_session)
73
+ >>> surf_outlet_plane.type = "iso-surface"
74
+ >>> surf_outlet_plane.field = "y-coordinate"
75
+ >>> surf_outlet_plane.iso_value = -0.125017
76
+ """
77
+
78
+ def __init__(self, solver, **kwargs):
79
+ """__init__ method of Surface class."""
80
+ self.__dict__.update(
81
+ dict(
82
+ type=kwargs.pop("type", None),
83
+ creation_method=kwargs.pop("creation_method", None),
84
+ x=kwargs.pop("x", None),
85
+ y=kwargs.pop("y", None),
86
+ z=kwargs.pop("z", None),
87
+ field=kwargs.pop("field", None),
88
+ iso_value=kwargs.pop("iso_value", None),
89
+ rendering=kwargs.pop("rendering", None),
90
+ obj=Graphics(session=solver).Surfaces.create(**kwargs),
91
+ )
92
+ )
93
+ for attr in [
94
+ "type",
95
+ "creation_method",
96
+ "x",
97
+ "y",
98
+ "z",
99
+ "field",
100
+ "iso_value",
101
+ "rendering",
102
+ ]:
103
+ val = getattr(self, attr)
104
+ if val is not None:
105
+ setattr(self, attr, val)
106
+
107
+ def __setattr__(self, attr, value):
108
+ if attr == "type":
109
+ self.obj.definition.type = value
110
+ elif attr == "creation_method":
111
+ self.obj.definition.plane_surface.creation_method = value
112
+ elif attr == "z":
113
+ assert self.obj.definition.plane_surface.creation_method() == "xy-plane"
114
+ self.obj.definition.plane_surface.xy_plane.z = value
115
+ elif attr == "y":
116
+ assert self.obj.definition.plane_surface.creation_method() == "zx-plane"
117
+ self.obj.definition.plane_surface.zx_plane.y = value
118
+ elif attr == "x":
119
+ assert self.obj.definition.plane_surface.creation_method() == "yz-plane"
120
+ self.obj.definition.plane_surface.yz_plane.x = value
121
+ elif attr == "field":
122
+ self.obj.definition.iso_surface.field = value
123
+ elif attr == "iso_value":
124
+ self.obj.definition.iso_surface.iso_value = value
125
+ elif attr == "rendering":
126
+ self.obj.definition.iso_surface.rendering = value
127
+ else:
128
+ setattr(self.obj, attr, value)
129
+
130
+
131
+ class Contour(_GraphicsContainer):
132
+ """Contour.
133
+
134
+ Examples
135
+ --------
136
+ >>> from ansys.fluent.visualization import Contour
137
+
138
+ >>> temperature_contour_object = Contour(
139
+ >>> solver=solver_session, field="temperature", surfaces=["in1", "in2", "in3",]
140
+ >>> )
141
+ """
142
+
143
+ def __init__(self, solver, **kwargs):
144
+ """__init__ method of Contour class."""
145
+ self.__dict__["obj"] = Graphics(session=solver).Contours.create(**kwargs)
146
+
147
+
148
+ class Vector(_GraphicsContainer):
149
+ """Vector.
150
+
151
+ Examples
152
+ --------
153
+ >>> from ansys.fluent.visualization import Vector
154
+
155
+ >>> velocity_vector_object = Vector(
156
+ >>> solver=solver_session,
157
+ >>> field="pressure",
158
+ >>> surfaces=["solid_up:1:830"],
159
+ >>> scale=2,
160
+ >>> )
161
+ """
162
+
163
+ def __init__(self, solver, **kwargs):
164
+ """__init__ method of Vector class."""
165
+ self.__dict__["obj"] = Graphics(session=solver).Vectors.create(**kwargs)
166
+
167
+
168
+ class Pathline(_GraphicsContainer):
169
+ """Pathline.
170
+
171
+ Examples
172
+ --------
173
+ >>> from ansys.fluent.visualization import Pathline
174
+
175
+ >>> pathlines = Pathline(solver=solver_session)
176
+ >>> pathlines.field = "velocity-magnitude"
177
+ >>> pathlines.surfaces = ["inlet", "inlet1", "inlet2"]
178
+ """
179
+
180
+ def __init__(self, solver, **kwargs):
181
+ """__init__ method of Pathline class."""
182
+ self.__dict__["obj"] = Graphics(session=solver).Pathlines.create(**kwargs)
183
+
184
+
185
+ class XYPlot(_GraphicsContainer):
186
+ """XYPlot.
187
+
188
+ Examples
189
+ --------
190
+ >>> from ansys.fluent.visualization import XYPlot
191
+
192
+ >>> xy_plot = XYPlot(
193
+ >>> solver=solver_session,
194
+ >>> surfaces=["outlet"],
195
+ >>> y_axis_function="temperature",
196
+ >>> )
197
+ """
198
+
199
+ def __init__(self, solver, local_surfaces_provider=None, **kwargs):
200
+ """__init__ method of XYPlot class."""
201
+ self.__dict__["obj"] = Plots(
202
+ session=solver, local_surfaces_provider=Graphics(solver).Surfaces
203
+ ).XYPlots.create(**kwargs)
204
+
205
+
206
+ class Monitor(_GraphicsContainer):
207
+ """Monitor.
208
+
209
+ Examples
210
+ --------
211
+ >>> from ansys.fluent.visualization import Monitor
212
+
213
+ >>> residual = Monitor(solver=solver_session)
214
+ >>> residual.monitor_set_name = "residual"
215
+ """
216
+
217
+ def __init__(self, solver, local_surfaces_provider=None, **kwargs):
218
+ """__init__ method of Monitor class."""
219
+ self.__dict__["obj"] = Plots(
220
+ session=solver, local_surfaces_provider=Graphics(solver).Surfaces
221
+ ).Monitors.create(**kwargs)
@@ -38,7 +38,31 @@ _qt_window = None
38
38
 
39
39
 
40
40
  class GraphicsWindow:
41
+ """Create a graphics window to perform operations like display,
42
+ save, animate, etc. on graphics objects.
43
+
44
+ Examples
45
+ --------
46
+ You can add graphics objects like mesh, surface or plots and then display it.
47
+
48
+ >>> from ansys.fluent.visualization import GraphicsWindow
49
+
50
+ >>> graphics_window = GraphicsWindow()
51
+ >>> graphics_window.add_graphics(mesh_object)
52
+ >>> graphics_window.show()
53
+
54
+ You can add multiple graphics objects and display as a structured layout.
55
+
56
+ >>> graphics_window = GraphicsWindow(grid=(2, 2))
57
+ >>> graphics_window.add_graphics(mesh_object, position=(0, 0))
58
+ >>> graphics_window.add_graphics(temperature_contour_object, position=(0, 1))
59
+ >>> graphics_window.add_graphics(velocity_vector_object, position=(1, 0))
60
+ >>> graphics_window.add_graphics(xy_plot, position=(1, 1))
61
+ >>> graphics_window.show()
62
+ """
63
+
41
64
  def __init__(self, grid: tuple = (1, 1)):
65
+ """__init__ method of GraphicsWindow class."""
42
66
  self._grid = grid
43
67
  self._graphics_objs = []
44
68
  self.window_id = None
@@ -155,7 +179,7 @@ class GraphicsWindow:
155
179
  if self.window_id:
156
180
  self._renderer.save_graphic(filename)
157
181
 
158
- def refresh_windows(
182
+ def refresh(
159
183
  self,
160
184
  session_id: str | None = "",
161
185
  overlay: bool | None = False,
@@ -176,7 +200,7 @@ class GraphicsWindow:
176
200
  windows_id=[self.window_id], session_id=session_id, overlay=overlay
177
201
  )
178
202
 
179
- def animate_windows(
203
+ def animate(
180
204
  self,
181
205
  session_id: str | None = "",
182
206
  ) -> None:
@@ -199,7 +223,7 @@ class GraphicsWindow:
199
223
  windows_id=[self.window_id], session_id=session_id
200
224
  )
201
225
 
202
- def close_windows(
226
+ def close(
203
227
  self,
204
228
  session_id: str | None = "",
205
229
  ) -> None:
@@ -1,89 +0,0 @@
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
- """Containers for graphics."""
24
-
25
- from ansys.fluent.visualization.graphics import Graphics
26
- from ansys.fluent.visualization.plotter import Plots
27
-
28
-
29
- class GraphicsContainer:
30
- """Base class for graphics containers."""
31
-
32
- def __getattr__(self, attr):
33
- return getattr(self.obj, attr)
34
-
35
- def __setattr__(self, attr, value):
36
- setattr(self.obj, attr, value)
37
-
38
-
39
- class Mesh(GraphicsContainer):
40
- """Mesh."""
41
-
42
- def __init__(self, solver, **kwargs):
43
- self.__dict__["obj"] = Graphics(session=solver).Meshes.create(**kwargs)
44
-
45
-
46
- class Surface(GraphicsContainer):
47
- """Surface."""
48
-
49
- def __init__(self, solver, **kwargs):
50
- self.__dict__["obj"] = Graphics(session=solver).Surfaces.create(**kwargs)
51
-
52
-
53
- class Contour(GraphicsContainer):
54
- """Contour."""
55
-
56
- def __init__(self, solver, **kwargs):
57
- self.__dict__["obj"] = Graphics(session=solver).Contours.create(**kwargs)
58
-
59
-
60
- class Vector(GraphicsContainer):
61
- """Vector."""
62
-
63
- def __init__(self, solver, **kwargs):
64
- self.__dict__["obj"] = Graphics(session=solver).Vectors.create(**kwargs)
65
-
66
-
67
- class Pathline(GraphicsContainer):
68
- """Pathline."""
69
-
70
- def __init__(self, solver, **kwargs):
71
- self.__dict__["obj"] = Graphics(session=solver).Pathlines.create(**kwargs)
72
-
73
-
74
- class XYPlot(GraphicsContainer):
75
- """XYPlot."""
76
-
77
- def __init__(self, solver, local_surfaces_provider=None, **kwargs):
78
- self.__dict__["obj"] = Plots(
79
- session=solver, local_surfaces_provider=Graphics(solver).Surfaces
80
- ).XYPlots.create(**kwargs)
81
-
82
-
83
- class Monitor(GraphicsContainer):
84
- """Monitor."""
85
-
86
- def __init__(self, solver, local_surfaces_provider=None, **kwargs):
87
- self.__dict__["obj"] = Plots(
88
- session=solver, local_surfaces_provider=Graphics(solver).Surfaces
89
- ).Monitors.create(**kwargs)