Skip to content

Commit

Permalink
build: intellisense support for 24.1 Fluent API (#2386) (#2388)
Browse files Browse the repository at this point in the history
build: intellisense support for 24.1 API files
  • Loading branch information
mkundu1 authored Jan 25, 2024
1 parent db16638 commit 987f400
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 46 deletions.
22 changes: 11 additions & 11 deletions doc/source/getting_started/faqs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ all PyFluent packages in a Python *virtual environment*:
#. Install Fluent 2022 R2 or later.
#. Set the environment variable for your installed release to point to
the appropriate Ansys installation folder.

For example, for Ansys 2022 R2, you would likely set the ``AWP_ROOT222``
environment variable to point to ``C:\Program Files\ANSYS Inc\v222``.

Expand All @@ -116,10 +116,10 @@ all PyFluent packages in a Python *virtual environment*:

.. code:: bash
# Set up a local virtual environment
python -m venv venv
python -m venv venv
# Activate the virtual environment on Windows
venv\Scripts\activate
Expand All @@ -130,8 +130,8 @@ all PyFluent packages in a Python *virtual environment*:
# Activate the virtual environment on Linux (bash)
. venv/bin/activate
#. In the same command window, use ``pip``, the package installer for Python, to
install the PyFluent packages::

Expand Down Expand Up @@ -164,7 +164,7 @@ Where do you find source code and documentation?
All PyAnsys public libraries are available from the `PyAnsys GitHub account
<https://github.com/pyansys>`_. The **Repositories** page displays the number of
repositories, which are searchable by name. For example, to find all PyFluent
libraries, type ``pyfluent`` in the search option.
libraries, type ``pyfluent`` in the search option.

The ``README.md`` file for the PyAnsys GitHub account lists the public PyAnsys
libraries. The links in this list are to the documentation for the respective
Expand Down Expand Up @@ -203,10 +203,10 @@ increasing order of precedence:

#. ``AWP_ROOT<ver>`` environment variable, which is configured on Windows system
when Fluent is installed, where ``<ver>`` is the Fluent release number such
as ``232`` for release 2023 R2. PyFluent automatically uses this environment
as ``241`` for release 2024 R1. PyFluent automatically uses this environment
variable to locate the latest Fluent installation. On Linux systems configure
``AWP_ROOT<ver>`` to point to the absolute path of an Ansys installation such
as ``/apps/ansys_inc/v232``.
as ``/apps/ansys_inc/v241``.

#. Value of ``product_version`` parameter passed to :func:`launch_fluent()
<ansys.fluent.core.launch_fluent>`.
Expand All @@ -224,15 +224,15 @@ learn how to use PyFluent:
<https://visualization.fluent.docs.pyansys.com/>`_ guides.
- Record a journal of your actions in Fluent and review the corresponding Python
script.

.. note::
In Fluent 2022 R2, you can record a journal of your actions in Fluent
meshing to produce a Scheme script. Within that script are embedded
Python statements corresponding to each recorded meshing workflow
action. When extracted from the Scheme script, those Python statements
are valid in the PyFluent context.


Here is a Python command recorded in Fluent:

.. code:: python
Expand All @@ -241,7 +241,7 @@ learn how to use PyFluent:
Here is the manually translated equivalent command in PyFluent syntax:

.. code:: python
session.meshing.workflow.TaskObject['Describe Geometry and Flow'].Arguments.setState(({r'AddEnclosure': r'No',r'CloseCaps': r'Yes',r'FlowType': r'Internal flow through the object’,})
Expand Down
17 changes: 11 additions & 6 deletions src/ansys/fluent/core/session_meshing.pyi
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
from ansys.fluent.core.datamodel_232.PMFileManagement import (
from ansys.fluent.core.datamodel_241.PMFileManagement import (
Root as pmfilemanagement_root,
)
from ansys.fluent.core.datamodel_232.PartManagement import Root as partmanagement_root
from ansys.fluent.core.datamodel_232.meshing import Root as meshing_root
from ansys.fluent.core.datamodel_232.preferences import Root as preferences_root
from ansys.fluent.core.datamodel_232.workflow import Root as workflow_root
from ansys.fluent.core.solver.tui_232 import main_menu
from ansys.fluent.core.datamodel_241.PartManagement import Root as partmanagement_root
from ansys.fluent.core.datamodel_241.meshing import Root as meshing_root
from ansys.fluent.core.datamodel_241.meshing_utilities import (
Root as meshing_utilities_root,
)
from ansys.fluent.core.datamodel_241.preferences import Root as preferences_root
from ansys.fluent.core.datamodel_241.workflow import Root as workflow_root
from ansys.fluent.core.solver.tui_241 import main_menu

class Meshing:
@property
def tui(self) -> main_menu: ...
@property
def meshing(self) -> meshing_root: ...
@property
def meshing_utilities(self) -> meshing_utilities_root: ...
@property
def workflow(self) -> workflow_root: ...
@property
def PartManagement(self) -> partmanagement_root: ...
Expand Down
21 changes: 15 additions & 6 deletions src/ansys/fluent/core/session_pure_meshing.pyi
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
from ansys.fluent.core.datamodel_232.PMFileManagement import (
from ansys.fluent.core.datamodel_241.PMFileManagement import (
Root as pmfilemanagement_root,
)
from ansys.fluent.core.datamodel_232.PartManagement import Root as partmanagement_root
from ansys.fluent.core.datamodel_232.meshing import Root as meshing_root
from ansys.fluent.core.datamodel_232.preferences import Root as preferences_root
from ansys.fluent.core.datamodel_232.workflow import Root as workflow_root
from ansys.fluent.core.solver.tui_232 import main_menu
from ansys.fluent.core.datamodel_241.PartManagement import Root as partmanagement_root
from ansys.fluent.core.datamodel_241.meshing import Root as meshing_root
from ansys.fluent.core.datamodel_241.meshing_utilities import (
Root as meshing_utilities_root,
)
from ansys.fluent.core.datamodel_241.preferences import Root as preferences_root
from ansys.fluent.core.datamodel_241.workflow import Root as workflow_root
from ansys.fluent.core.solver.tui_241 import main_menu

class PureMeshing:
@property
def tui(self) -> main_menu: ...
@property
def meshing(self) -> meshing_root: ...
@property
def meshing_utilities(self) -> meshing_utilities_root: ...
@property
def workflow(self) -> workflow_root: ...
def watertight(self, dynamic_interface: bool): ...
def fault_tolerant(self, dynamic_interface: bool): ...
@property
def PartManagement(self) -> partmanagement_root: ...
@property
def PMFileManagement(self) -> pmfilemanagement_root: ...
@property
def preferences(self) -> preferences_root: ...
def transfer_mesh_to_solvers(
self,
solvers,
Expand Down
51 changes: 28 additions & 23 deletions src/ansys/fluent/core/session_solver.pyi
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from ansys.fluent.core.datamodel_232.preferences import Root as preferences_root
from ansys.fluent.core.datamodel_232.solverworkflow import Root as solverworkflow_root
from ansys.fluent.core.datamodel_232.workflow import Root as workflow_root
from ansys.fluent.core.solver.settings_232.current_parametric_study import (
from ansys.fluent.core.datamodel_241.preferences import Root as preferences_root
from ansys.fluent.core.datamodel_241.solverworkflow import Root as solverworkflow_root
from ansys.fluent.core.datamodel_241.workflow import Root as workflow_root
from ansys.fluent.core.solver.settings_241.current_parametric_study import (
current_parametric_study,
)
from ansys.fluent.core.solver.settings_232.file import file
from ansys.fluent.core.solver.settings_232.mesh import mesh
from ansys.fluent.core.solver.settings_232.parallel import parallel
from ansys.fluent.core.solver.settings_232.parametric_studies import parametric_studies
from ansys.fluent.core.solver.settings_232.report import report
from ansys.fluent.core.solver.settings_232.results import results
from ansys.fluent.core.solver.settings_232.server import server
from ansys.fluent.core.solver.settings_232.setup import setup
from ansys.fluent.core.solver.settings_232.solution import solution
from ansys.fluent.core.solver.tui_232 import main_menu
from ansys.fluent.core.solver.settings_241.file import file
from ansys.fluent.core.solver.settings_241.mesh import mesh
from ansys.fluent.core.solver.settings_241.parallel import parallel
from ansys.fluent.core.solver.settings_241.parametric_studies import parametric_studies
from ansys.fluent.core.solver.settings_241.report import report
from ansys.fluent.core.solver.settings_241.results import results
from ansys.fluent.core.solver.settings_241.server import server
from ansys.fluent.core.solver.settings_241.setup import setup
from ansys.fluent.core.solver.settings_241.solution import solution
from ansys.fluent.core.solver.tui_241 import main_menu
from ansys.fluent.core.systemcoupling import SystemCoupling

class Solver:
def build_from_fluent_connection(self, fluent_connection): ...
Expand All @@ -24,27 +25,31 @@ class Solver:
@property
def workflow(self) -> workflow_root: ...
@property
def system_coupling(self) -> SystemCoupling: ...
@property
def preferences(self) -> preferences_root: ...
def read_case_lightweight(self, file_name: str): ...
def read_case(self, file_name: str): ...
def write_case(self, file_name: str): ...
@property
def file(self) -> file: ...
@property
def mesh(self) -> mesh: ...
@property
def server(self) -> server: ...
@property
def setup(self) -> setup: ...
@property
def solution(self) -> solution: ...
@property
def results(self) -> results: ...
@property
def design(self) -> design: ...
@property
def parametric_studies(self) -> parametric_studies: ...
@property
def current_parametric_study(self) -> current_parametric_study: ...
@property
def parallel(self) -> parallel: ...
def parameters(self) -> parameters: ...
@property
def report(self) -> report: ...
@property
def server(self) -> server: ...
@property
def preferences(self) -> preferences_root: ...
@property
def solverworkflow(self) -> solverworkflow_root: ...
def read_case(self, file_name: str, lightweight_mode: bool = ...): ...
def parallel(self) -> parallel: ...

0 comments on commit 987f400

Please sign in to comment.