base_meshing#

Internal base class for all meshing sessions.

This module is private. Do not import from it directly; use PureMeshing or Meshing instead.

Both leaf classes are lightweight and add no further public API beyond what is defined here. PureMeshing targets deployments where meshing and solving run as separate processes; Meshing additionally exposes switch_to_solver().

Classes:

BaseMeshing(fluent_connection, scheme_eval)

Base class providing the full public API for all meshing sessions.

class ansys.fluent.core.meshing.session.base_meshing.BaseMeshing(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#

Bases: BaseSession

Base class providing the full public API for all meshing sessions.

Both PureMeshing and Meshing inherit from this class and add no further public methods.

Attributes:

PMFileManagement

Datamodel root of PMFileManagement.

PartManagement

Datamodel root of PartManagement.

current_workflow

Get the currently active meshing workflow.

legacy_current_workflow

Get the currently active meshing workflow using the legacy implementation.

meshing

Meshing object.

meshing_utilities

A wrapper over Fluent's meshing queries.

meshing_workflow

Full API to meshing and meshing_workflow.

preferences

Datamodel root of preferences.

tui

Instance of main_menu on which Fluent's SolverTUI methods can be executed.

workflow

Datamodel root of workflow.

Methods:

__init__(fluent_connection, scheme_eval[, ...])

BaseMeshing session.

__new__(cls, *args, **kwargs)

create_workflow([legacy, initialize])

Create a new blank meshing workflow for manual task configuration.

fault_tolerant([legacy])

Get the fault-tolerant meshing workflow.

load_workflow(file_path[, legacy, initialize])

Load a previously saved meshing workflow from file.

topology_based([legacy])

Get the topology-based meshing workflow (beta feature).

transfer_mesh_to_solvers(solvers[, ...])

Transfer mesh to Fluent solver instances.

two_dimensional_meshing([legacy])

Get the 2D meshing workflow.

watertight([legacy])

Get the watertight meshing workflow.

property PMFileManagement: Root#

Datamodel root of PMFileManagement.

See the PMFileManagement datamodel for the complete hierarchy of objects and operations.

property PartManagement: Root#

Datamodel root of PartManagement.

See the PartManagement datamodel for its complete hierarchy of objects and operations.

__init__(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#

BaseMeshing session.

Parameters:
fluent_connectionFluentConnection

Encapsulates a FluentConnection.

scheme_eval: SchemeInterpreter

Instance of SchemeInterpreter to execute Fluent’s scheme code on.

file_transfer_serviceOptional

Service for uploading and downloading files.

start_transcriptbool, optional

Whether to start the Fluent transcript in the client. The default is True, in which case the Fluent transcript can be subsequently started and stopped using method calls on the Session object.

static __new__(cls, *args, **kwargs)#
create_workflow(legacy=None, initialize=True)#

Create a new blank meshing workflow for manual task configuration.

Provides an empty workflow to build custom task sequences from scratch.

Parameters:
initialize: bool, optional

If True (default), initializes the workflow with default settings and prepares it for immediate use. If False, creates the workflow without initialization, useful when loading a saved state or applying custom configuration before starting.

legacybool, optional

If True, creates the legacy PyFluent-native interface. If False, creates the PyFluent-native interface. If None (default), uses the legacy PyFluent-native interface for Fluent versions up to 25R2 and uses the PyFluent-native interface for later versions (since 26R1).

Returns:
CreateMeshingWorkflow

Newly created meshing workflow.

property current_workflow#

Get the currently active meshing workflow.

fault_tolerant(legacy=None)#

Get the fault-tolerant meshing workflow.

Parameters:
legacybool, optional

If True, returns the legacy PyFluent-native interface. If False, returns the PyFluent-native interface. If None (default), auto-selects based on Fluent version: legacy PyFluent-native for versions up to 25R2, PyFluent-native from 26R1 onwards.

Returns:
FaultTolerantMeshing

Fault-tolerant meshing workflow.

property legacy_current_workflow#

Get the currently active meshing workflow using the legacy implementation.

load_workflow(file_path, legacy=None, initialize=True)#

Load a previously saved meshing workflow from file.

Restores workflow configuration including tasks, settings, and state.

Parameters:
file_pathstr or PathType

Path to the saved workflow file (typically with .wft extension).

initialize: bool, optional

If True (default), initializes the workflow with default settings and prepares it for immediate use. If False, creates the workflow without initialization, useful when loading a saved state or applying custom configuration before starting.

legacybool, optional

If True, creates the legacy PyFluent-native interface. If False, creates the PyFluent-native interface. If None (default), uses the legacy PyFluent-native interface for Fluent versions up to 25R2 and uses the PyFluent-native interface for later versions (since 26R1).

Returns:
LoadMeshingWorkflow

Loaded meshing workflow.

property meshing: Root#

Meshing object.

See the meshing datamodel for the complete hierarchy of meshing objects and operations.

property meshing_utilities: Root#

A wrapper over Fluent’s meshing queries.

See the meshing utilities datamodel for the complete collection of available meshing operations.

property meshing_workflow: Root#

Full API to meshing and meshing_workflow.

See the meshing workflow datamodel for the complete hierarchy of workflow tasks and operations.

property preferences: Root#

Datamodel root of preferences.

See the preferences datamodel for the complete hierarchy of preference objects and operations.

topology_based(legacy=None)#

Get the topology-based meshing workflow (beta feature).

Parameters:
legacybool, optional

If True, returns the legacy PyFluent-native interface. If False, returns the PyFluent-native interface. If None (default), auto-selects based on Fluent version: legacy PyFluent-native for versions up to 25R2, PyFluent-native from 26R1 onwards.

Returns:
TopologyBasedMeshing

Topology-based meshing workflow.

Raises:
BetaFeaturesNotEnabled

If beta features are not enabled in the Fluent session.

transfer_mesh_to_solvers(solvers, file_type='case', file_name_stem=None, num_files_to_try=1, clean_up_mesh_file=True, overwrite_previous=True)#

Transfer mesh to Fluent solver instances.

Parameters:
solversiterable

Sequence of solver instances.

file_typestr, optional

"case" or "mesh". Default is "case".

file_name_stemstr, optional

Stem for the generated file name.

num_files_to_tryint, optional

Number of candidate file names to try. Default is 1.

clean_up_mesh_filebool, optional

Remove the mesh file after transfer. Default is True.

overwrite_previousbool, optional

Overwrite an existing file with the same name. Default is True.

property tui: main_menu#

Instance of main_menu on which Fluent’s SolverTUI methods can be executed. See the meshing TUI documentation for the complete hierarchy of menus, commands, and related TUI methods.

two_dimensional_meshing(legacy=None)#

Get the 2D meshing workflow.

Parameters:
legacybool, optional

If True, returns the legacy PyFluent-native interface. If False, returns the PyFluent-native interface. If None (default), auto-selects based on Fluent version: legacy PyFluent-native for versions up to 25R2, PyFluent-native from 26R1 onwards.

Returns:
TwoDimensionalMeshing

Two-dimensional meshing workflow.

watertight(legacy=None)#

Get the watertight meshing workflow.

Parameters:
legacybool, optional

If True, returns the legacy PyFluent-native interface. If False, returns the PyFluent-native interface. If None (default), auto-selects based on Fluent version: legacy PyFluent-native for versions up to 25R2, PyFluent-native from 26R1 onwards.

Returns:
WatertightMeshing

Watertight meshing workflow.

property workflow: Root#

Datamodel root of workflow.

See the workflow datamodel for the complete hierarchy of workflow objects and operations.