ansys-fluent-core 0.27.dev1__py3-none-any.whl → 0.28.dev0__py3-none-any.whl
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.
Potentially problematic release.
This version of ansys-fluent-core might be problematic. Click here for more details.
- ansys/fluent/core/__init__.py +22 -9
- ansys/fluent/core/_version.py +5 -2
- ansys/fluent/core/codegen/__init__.py +0 -3
- ansys/fluent/core/codegen/allapigen.py +1 -5
- ansys/fluent/core/codegen/builtin_settingsgen.py +44 -10
- ansys/fluent/core/codegen/datamodelgen.py +53 -12
- ansys/fluent/core/codegen/settingsgen.py +21 -12
- ansys/fluent/core/codegen/settingsgen_old.py +2 -2
- ansys/fluent/core/codegen/tuigen.py +1 -1
- ansys/fluent/core/codegen/write_settings_yaml.py +3 -4
- ansys/fluent/core/data_model_cache.py +132 -70
- ansys/fluent/core/docs/README.rst +2 -2
- ansys/fluent/core/examples/downloads.py +3 -5
- ansys/fluent/core/exceptions.py +1 -0
- ansys/fluent/core/file_session.py +59 -131
- ansys/fluent/core/filereader/case_file.py +17 -17
- ansys/fluent/core/filereader/casereader.py +2 -1
- ansys/fluent/core/filereader/data_file.py +7 -7
- ansys/fluent/core/filereader/lispy.py +6 -1
- ansys/fluent/core/fluent_connection.py +35 -7
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_222/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_222/PartManagement.py +28 -28
- ansys/fluent/core/generated/datamodel_222/meshing.py +301 -301
- ansys/fluent/core/generated/datamodel_222/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_231/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_231/PartManagement.py +55 -55
- ansys/fluent/core/generated/datamodel_231/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_231/meshing.py +317 -317
- ansys/fluent/core/generated/datamodel_231/solverworkflow.py +51 -51
- ansys/fluent/core/generated/datamodel_231/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_232/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_232/PartManagement.py +55 -55
- ansys/fluent/core/generated/datamodel_232/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_232/meshing.py +335 -335
- ansys/fluent/core/generated/datamodel_232/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_232/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_241/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_241/PartManagement.py +57 -57
- ansys/fluent/core/generated/datamodel_241/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_241/meshing.py +361 -361
- ansys/fluent/core/generated/datamodel_241/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_241/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_242/MeshingUtilities.py +240 -240
- ansys/fluent/core/generated/datamodel_242/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_242/PartManagement.py +60 -60
- ansys/fluent/core/generated/datamodel_242/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_242/meshing.py +371 -371
- ansys/fluent/core/generated/datamodel_242/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_242/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_251/MeshingUtilities.py +244 -244
- ansys/fluent/core/generated/datamodel_251/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_251/PartManagement.py +60 -60
- ansys/fluent/core/generated/datamodel_251/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_251/meshing.py +384 -382
- ansys/fluent/core/generated/datamodel_251/preferences.py +7 -0
- ansys/fluent/core/generated/datamodel_251/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_251/workflow.py +10 -10
- ansys/fluent/core/generated/datamodel_252/MeshingUtilities.py +3664 -0
- ansys/fluent/core/generated/datamodel_252/PMFileManagement.py +288 -0
- ansys/fluent/core/generated/datamodel_252/PartManagement.py +2588 -0
- ansys/fluent/core/generated/datamodel_252/flicing.py +7972 -0
- ansys/fluent/core/generated/datamodel_252/meshing.py +2644 -0
- ansys/fluent/core/generated/datamodel_252/preferences.py +2760 -0
- ansys/fluent/core/generated/datamodel_252/solverworkflow.py +479 -0
- ansys/fluent/core/generated/datamodel_252/workflow.py +466 -0
- ansys/fluent/core/generated/fluent_version_251.py +4 -4
- ansys/fluent/core/generated/fluent_version_252.py +5 -0
- ansys/fluent/core/generated/meshing/tui_251.py +1139 -1179
- ansys/fluent/core/generated/meshing/tui_252.py +10181 -0
- ansys/fluent/core/generated/solver/settings_222.py +3 -3
- ansys/fluent/core/generated/solver/settings_231.py +4 -4
- ansys/fluent/core/generated/solver/settings_232.py +5 -5
- ansys/fluent/core/generated/solver/settings_241.py +5 -5
- ansys/fluent/core/generated/solver/settings_242.py +1185 -1185
- ansys/fluent/core/generated/solver/settings_251.py +1847 -1652
- ansys/fluent/core/generated/solver/settings_251.pyi +237 -211
- ansys/fluent/core/generated/solver/settings_252.py +90369 -0
- ansys/fluent/core/generated/solver/settings_252.pyi +63778 -0
- ansys/fluent/core/generated/solver/settings_builtin.py +612 -1
- ansys/fluent/core/generated/solver/settings_builtin.pyi +235 -0
- ansys/fluent/core/generated/solver/tui_251.py +2283 -2103
- ansys/fluent/core/generated/solver/tui_252.py +37720 -0
- ansys/fluent/core/journaling.py +1 -1
- ansys/fluent/core/launcher/error_handler.py +3 -0
- ansys/fluent/core/launcher/fluent_container.py +5 -0
- ansys/fluent/core/launcher/launcher.py +1 -2
- ansys/fluent/core/launcher/launcher_utils.py +17 -6
- ansys/fluent/core/launcher/process_launch_string.py +3 -3
- ansys/fluent/core/launcher/pyfluent_enums.py +1 -1
- ansys/fluent/core/launcher/slurm_launcher.py +2 -1
- ansys/fluent/core/launcher/standalone_launcher.py +11 -5
- ansys/fluent/core/launcher/watchdog.py +1 -1
- ansys/fluent/core/launcher/watchdog_exec +6 -3
- ansys/fluent/core/logging.py +1 -5
- ansys/fluent/core/parametric.py +6 -3
- ansys/fluent/core/post_objects/meta.py +1 -39
- ansys/fluent/core/post_objects/post_helper.py +4 -3
- ansys/fluent/core/post_objects/post_object_definitions.py +12 -7
- ansys/fluent/core/post_objects/post_objects_container.py +39 -2
- ansys/fluent/core/rpvars.py +2 -1
- ansys/fluent/core/scheduler/machine_list.py +3 -1
- ansys/fluent/core/search.py +109 -262
- ansys/fluent/core/services/__init__.py +3 -0
- ansys/fluent/core/services/api_upgrade.py +1 -0
- ansys/fluent/core/services/batch_ops.py +3 -1
- ansys/fluent/core/services/datamodel_se.py +37 -30
- ansys/fluent/core/services/datamodel_tui.py +8 -3
- ansys/fluent/core/services/deprecated_field_data.py +691 -0
- ansys/fluent/core/services/field_data.py +67 -357
- ansys/fluent/core/services/interceptors.py +6 -4
- ansys/fluent/core/services/reduction.py +1 -2
- ansys/fluent/core/services/scheme_eval.py +2 -3
- ansys/fluent/core/services/solution_variables.py +46 -48
- ansys/fluent/core/session.py +6 -4
- ansys/fluent/core/session_meshing.pyi +5 -0
- ansys/fluent/core/session_pure_meshing.pyi +4 -1
- ansys/fluent/core/session_solver_lite.py +2 -1
- ansys/fluent/core/solver/flobject.py +179 -207
- ansys/fluent/core/solver/flunits.py +65 -56
- ansys/fluent/core/solver/function/reduction.py +9 -29
- ansys/fluent/core/solver/settings_builtin_bases.py +28 -22
- ansys/fluent/core/solver/settings_builtin_data.py +105 -1
- ansys/fluent/core/solver/settings_external.py +0 -28
- ansys/fluent/core/streaming_services/field_data_streaming.py +1 -0
- ansys/fluent/core/streaming_services/monitor_streaming.py +0 -1
- ansys/fluent/core/systemcoupling.py +145 -14
- ansys/fluent/core/utils/__init__.py +18 -2
- ansys/fluent/core/utils/dump_session_data.py +7 -4
- ansys/fluent/core/utils/execution.py +2 -2
- ansys/fluent/core/utils/file_transfer_service.py +37 -42
- ansys/fluent/core/utils/fluent_version.py +20 -2
- ansys/fluent/core/utils/networking.py +39 -1
- ansys/fluent/core/workflow.py +3 -15
- ansys/fluent/tests/conftest.py +89 -7
- ansys/fluent/tests/fluent/test_version/test.py +2 -0
- ansys/fluent/tests/fluent_fixtures.py +195 -0
- ansys/fluent/tests/integration/test_optislang/test_optislang_integration.py +7 -7
- ansys/fluent/tests/parametric/test_parametric_workflow.py +14 -4
- ansys/fluent/tests/test_builtin_settings.py +28 -0
- ansys/fluent/tests/test_cad_to_post_ftm.py +1 -3
- ansys/fluent/tests/test_cad_to_post_wtm.py +1 -1
- ansys/fluent/tests/test_casereader.py +1 -1
- ansys/fluent/tests/test_codegen.py +116 -6
- ansys/fluent/tests/test_data_model_cache.py +1 -1
- ansys/fluent/tests/test_datamodel_service.py +14 -19
- ansys/fluent/tests/test_field_data.py +93 -45
- ansys/fluent/tests/test_file_session.py +32 -29
- ansys/fluent/tests/test_flobject.py +16 -58
- ansys/fluent/tests/test_fluent_fixes.py +5 -5
- ansys/fluent/tests/test_fluent_session.py +11 -8
- ansys/fluent/tests/test_fluent_version.py +1 -1
- ansys/fluent/tests/test_launcher.py +22 -5
- ansys/fluent/tests/test_launcher_remote.py +80 -4
- ansys/fluent/tests/test_meshing_utilities.py +93 -44
- ansys/fluent/tests/test_meshing_workflow.py +6 -6
- ansys/fluent/tests/test_meshingmode/test_meshing_launch.py +1 -1
- ansys/fluent/tests/test_new_meshing_workflow.py +42 -3
- ansys/fluent/tests/test_preferences.py +6 -6
- ansys/fluent/tests/test_reduction.py +61 -30
- ansys/fluent/tests/test_rp_vars.py +1 -1
- ansys/fluent/tests/test_search.py +53 -200
- ansys/fluent/tests/test_session.py +18 -13
- ansys/fluent/tests/test_settings_api.py +93 -29
- ansys/fluent/tests/test_settings_reader.py +1 -1
- ansys/fluent/tests/test_solver_monitors.py +1 -1
- ansys/fluent/tests/test_solvermode/test_calculationactivities.py +4 -4
- ansys/fluent/tests/test_solvermode/test_controls.py +3 -3
- ansys/fluent/tests/test_solvermode/test_methods.py +1 -1
- ansys/fluent/tests/test_solvermode/test_models.py +3 -3
- ansys/fluent/tests/test_systemcoupling.py +33 -5
- ansys/fluent/tests/test_topy.py +2 -2
- ansys/fluent/tests/test_tui_api.py +5 -5
- ansys/fluent/tests/test_utils.py +1 -1
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/METADATA +6 -17
- ansys_fluent_core-0.28.dev0.dist-info/RECORD +291 -0
- ansys/fluent/core/generated/api_tree_222.pickle +0 -0
- ansys/fluent/core/generated/api_tree_231.pickle +0 -0
- ansys/fluent/core/generated/api_tree_232.pickle +0 -0
- ansys/fluent/core/generated/api_tree_241.pickle +0 -0
- ansys/fluent/core/generated/api_tree_242.pickle +0 -0
- ansys/fluent/core/generated/api_tree_251.pickle +0 -0
- ansys/fluent/tests/test_tests_util.py +0 -47
- ansys/fluent/tests/util/__init__.py +0 -38
- ansys_fluent_core-0.27.dev1.dist-info/RECORD +0 -283
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/AUTHORS +0 -0
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/LICENSE +0 -0
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/WHEEL +0 -0
|
@@ -4,9 +4,10 @@ import warnings
|
|
|
4
4
|
|
|
5
5
|
from ansys.fluent.core.warnings import PyFluentDeprecationWarning
|
|
6
6
|
|
|
7
|
+
from .case_file import CaseFile as CaseReader # noqa: F401
|
|
8
|
+
|
|
7
9
|
# Compatibility aliases
|
|
8
10
|
warnings.warn(
|
|
9
11
|
"Use case_file.CaseFile instead of casereader.CaseReader",
|
|
10
12
|
PyFluentDeprecationWarning,
|
|
11
13
|
)
|
|
12
|
-
from .case_file import CaseFile as CaseReader # noqa: F401
|
|
@@ -36,17 +36,17 @@ class DataFile:
|
|
|
36
36
|
|
|
37
37
|
Methods
|
|
38
38
|
-------
|
|
39
|
-
case_file
|
|
39
|
+
case_file()
|
|
40
40
|
Get the name of case file.
|
|
41
|
-
|
|
42
|
-
Get the variables list available at face.
|
|
43
|
-
get_phases
|
|
41
|
+
get_phases()
|
|
44
42
|
Get the list of phases.
|
|
45
|
-
|
|
43
|
+
get_face_variables(phase_name)
|
|
44
|
+
Get the variables list available at face.
|
|
45
|
+
get_cell_variables(phase_name)
|
|
46
46
|
Get the variables list available at cell.
|
|
47
|
-
get_face_scalar_field_data
|
|
47
|
+
get_face_scalar_field_data(phase_name, field_name, surface_id)
|
|
48
48
|
Get the scalar field data for face.
|
|
49
|
-
get_face_vector_field_data
|
|
49
|
+
get_face_vector_field_data(phase_name, surface_id)
|
|
50
50
|
Get the vector field data for face.
|
|
51
51
|
"""
|
|
52
52
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Provides a module for Scheme Interpreter in Python."""
|
|
2
2
|
|
|
3
|
+
# flake8: noqa: E266
|
|
4
|
+
|
|
3
5
|
################ Scheme Interpreter in Python
|
|
4
6
|
|
|
5
7
|
## (c) Peter Norvig, 2010; See http://norvig.com/lispy2.html
|
|
@@ -48,6 +50,7 @@ class Procedure:
|
|
|
48
50
|
"""A user-defined Scheme procedure."""
|
|
49
51
|
|
|
50
52
|
def __init__(self, params, exp, env):
|
|
53
|
+
"""Initialize Procedure."""
|
|
51
54
|
self.params, self.exp, self.env = params, exp, env
|
|
52
55
|
|
|
53
56
|
def __call__(self, *args):
|
|
@@ -91,6 +94,7 @@ class InputPort:
|
|
|
91
94
|
tokenizer = r"""\s*(,@|[('`,)]|"(?:[\\].|[^\\"])*"|;.*|[^\s('"`,;)]*)(.*)"""
|
|
92
95
|
|
|
93
96
|
def __init__(self, file):
|
|
97
|
+
"""Initialize InputPort."""
|
|
94
98
|
self.file = file
|
|
95
99
|
self.line = ""
|
|
96
100
|
|
|
@@ -252,6 +256,7 @@ class Env(dict):
|
|
|
252
256
|
"""An environment: a dict of {'var':val} pairs, with an outer Env."""
|
|
253
257
|
|
|
254
258
|
def __init__(self, params=(), args=(), outer=None):
|
|
259
|
+
"""Initialize Env."""
|
|
255
260
|
# Bind paarm list to corresponding args, or single param to list of args
|
|
256
261
|
self.outer = outer
|
|
257
262
|
if isa(params, Symbol):
|
|
@@ -497,7 +502,7 @@ _append, _cons, _let = map(Sym, "append cons let".split())
|
|
|
497
502
|
|
|
498
503
|
|
|
499
504
|
def expand_quasiquote(x):
|
|
500
|
-
"""Expand
|
|
505
|
+
"""Expand ```x`` => ``'x``; ```,x`` => ``x``; ```(,@x y)`` => ``(append x y)``."""
|
|
501
506
|
if not is_pair(x):
|
|
502
507
|
return [_quote, x]
|
|
503
508
|
require(x, x[0] is not _unquotesplicing, "can't splice here")
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import ctypes
|
|
5
6
|
from ctypes import c_int, sizeof
|
|
6
7
|
from dataclasses import dataclass
|
|
7
8
|
import itertools
|
|
8
9
|
import logging
|
|
9
10
|
import os
|
|
10
11
|
from pathlib import Path
|
|
12
|
+
import platform
|
|
11
13
|
import socket
|
|
12
14
|
import subprocess
|
|
13
15
|
import threading
|
|
14
|
-
from typing import Any, Callable, List, Tuple
|
|
16
|
+
from typing import Any, Callable, List, Tuple, TypeVar
|
|
15
17
|
import warnings
|
|
16
18
|
import weakref
|
|
17
19
|
|
|
18
20
|
import grpc
|
|
19
|
-
import psutil
|
|
20
21
|
|
|
21
22
|
import ansys.fluent.core as pyfluent
|
|
22
23
|
from ansys.fluent.core.services import service_creator
|
|
@@ -39,6 +40,7 @@ class PortNotProvided(ValueError):
|
|
|
39
40
|
"""Raised when port is not provided."""
|
|
40
41
|
|
|
41
42
|
def __init__(self):
|
|
43
|
+
"""Initialize PortNotProvided."""
|
|
42
44
|
super().__init__(
|
|
43
45
|
"Provide the 'port' to connect to an existing Fluent instance."
|
|
44
46
|
)
|
|
@@ -48,6 +50,7 @@ class UnsupportedRemoteFluentInstance(ValueError):
|
|
|
48
50
|
"""Raised when 'wait_process_finished' does not support remote Fluent session."""
|
|
49
51
|
|
|
50
52
|
def __init__(self):
|
|
53
|
+
"""Initialize UnsupportedRemoteFluentInstance."""
|
|
51
54
|
super().__init__("Remote Fluent instance is unsupported.")
|
|
52
55
|
|
|
53
56
|
|
|
@@ -55,6 +58,7 @@ class WaitTypeError(TypeError):
|
|
|
55
58
|
"""Raised when invalid ``wait`` type is provided."""
|
|
56
59
|
|
|
57
60
|
def __init__(self):
|
|
61
|
+
"""Initialize WaitTypeError."""
|
|
58
62
|
super().__init__("Invalid 'wait' type.")
|
|
59
63
|
|
|
60
64
|
|
|
@@ -82,6 +86,7 @@ class MonitorThread(threading.Thread):
|
|
|
82
86
|
"""
|
|
83
87
|
|
|
84
88
|
def __init__(self):
|
|
89
|
+
"""Initialize MonitorThread."""
|
|
85
90
|
super().__init__(daemon=True)
|
|
86
91
|
self.cbs: List[Callable] = []
|
|
87
92
|
|
|
@@ -93,7 +98,10 @@ class MonitorThread(threading.Thread):
|
|
|
93
98
|
cb()
|
|
94
99
|
|
|
95
100
|
|
|
96
|
-
|
|
101
|
+
ContainerT = TypeVar("ContainerT")
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def get_container(container_id_or_name: str) -> bool | ContainerT | None:
|
|
97
105
|
"""Get the Docker container object.
|
|
98
106
|
|
|
99
107
|
Returns
|
|
@@ -199,7 +207,7 @@ class FluentConnectionProperties:
|
|
|
199
207
|
cortex_pid: int | None = None
|
|
200
208
|
cortex_host: str | None = None
|
|
201
209
|
fluent_host_pid: int | None = None
|
|
202
|
-
inside_container: bool |
|
|
210
|
+
inside_container: bool | ContainerT | None = None
|
|
203
211
|
|
|
204
212
|
def list_names(self) -> list:
|
|
205
213
|
"""Returns list with all property names."""
|
|
@@ -262,7 +270,7 @@ class _ConnectionInterface:
|
|
|
262
270
|
logger.debug("Cortex connection properties successfully obtained.")
|
|
263
271
|
except _InactiveRpcError:
|
|
264
272
|
logger.warning(
|
|
265
|
-
"Fluent Cortex properties unobtainable. 'force exit()' and other"
|
|
273
|
+
"Fluent Cortex properties unobtainable. 'force exit()' and other "
|
|
266
274
|
"methods are not going to work properly. Proceeding..."
|
|
267
275
|
)
|
|
268
276
|
fluent_host_pid = None
|
|
@@ -292,6 +300,26 @@ class _ConnectionInterface:
|
|
|
292
300
|
self.scheme_eval.exec(("(exit-server)",))
|
|
293
301
|
|
|
294
302
|
|
|
303
|
+
def _pid_exists(pid):
|
|
304
|
+
if platform.system() == "Linux":
|
|
305
|
+
try:
|
|
306
|
+
os.kill(pid, 0)
|
|
307
|
+
except OSError:
|
|
308
|
+
return False
|
|
309
|
+
else:
|
|
310
|
+
return True
|
|
311
|
+
elif platform.system() == "Windows":
|
|
312
|
+
process_query_limited_information = 0x1000
|
|
313
|
+
process_handle = ctypes.windll.kernel32.OpenProcess(
|
|
314
|
+
process_query_limited_information, 0, pid
|
|
315
|
+
)
|
|
316
|
+
if process_handle == 0:
|
|
317
|
+
return False
|
|
318
|
+
else:
|
|
319
|
+
ctypes.windll.kernel32.CloseHandle(process_handle)
|
|
320
|
+
return True
|
|
321
|
+
|
|
322
|
+
|
|
295
323
|
class FluentConnection:
|
|
296
324
|
"""Encapsulates a Fluent connection.
|
|
297
325
|
|
|
@@ -601,8 +629,8 @@ class FluentConnection:
|
|
|
601
629
|
)
|
|
602
630
|
else:
|
|
603
631
|
_response = timeout_loop(
|
|
604
|
-
lambda connection:
|
|
605
|
-
or
|
|
632
|
+
lambda connection: _pid_exists(connection.fluent_host_pid)
|
|
633
|
+
or _pid_exists(connection.cortex_pid),
|
|
606
634
|
wait,
|
|
607
635
|
args=(self.connection_properties,),
|
|
608
636
|
idle_period=0.5,
|