-
Notifications
You must be signed in to change notification settings - Fork 58
feat: Update client side 'enhanced' meshing workflow to use server side 'meshing_workflow' root. #4600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
prmukherj
merged 29 commits into
main
from
feat/update_enhanced_meshing_workflow_to_use_meshing_workflow
Dec 17, 2025
Merged
feat: Update client side 'enhanced' meshing workflow to use server side 'meshing_workflow' root. #4600
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
210a1af
feat: Update client side 'enhanced' meshing workflow to use server si…
prmukherj 101d833
chore: adding changelog file 4600.added.md [dependabot-skip]
pyansys-ci-bot 72bc722
Add test for renaming, deletion and insertion.
prmukherj fe3cc4a
Added the update workflow file.
prmukherj 9a33809
Update Meshing workflow.
prmukherj 74a5b01
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj 00f9b29
Merge branch 'feat/update_enhanced_meshing_workflow_to_use_meshing_wo…
prmukherj dbca074
Update
prmukherj f4a922e
Updates.
prmukherj a02a71d
Updated behaviour.
prmukherj 7f930a5
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj 5774525
Monkey patch environment variable.
prmukherj efcfa19
Update generated task names.
prmukherj 2729cfe
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj fff3e77
Added docstrings.
prmukherj dc05be2
Added docstrings.
prmukherj 29780fb
Updates.
prmukherj 4e876b0
Pass down meshing root from the top level.
prmukherj d96526f
Fixes.
prmukherj b787792
Remove unnecessary comments.
prmukherj 1672f12
Minor updates.
prmukherj dcff47f
Minor updates.
prmukherj 3935020
Minor updates.
prmukherj 9919d07
Minor updates.
prmukherj 5ae4d88
Refactor.
prmukherj 51b7d6c
Have inline comments.
prmukherj bb9ece0
Rename _task_list.
prmukherj 1a63519
Mark workflow tests as nightly.
prmukherj 42eb0eb
Refactor and clean up.
prmukherj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Update client side 'enhanced' meshing workflow to use server side 'meshing_workflow' root. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,321 @@ | ||
| # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. | ||
| # SPDX-License-Identifier: MIT | ||
| # | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the "Software"), to deal | ||
| # in the Software without restriction, including without limitation the rights | ||
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
| # | ||
| # The above copyright notice and this permission notice shall be included in all | ||
| # copies or substantial portions of the Software. | ||
| # | ||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| # SOFTWARE. | ||
|
|
||
| """Meshing workflow specialization of the Workflow module that wraps and extends the | ||
| core functionality.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from enum import Enum | ||
| import os | ||
|
|
||
| from ansys.fluent.core._types import PathType | ||
| from ansys.fluent.core.services.datamodel_se import PyMenuGeneric | ||
| from ansys.fluent.core.utils.fluent_version import FluentVersion | ||
| from ansys.fluent.core.workflow_new import Workflow | ||
|
|
||
| name_to_identifier_map = { | ||
| "Watertight Geometry": "EnableCleanCAD", | ||
| "Fault-tolerant Meshing": "EnableComplexMeshing", | ||
| "2D Meshing": "EnablePrime2dMeshing", | ||
| "Topology Based Meshing": "EnablePrimeMeshing", | ||
| } | ||
|
|
||
|
|
||
| class MeshingWorkflow(Workflow): | ||
| """Provides meshing specialization of the workflow wrapper that extends the core | ||
| functionality in an object-oriented manner.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| name: str, | ||
| identifier: str, | ||
| fluent_version: FluentVersion, | ||
| initialize: bool = True, | ||
| ) -> None: | ||
| """Initialize MeshingWorkflow. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| name: str | ||
| Workflow name to initialize it. | ||
| identifier: str | ||
| Workflow name to identify it from global settings. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| initialize: bool | ||
| Flag to initialize the workflow, defaults to True. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, command_source=meshing, fluent_version=fluent_version | ||
| ) | ||
| self._meshing = meshing | ||
| self._name = name | ||
| self._identifier = identifier | ||
| if initialize: | ||
| self._new_workflow(name=self._name) | ||
| else: | ||
| self._activate_dynamic_interface(dynamic_interface=True) | ||
| self._initialized = True | ||
|
|
||
|
|
||
| class WatertightMeshingWorkflow(MeshingWorkflow): | ||
| """Provides watertight meshing specialization of the workflow wrapper.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| fluent_version: FluentVersion, | ||
| initialize: bool = True, | ||
| ) -> None: | ||
| """Initialize WatertightMeshingWorkflow. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| initialize: bool | ||
| Flag to initialize the workflow, defaults to True. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, | ||
| meshing=meshing, | ||
| name="Watertight Geometry", | ||
| identifier=name_to_identifier_map["Watertight Geometry"], | ||
| fluent_version=fluent_version, | ||
| initialize=initialize, | ||
| ) | ||
|
|
||
|
|
||
| class FaultTolerantMeshingWorkflow(MeshingWorkflow): | ||
| """Provides fault-tolerant meshing specialization of the workflow wrapper.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| part_management: PyMenuGeneric, | ||
| pm_file_management: PyMenuGeneric, | ||
| fluent_version: FluentVersion, | ||
| initialize: bool = True, | ||
| ) -> None: | ||
| """Initialize FaultTolerantMeshingWorkflow. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| part_management : PyMenuGeneric | ||
| Part management object. | ||
| pm_file_management : PyMenuGeneric | ||
| File management object in the part management object. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| initialize: bool | ||
| Flag to initialize the workflow, defaults to True. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, | ||
| meshing=meshing, | ||
| name="Fault-tolerant Meshing", | ||
| identifier=name_to_identifier_map["Fault-tolerant Meshing"], | ||
| fluent_version=fluent_version, | ||
| initialize=initialize, | ||
| ) | ||
| self._part_management = part_management | ||
| self._pm_file_management = pm_file_management | ||
|
|
||
| @property | ||
| def part_management(self) -> PyMenuGeneric | None: | ||
| """Access part-management in fault-tolerant mode. | ||
|
|
||
| Returns | ||
| ------- | ||
| PyMenuGeneric | None | ||
| Part-management. | ||
| """ | ||
| return self._part_management | ||
|
|
||
| @property | ||
| def pm_file_management(self): | ||
| """Access the part-management file-management object in fault-tolerant mode. | ||
|
|
||
| Returns | ||
| ------- | ||
| PyMenuGeneric | None | ||
| File management object in the part management object. | ||
| """ | ||
| return self._pm_file_management | ||
|
|
||
|
|
||
| class TwoDimensionalMeshingWorkflow(MeshingWorkflow): | ||
| """Provides 2D meshing specialization of the workflow wrapper.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| fluent_version: FluentVersion, | ||
| initialize: bool = True, | ||
| ) -> None: | ||
| """Initialize TwoDimensionalMeshingWorkflow. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| initialize: bool | ||
| Flag to initialize the workflow, defaults to True. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, | ||
| meshing=meshing, | ||
| name="2D Meshing", | ||
| identifier=name_to_identifier_map["2D Meshing"], | ||
| fluent_version=fluent_version, | ||
| initialize=initialize, | ||
| ) | ||
|
|
||
|
|
||
| class TopologyBasedMeshingWorkflow(MeshingWorkflow): | ||
| """Provides topology-based meshing specialization of the workflow wrapper.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| fluent_version: FluentVersion, | ||
| initialize: bool = True, | ||
| ) -> None: | ||
| """Initialize TopologyBasedMeshingWorkflow. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| initialize: bool | ||
| Flag to initialize the workflow, defaults to True. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, | ||
| meshing=meshing, | ||
| name="Topology Based Meshing", | ||
| identifier=name_to_identifier_map["Topology Based Meshing"], | ||
| fluent_version=fluent_version, | ||
| initialize=initialize, | ||
| ) | ||
|
|
||
|
|
||
| class WorkflowMode(Enum): | ||
| """Provides an enum of supported Fluent meshing workflow modes.""" | ||
|
|
||
| WATERTIGHT_MESHING_MODE = WatertightMeshingWorkflow | ||
| FAULT_TOLERANT_MESHING_MODE = FaultTolerantMeshingWorkflow | ||
| TWO_DIMENSIONAL_MESHING_MODE = TwoDimensionalMeshingWorkflow | ||
| TOPOLOGY_BASED_MESHING_MODE = TopologyBasedMeshingWorkflow | ||
|
|
||
|
|
||
| class LoadWorkflow(Workflow): | ||
| """Provides a specialization of the workflow wrapper for a loaded workflow.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| file_path: PathType, | ||
| fluent_version: FluentVersion, | ||
| ) -> None: | ||
| """Initialize a ``LoadWorkflow`` instance. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| file_path: os.PathLike[str | bytes] | str | bytes | ||
| Path to the saved workflow file. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, command_source=meshing, fluent_version=fluent_version | ||
| ) | ||
| self._meshing = meshing | ||
| self._unsubscribe_root_affected_callback() | ||
prmukherj marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| self._load_workflow(file_path=os.fspath(file_path)) | ||
|
|
||
|
|
||
| class CreateWorkflow(Workflow): | ||
| """Provides a specialization of the workflow wrapper for a newly created | ||
| workflow.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| workflow: PyMenuGeneric, | ||
| meshing: PyMenuGeneric, | ||
| fluent_version: FluentVersion, | ||
| initialize: bool = True, | ||
| ) -> None: | ||
| """Initialize a ``CreateWorkflow`` instance. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| workflow : PyMenuGeneric | ||
| Underlying workflow object. | ||
| meshing : PyMenuGeneric | ||
| Meshing object. | ||
| fluent_version: FluentVersion | ||
| Version of Fluent in this session. | ||
| initialize: bool | ||
| Flag to initialize the workflow, defaults to True. | ||
| """ | ||
| super().__init__( | ||
| workflow=workflow, command_source=meshing, fluent_version=fluent_version | ||
| ) | ||
| self._meshing = meshing | ||
| self._unsubscribe_root_affected_callback() | ||
prmukherj marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if initialize: | ||
| self._create_workflow() | ||
| else: | ||
| self._activate_dynamic_interface(dynamic_interface=True) | ||
prmukherj marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.