ansys-fluent-visualization 0.24.dev0__tar.gz → 0.26.dev0__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.
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/LICENSE +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/PKG-INFO +2 -2
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/pyproject.toml +2 -2
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/check_in_notebook.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/meta.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/post_helper.py +9 -3
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/post_object_definitions.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/post_objects_container.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/interface/post_objects/singleton_meta.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/__init__.py +2 -2
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/base/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/base/renderer.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/config.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/containers.py +27 -9
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/contour.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/graphics_objects.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/graphics_windows.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/graphics_windows_manager.py +97 -19
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/pyvista/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/pyvista/renderer.py +8 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/graphics/single_qt_windows.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/matplotlib/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/plotter/__init__.py +1 -1
- ansys_fluent_visualization-0.26.dev0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +21 -0
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/plotter/matplotlib/renderer.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/plotter/plotter_objects.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/plotter/plotter_windows.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/plotter/plotter_windows_manager.py +6 -15
- ansys_fluent_visualization-0.26.dev0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +21 -0
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/plotter/pyvista/renderer.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/post_data_extractor.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/pyvista/__init__.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/registrar.py +1 -1
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/renderer.py +9 -4
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/src/ansys/fluent/visualization/visualization_windows_manager.py +1 -1
- ansys_fluent_visualization-0.24.dev0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py +0 -21
- ansys_fluent_visualization-0.24.dev0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py +0 -21
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/AUTHORS +0 -0
- {ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/README.rst +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2022 -
|
|
3
|
+
Copyright (c) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ansys-fluent-visualization
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.26.dev0
|
|
4
4
|
Summary: A python wrapper for ansys Fluent visualization
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: AUTHORS
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
21
|
Provides-Extra: interactive
|
|
22
22
|
Provides-Extra: single-window
|
|
23
|
-
Requires-Dist: ansys-fluent-core (>=0.
|
|
23
|
+
Requires-Dist: ansys-fluent-core (>=0.39.dev0,<1.0)
|
|
24
24
|
Requires-Dist: importlib-metadata (>=4.0,<5.0) ; python_version < "3.9"
|
|
25
25
|
Requires-Dist: matplotlib (>=3.6.0)
|
|
26
26
|
Requires-Dist: pyside6 (>=6.8.1,<6.9.0) ; extra == "single-window"
|
{ansys_fluent_visualization-0.24.dev0 → ansys_fluent_visualization-0.26.dev0}/pyproject.toml
RENAMED
|
@@ -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.
|
|
8
|
+
version = "0.26.dev0"
|
|
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,<3.14"
|
|
27
27
|
importlib-metadata = {version = "^4.0", python = "<3.9"}
|
|
28
|
-
ansys-fluent-core = "~=0.
|
|
28
|
+
ansys-fluent-core = "~=0.39.dev0"
|
|
29
29
|
pyvista = ">=0.44.0"
|
|
30
30
|
matplotlib = ">=3.6.0"
|
|
31
31
|
pyvistaqt = { version = "~=0.11.1", optional = true }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -138,9 +138,15 @@ class PostAPIHelper:
|
|
|
138
138
|
def delete_surface_on_server(self):
|
|
139
139
|
"""Deletes the surface on server."""
|
|
140
140
|
if self.obj.definition.type() == "iso-surface":
|
|
141
|
-
|
|
141
|
+
iso_surface = self._get_api_handle().iso_surface
|
|
142
|
+
name = self._surface_name_on_server
|
|
143
|
+
if name in iso_surface():
|
|
144
|
+
del iso_surface[name]
|
|
142
145
|
elif self.obj.definition.type() == "plane-surface":
|
|
143
|
-
|
|
146
|
+
plane_surface = self._get_api_handle().plane_surface
|
|
147
|
+
name = self._surface_name_on_server
|
|
148
|
+
if name in plane_surface():
|
|
149
|
+
del plane_surface[name]
|
|
144
150
|
|
|
145
151
|
def __init__(self, obj):
|
|
146
152
|
"""__init__ method of PostAPIHelper class."""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -27,7 +27,7 @@ try:
|
|
|
27
27
|
except ModuleNotFoundError:
|
|
28
28
|
import importlib_metadata
|
|
29
29
|
|
|
30
|
-
_VERSION_INFO = "Build date:
|
|
30
|
+
_VERSION_INFO = "Build date: March 06, 2026 16:34 UTC ShaID: 31001c1"
|
|
31
31
|
__version__ = importlib_metadata.version(__name__.replace(".", "-"))
|
|
32
32
|
|
|
33
33
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -29,9 +29,13 @@ from ansys.units import VariableDescriptor
|
|
|
29
29
|
|
|
30
30
|
from ansys.fluent.visualization.graphics import Graphics
|
|
31
31
|
from ansys.fluent.visualization.plotter import Plots
|
|
32
|
+
from ansys.fluent.visualization.post_data_extractor import (
|
|
33
|
+
FieldDataExtractor,
|
|
34
|
+
XYPlotDataExtractor,
|
|
35
|
+
)
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
class
|
|
38
|
+
class GraphicsObject:
|
|
35
39
|
"""Base class for graphics containers."""
|
|
36
40
|
|
|
37
41
|
def __init__(self, solver, **kwargs):
|
|
@@ -44,6 +48,10 @@ class _GraphicsContainer:
|
|
|
44
48
|
if "vectors_of" in self.kwargs:
|
|
45
49
|
self.kwargs["vectors_of"] = _to_field_name_str(self.kwargs["vectors_of"])
|
|
46
50
|
|
|
51
|
+
def get_field_data(self):
|
|
52
|
+
"""Exposes field data."""
|
|
53
|
+
return FieldDataExtractor(self._obj).fetch_data()
|
|
54
|
+
|
|
47
55
|
def __getattr__(self, attr):
|
|
48
56
|
return getattr(self._obj, attr)
|
|
49
57
|
|
|
@@ -56,7 +64,7 @@ class _GraphicsContainer:
|
|
|
56
64
|
return sorted(set(super().__dir__()) | set(dir(self._obj)))
|
|
57
65
|
|
|
58
66
|
|
|
59
|
-
class Mesh(
|
|
67
|
+
class Mesh(GraphicsObject):
|
|
60
68
|
"""Mesh visualization object.
|
|
61
69
|
|
|
62
70
|
Creates a Fluent mesh graphic object on the specified surfaces.
|
|
@@ -103,7 +111,7 @@ class Mesh(_GraphicsContainer):
|
|
|
103
111
|
)
|
|
104
112
|
|
|
105
113
|
|
|
106
|
-
class Surface(
|
|
114
|
+
class Surface(GraphicsObject):
|
|
107
115
|
"""Surface definition for Fluent post-processing.
|
|
108
116
|
|
|
109
117
|
The ``Surface`` class represents any Fluent surface generated for
|
|
@@ -363,7 +371,7 @@ class IsoSurface(Surface):
|
|
|
363
371
|
)
|
|
364
372
|
|
|
365
373
|
|
|
366
|
-
class Contour(
|
|
374
|
+
class Contour(GraphicsObject):
|
|
367
375
|
"""
|
|
368
376
|
Contour visualization object.
|
|
369
377
|
|
|
@@ -418,7 +426,7 @@ class Contour(_GraphicsContainer):
|
|
|
418
426
|
)
|
|
419
427
|
|
|
420
428
|
|
|
421
|
-
class Vector(
|
|
429
|
+
class Vector(GraphicsObject):
|
|
422
430
|
"""Vector visualization object.
|
|
423
431
|
|
|
424
432
|
Parameters
|
|
@@ -505,7 +513,7 @@ class Vector(_GraphicsContainer):
|
|
|
505
513
|
setattr(self._obj, attr, value)
|
|
506
514
|
|
|
507
515
|
|
|
508
|
-
class Pathline(
|
|
516
|
+
class Pathline(GraphicsObject):
|
|
509
517
|
"""Pathline visualization object.
|
|
510
518
|
|
|
511
519
|
The ``Pathline`` class generates pathlines, which represent the trajectories
|
|
@@ -561,7 +569,7 @@ class Pathline(_GraphicsContainer):
|
|
|
561
569
|
)
|
|
562
570
|
|
|
563
571
|
|
|
564
|
-
class XYPlot(
|
|
572
|
+
class XYPlot(GraphicsObject):
|
|
565
573
|
"""XY plot visualization object.
|
|
566
574
|
|
|
567
575
|
The ``XYPlot`` class creates a Fluent XY plot of a scalar field evaluated
|
|
@@ -620,8 +628,12 @@ class XYPlot(_GraphicsContainer):
|
|
|
620
628
|
session=self.solver, local_surfaces_provider=Graphics(solver).Surfaces
|
|
621
629
|
).XYPlots.create(**self.kwargs)
|
|
622
630
|
|
|
631
|
+
def get_field_data(self):
|
|
632
|
+
"""Exposes 2d plot data data."""
|
|
633
|
+
return XYPlotDataExtractor(self._obj).fetch_data()
|
|
634
|
+
|
|
623
635
|
|
|
624
|
-
class Monitor(
|
|
636
|
+
class Monitor(GraphicsObject):
|
|
625
637
|
"""Monitor visualization object.
|
|
626
638
|
|
|
627
639
|
The ``Monitor`` class provides access to Fluent monitor data for plotting,
|
|
@@ -662,3 +674,9 @@ class Monitor(_GraphicsContainer):
|
|
|
662
674
|
self.__dict__["_obj"] = Plots(
|
|
663
675
|
session=self.solver, local_surfaces_provider=Graphics(solver).Surfaces
|
|
664
676
|
).Monitors.create(**self.kwargs)
|
|
677
|
+
|
|
678
|
+
def get_field_data(self):
|
|
679
|
+
"""Exposes monitor data."""
|
|
680
|
+
return self._obj.session.monitors.get_monitor_set_data(
|
|
681
|
+
self.kwargs["monitor_set_name"]
|
|
682
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -357,6 +357,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
357
357
|
}
|
|
358
358
|
_mesh_dict["kwargs"] = {}
|
|
359
359
|
if obj_dict is not None:
|
|
360
|
+
clean_field = field.replace("\n", " ")
|
|
361
|
+
vect_title = obj_dict.get("title")
|
|
362
|
+
_mesh_dict["title"] = (
|
|
363
|
+
f"{vectors_of.capitalize()} " f"vectors colored by {clean_field}."
|
|
364
|
+
if vect_title is None
|
|
365
|
+
else vect_title
|
|
366
|
+
)
|
|
360
367
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
361
368
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
362
369
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -370,6 +377,14 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
370
377
|
}
|
|
371
378
|
_mesh_dict["kwargs"] = {}
|
|
372
379
|
if obj_dict is not None:
|
|
380
|
+
clean_field = field.replace("\n", " ")
|
|
381
|
+
vect_title = obj_dict.get("title")
|
|
382
|
+
_mesh_dict["title"] = (
|
|
383
|
+
f"{vectors_of.capitalize()} "
|
|
384
|
+
f"vectors colored by {clean_field}."
|
|
385
|
+
if vect_title is None
|
|
386
|
+
else vect_title
|
|
387
|
+
)
|
|
373
388
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
374
389
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
375
390
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -410,6 +425,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
410
425
|
}
|
|
411
426
|
_mesh_dict["kwargs"] = {}
|
|
412
427
|
if obj_dict is not None:
|
|
428
|
+
clean_field = field.replace("\n", " ")
|
|
429
|
+
path_title = obj_dict.get("title")
|
|
430
|
+
_mesh_dict["title"] = (
|
|
431
|
+
f"Pathlines colored by {clean_field}."
|
|
432
|
+
if path_title is None
|
|
433
|
+
else path_title
|
|
434
|
+
)
|
|
413
435
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
414
436
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
415
437
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -471,6 +493,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
471
493
|
}
|
|
472
494
|
_mesh_dict["kwargs"] = {}
|
|
473
495
|
if obj_dict is not None:
|
|
496
|
+
clean_field = field.replace("\n", " ")
|
|
497
|
+
cont_title = obj_dict.get("title")
|
|
498
|
+
_mesh_dict["title"] = (
|
|
499
|
+
f"Contour of {clean_field}."
|
|
500
|
+
if cont_title is None
|
|
501
|
+
else cont_title
|
|
502
|
+
)
|
|
474
503
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
475
504
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
476
505
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -485,6 +514,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
485
514
|
}
|
|
486
515
|
_mesh_dict["kwargs"] = {}
|
|
487
516
|
if obj_dict is not None:
|
|
517
|
+
clean_field = field.replace("\n", " ")
|
|
518
|
+
cont_title = obj_dict.get("title")
|
|
519
|
+
_mesh_dict["title"] = (
|
|
520
|
+
f"Contour of {clean_field}."
|
|
521
|
+
if cont_title is None
|
|
522
|
+
else cont_title
|
|
523
|
+
)
|
|
488
524
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
489
525
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
490
526
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -503,6 +539,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
503
539
|
}
|
|
504
540
|
_mesh_dict["kwargs"] = {}
|
|
505
541
|
if obj_dict is not None:
|
|
542
|
+
clean_field = field.replace("\n", " ")
|
|
543
|
+
cont_title = obj_dict.get("title")
|
|
544
|
+
_mesh_dict["title"] = (
|
|
545
|
+
f"Contour of {clean_field}."
|
|
546
|
+
if cont_title is None
|
|
547
|
+
else cont_title
|
|
548
|
+
)
|
|
506
549
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
507
550
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
508
551
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -513,6 +556,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
513
556
|
_mesh_dict = {"data": mesh.contour(isosurfaces=20)}
|
|
514
557
|
_mesh_dict["kwargs"] = {}
|
|
515
558
|
if obj_dict is not None:
|
|
559
|
+
clean_field = field.replace("\n", " ")
|
|
560
|
+
cont_title = obj_dict.get("title")
|
|
561
|
+
_mesh_dict["title"] = (
|
|
562
|
+
f"Contour of {clean_field}."
|
|
563
|
+
if cont_title is None
|
|
564
|
+
else cont_title
|
|
565
|
+
)
|
|
516
566
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
517
567
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
518
568
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -531,6 +581,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
531
581
|
}
|
|
532
582
|
_mesh_dict["kwargs"] = {}
|
|
533
583
|
if obj_dict is not None:
|
|
584
|
+
clean_field = field.replace("\n", " ")
|
|
585
|
+
cont_title = obj_dict.get("title")
|
|
586
|
+
_mesh_dict["title"] = (
|
|
587
|
+
f"Contour of {clean_field}."
|
|
588
|
+
if cont_title is None
|
|
589
|
+
else cont_title
|
|
590
|
+
)
|
|
534
591
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
535
592
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
536
593
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -541,6 +598,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
541
598
|
_mesh_dict = {"data": mesh.contour(isosurfaces=20)}
|
|
542
599
|
_mesh_dict["kwargs"] = {}
|
|
543
600
|
if obj_dict is not None:
|
|
601
|
+
clean_field = field.replace("\n", " ")
|
|
602
|
+
cont_title = obj_dict.get("title")
|
|
603
|
+
_mesh_dict["title"] = (
|
|
604
|
+
f"Contour of {clean_field}."
|
|
605
|
+
if cont_title is None
|
|
606
|
+
else cont_title
|
|
607
|
+
)
|
|
544
608
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
545
609
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
546
610
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -556,6 +620,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
556
620
|
}
|
|
557
621
|
_mesh_dict["kwargs"] = {}
|
|
558
622
|
if obj_dict is not None:
|
|
623
|
+
clean_field = field.replace("\n", " ")
|
|
624
|
+
cont_title = obj_dict.get("title")
|
|
625
|
+
_mesh_dict["title"] = (
|
|
626
|
+
f"Contour of {clean_field}."
|
|
627
|
+
if cont_title is None
|
|
628
|
+
else cont_title
|
|
629
|
+
)
|
|
559
630
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
560
631
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
561
632
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -566,6 +637,13 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
566
637
|
_mesh_dict = {"data": mesh.contour(isosurfaces=20)}
|
|
567
638
|
_mesh_dict["kwargs"] = {}
|
|
568
639
|
if obj_dict is not None:
|
|
640
|
+
clean_field = field.replace("\n", " ")
|
|
641
|
+
cont_title = obj_dict.get("title")
|
|
642
|
+
_mesh_dict["title"] = (
|
|
643
|
+
f"Contour of {clean_field}."
|
|
644
|
+
if cont_title is None
|
|
645
|
+
else cont_title
|
|
646
|
+
)
|
|
569
647
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
570
648
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
571
649
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -598,6 +676,8 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
598
676
|
_mesh_dict = {"data": mesh, "show_edges": obj.show_edges(), "color": color}
|
|
599
677
|
_mesh_dict["kwargs"] = {}
|
|
600
678
|
if obj_dict is not None:
|
|
679
|
+
mesh_title = obj_dict.get("title")
|
|
680
|
+
_mesh_dict["title"] = obj._name if mesh_title is None else mesh_title
|
|
601
681
|
_mesh_dict["position"] = obj_dict.get("position")
|
|
602
682
|
_mesh_dict["opacity"] = obj_dict.get("opacity")
|
|
603
683
|
_mesh_dict["kwargs"] = obj_dict.get("kwargs")
|
|
@@ -605,26 +685,24 @@ class GraphicsWindow(VisualizationWindow):
|
|
|
605
685
|
self._object_list_to_render.append(mesh_obj_list)
|
|
606
686
|
|
|
607
687
|
def _display_xy_plot(self, obj_dict):
|
|
608
|
-
|
|
609
|
-
[
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
)
|
|
688
|
+
plot_dict = {
|
|
689
|
+
"data": self._data["XYPlot"],
|
|
690
|
+
"position": obj_dict.get("position"),
|
|
691
|
+
"kwargs": obj_dict.get("kwargs"),
|
|
692
|
+
}
|
|
693
|
+
if obj_dict.get("title") is not None:
|
|
694
|
+
plot_dict["title"] = obj_dict.get("title")
|
|
695
|
+
self._object_list_to_render.append([plot_dict])
|
|
617
696
|
|
|
618
697
|
def _display_monitor_plot(self, obj_dict):
|
|
619
|
-
|
|
620
|
-
[
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
)
|
|
698
|
+
plot_dict = {
|
|
699
|
+
"data": self._data["MonitorPlot"],
|
|
700
|
+
"position": obj_dict.get("position"),
|
|
701
|
+
"kwargs": obj_dict.get("kwargs"),
|
|
702
|
+
}
|
|
703
|
+
if obj_dict.get("title") is not None:
|
|
704
|
+
plot_dict["title"] = obj_dict.get("title")
|
|
705
|
+
self._object_list_to_render.append([plot_dict])
|
|
628
706
|
|
|
629
707
|
def _get_refresh_for_plotter(self, window: "GraphicsWindow", graphics_obj_list):
|
|
630
708
|
def refresh():
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -135,6 +135,13 @@ class Renderer(AbstractRenderer):
|
|
|
135
135
|
if isinstance(mesh, pv.DataSet):
|
|
136
136
|
if mesh.n_points > 0:
|
|
137
137
|
mesh_dict.update(mesh_dict.pop("kwargs"))
|
|
138
|
+
if "title" in mesh_dict:
|
|
139
|
+
self.plotter.add_text(
|
|
140
|
+
mesh_dict.pop("title"),
|
|
141
|
+
position="upper_edge",
|
|
142
|
+
font_size=6,
|
|
143
|
+
name="title",
|
|
144
|
+
)
|
|
138
145
|
self.plotter.add_mesh(mesh, **mesh_dict)
|
|
139
146
|
else:
|
|
140
147
|
y_range = None
|
ansys_fluent_visualization-0.26.dev0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright (C) 2022 - 2026 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,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -164,6 +164,8 @@ class PlotterWindow(VisualizationWindow):
|
|
|
164
164
|
)
|
|
165
165
|
|
|
166
166
|
plot_data = plot()
|
|
167
|
+
if obj_dict.get("title") is not None:
|
|
168
|
+
plot_data[1]["title"] = obj_dict["title"]
|
|
167
169
|
self._object_list_to_render.append(
|
|
168
170
|
[
|
|
169
171
|
{
|
|
@@ -264,22 +266,11 @@ class _MonitorPlot:
|
|
|
264
266
|
"""Draw a monitor plot."""
|
|
265
267
|
if not self.post_object:
|
|
266
268
|
return
|
|
267
|
-
self.post_object.session.monitors.refresh(None, None)
|
|
268
269
|
monitors = self.post_object.session.monitors
|
|
269
270
|
xy_data = {}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
while True:
|
|
275
|
-
indices, columns_data = monitors.get_monitor_set_data(
|
|
276
|
-
self.post_object.monitor_set_name()
|
|
277
|
-
)
|
|
278
|
-
if columns_data != {} or count > timeout:
|
|
279
|
-
break
|
|
280
|
-
time.sleep(0.1)
|
|
281
|
-
count += 0.1
|
|
282
|
-
|
|
271
|
+
indices, columns_data = monitors.get_monitor_set_data(
|
|
272
|
+
self.post_object.monitor_set_name()
|
|
273
|
+
)
|
|
283
274
|
for column_name, column_data in columns_data.items():
|
|
284
275
|
xy_data[column_name] = {"xvalues": indices, "yvalues": column_data}
|
|
285
276
|
monitor_set_name = self.post_object.monitor_set_name()
|
ansys_fluent_visualization-0.26.dev0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright (C) 2022 - 2026 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,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022 -
|
|
1
|
+
# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates.
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
#
|
|
4
4
|
#
|
|
@@ -28,6 +28,7 @@ from ansys.fluent.interface.post_objects.post_object_definitions import (
|
|
|
28
28
|
PlotDefn,
|
|
29
29
|
)
|
|
30
30
|
import ansys.fluent.visualization as pyviz
|
|
31
|
+
from ansys.fluent.visualization.containers import GraphicsObject
|
|
31
32
|
from ansys.fluent.visualization.graphics import graphics_windows_manager
|
|
32
33
|
from ansys.fluent.visualization.graphics.graphics_windows import _GraphicsWindow
|
|
33
34
|
from ansys.fluent.visualization.plotter.plotter_windows import _PlotterWindow
|
|
@@ -58,7 +59,7 @@ class GraphicsWindow:
|
|
|
58
59
|
>>> graphics_window.show()
|
|
59
60
|
"""
|
|
60
61
|
|
|
61
|
-
def __init__(self, renderer=None):
|
|
62
|
+
def __init__(self, renderer: str = None):
|
|
62
63
|
"""__init__ method of GraphicsWindow class."""
|
|
63
64
|
self._graphics_objs = []
|
|
64
65
|
self.window_id = None
|
|
@@ -68,9 +69,10 @@ class GraphicsWindow:
|
|
|
68
69
|
|
|
69
70
|
def add_graphics(
|
|
70
71
|
self,
|
|
71
|
-
graphics_obj,
|
|
72
|
+
graphics_obj: GraphicsObject,
|
|
72
73
|
position: tuple = (0, 0),
|
|
73
74
|
opacity: float = 1,
|
|
75
|
+
title: str | None = None,
|
|
74
76
|
**kwargs,
|
|
75
77
|
) -> None:
|
|
76
78
|
"""Add graphics-data to a window.
|
|
@@ -83,6 +85,8 @@ class GraphicsWindow:
|
|
|
83
85
|
Position of the sub-plot.
|
|
84
86
|
opacity: float, optional
|
|
85
87
|
Transparency of the sub-plot.
|
|
88
|
+
title : str, optional
|
|
89
|
+
Title of the sub-plot.
|
|
86
90
|
"""
|
|
87
91
|
self._list_of_positions.append(position)
|
|
88
92
|
if isinstance(graphics_obj._obj, GraphicsDefn):
|
|
@@ -93,8 +97,9 @@ class GraphicsWindow:
|
|
|
93
97
|
|
|
94
98
|
def add_plot(
|
|
95
99
|
self,
|
|
96
|
-
plot_obj,
|
|
100
|
+
plot_obj: GraphicsObject,
|
|
97
101
|
position: tuple = (0, 0),
|
|
102
|
+
title: str | None = None,
|
|
98
103
|
**kwargs,
|
|
99
104
|
) -> None:
|
|
100
105
|
"""Add 2D plot-data to a window.
|
ansys_fluent_visualization-0.24.dev0/src/ansys/fluent/visualization/plotter/matplotlib/__init__.py
DELETED
|
@@ -1,21 +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.
|
ansys_fluent_visualization-0.24.dev0/src/ansys/fluent/visualization/plotter/pyvista/__init__.py
DELETED
|
@@ -1,21 +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.
|
|
File without changes
|
|
File without changes
|