Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 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 Nov 12, 2025
101d833
chore: adding changelog file 4600.added.md [dependabot-skip]
pyansys-ci-bot Nov 12, 2025
72bc722
Add test for renaming, deletion and insertion.
prmukherj Nov 12, 2025
fe3cc4a
Added the update workflow file.
prmukherj Nov 17, 2025
9a33809
Update Meshing workflow.
prmukherj Nov 21, 2025
74a5b01
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj Nov 26, 2025
00f9b29
Merge branch 'feat/update_enhanced_meshing_workflow_to_use_meshing_wo…
prmukherj Nov 26, 2025
dbca074
Update
prmukherj Nov 28, 2025
f4a922e
Updates.
prmukherj Nov 28, 2025
a02a71d
Updated behaviour.
prmukherj Dec 10, 2025
7f930a5
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj Dec 10, 2025
5774525
Monkey patch environment variable.
prmukherj Dec 10, 2025
efcfa19
Update generated task names.
prmukherj Dec 16, 2025
2729cfe
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj Dec 16, 2025
fff3e77
Added docstrings.
prmukherj Dec 16, 2025
dc05be2
Added docstrings.
prmukherj Dec 16, 2025
29780fb
Updates.
prmukherj Dec 16, 2025
4e876b0
Pass down meshing root from the top level.
prmukherj Dec 17, 2025
d96526f
Fixes.
prmukherj Dec 17, 2025
b787792
Remove unnecessary comments.
prmukherj Dec 17, 2025
1672f12
Minor updates.
prmukherj Dec 17, 2025
dcff47f
Minor updates.
prmukherj Dec 17, 2025
3935020
Minor updates.
prmukherj Dec 17, 2025
9919d07
Minor updates.
prmukherj Dec 17, 2025
5ae4d88
Refactor.
prmukherj Dec 17, 2025
51b7d6c
Have inline comments.
prmukherj Dec 17, 2025
bb9ece0
Rename _task_list.
prmukherj Dec 17, 2025
1a63519
Mark workflow tests as nightly.
prmukherj Dec 17, 2025
42eb0eb
Refactor and clean up.
prmukherj Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4600.added.md
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.
39 changes: 26 additions & 13 deletions src/ansys/fluent/core/meshing/meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
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 import Workflow

name_to_identifier_map = {
"Watertight Geometry": "EnableCleanCAD",
Expand All @@ -41,7 +40,19 @@
}


class MeshingWorkflow(Workflow):
def resolve_workflow_base():
"""Resolve the base workflow based on environment variable."""
if os.getenv("USE_SERVER_MW") == "1":
from ansys.fluent.core.workflow_new import Workflow
else:
from ansys.fluent.core.workflow import Workflow
return Workflow


WorkflowBase = resolve_workflow_base()


class MeshingWorkflow(WorkflowBase):
"""Provides meshing specialization of the workflow wrapper that extends the core
functionality in an object-oriented manner."""

Expand Down Expand Up @@ -77,22 +88,24 @@ def __init__(
self._meshing = meshing
self._name = name
self._identifier = identifier
self._unsubscribe_root_affected_callback()
if os.getenv("USE_SERVER_MW") != "1":
self._unsubscribe_root_affected_callback()
if initialize:
self._new_workflow(name=self._name)
else:
self._activate_dynamic_interface(dynamic_interface=True)
self._initialized = True

def __getattribute__(self, item: str):
if (
not item.startswith("_")
and super().__getattribute__("_initialized")
and not getattr(self._meshing.GlobalSettings, self._identifier)()
):
raise RuntimeError(
f"'{self._name}' objects are inaccessible from other workflows."
)
if os.getenv("USE_SERVER_MW") != "1":
if (
not item.startswith("_")
and super().__getattribute__("_initialized")
and not getattr(self._meshing.GlobalSettings, self._identifier)()
):
raise RuntimeError(
f"'{self._name}' objects are inaccessible from other workflows."
)
return super().__getattribute__(item)


Expand Down Expand Up @@ -267,7 +280,7 @@ class WorkflowMode(Enum):
TOPOLOGY_BASED_MESHING_MODE = TopologyBasedMeshingWorkflow


class LoadWorkflow(Workflow):
class LoadWorkflow(WorkflowBase):
"""Provides a specialization of the workflow wrapper for a loaded workflow."""

def __init__(
Expand Down Expand Up @@ -298,7 +311,7 @@ def __init__(
self._load_workflow(file_path=os.fspath(file_path))


class CreateWorkflow(Workflow):
class CreateWorkflow(WorkflowBase):
"""Provides a specialization of the workflow wrapper for a newly created
workflow."""

Expand Down
30 changes: 24 additions & 6 deletions src/ansys/fluent/core/session_base_meshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ def meshing_workflow(self):

def watertight_workflow(self, initialize: bool = True):
"""Datamodel root of workflow."""
root_module = (
"meshing_workflow" if os.getenv("USE_SERVER_MW") == "1" else "workflow"
)
self._current_workflow = WorkflowMode.WATERTIGHT_MESHING_MODE.value(
_make_datamodel_module(self, "workflow"),
_make_datamodel_module(self, root_module),
self.meshing,
self.get_fluent_version(),
initialize,
Expand All @@ -148,8 +151,11 @@ def watertight_workflow(self, initialize: bool = True):

def fault_tolerant_workflow(self, initialize: bool = True):
"""Datamodel root of workflow."""
root_module = (
"meshing_workflow" if os.getenv("USE_SERVER_MW") == "1" else "workflow"
)
self._current_workflow = WorkflowMode.FAULT_TOLERANT_MESHING_MODE.value(
_make_datamodel_module(self, "workflow"),
_make_datamodel_module(self, root_module),
self.meshing,
self.PartManagement,
self.PMFileManagement,
Expand All @@ -160,8 +166,11 @@ def fault_tolerant_workflow(self, initialize: bool = True):

def two_dimensional_meshing_workflow(self, initialize: bool = True):
"""Data model root of the workflow."""
root_module = (
"meshing_workflow" if os.getenv("USE_SERVER_MW") == "1" else "workflow"
)
self._current_workflow = WorkflowMode.TWO_DIMENSIONAL_MESHING_MODE.value(
_make_datamodel_module(self, "workflow"),
_make_datamodel_module(self, root_module),
self.meshing,
self.get_fluent_version(),
initialize,
Expand All @@ -170,8 +179,11 @@ def two_dimensional_meshing_workflow(self, initialize: bool = True):

def topology_based_meshing_workflow(self, initialize: bool = True):
"""Datamodel root of workflow."""
root_module = (
"meshing_workflow" if os.getenv("USE_SERVER_MW") == "1" else "workflow"
)
self._current_workflow = WorkflowMode.TOPOLOGY_BASED_MESHING_MODE.value(
_make_datamodel_module(self, "workflow"),
_make_datamodel_module(self, root_module),
self.meshing,
self.get_fluent_version(),
initialize,
Expand All @@ -180,8 +192,11 @@ def topology_based_meshing_workflow(self, initialize: bool = True):

def load_workflow(self, file_path: PathType):
"""Datamodel root of workflow."""
root_module = (
"meshing_workflow" if os.getenv("USE_SERVER_MW") == "1" else "workflow"
)
self._current_workflow = LoadWorkflow(
_make_datamodel_module(self, "workflow"),
_make_datamodel_module(self, root_module),
self.meshing,
os.fspath(file_path),
self.get_fluent_version(),
Expand All @@ -190,8 +205,11 @@ def load_workflow(self, file_path: PathType):

def create_workflow(self, initialize: bool = True):
"""Datamodel root of the workflow."""
root_module = (
"meshing_workflow" if os.getenv("USE_SERVER_MW") == "1" else "workflow"
)
self._current_workflow = CreateWorkflow(
_make_datamodel_module(self, "workflow"),
_make_datamodel_module(self, root_module),
self.meshing,
self.get_fluent_version(),
initialize,
Expand Down
Loading
Loading