SolveCompositeBackend#

class ansys.fluent.mcp.solve.backends.composite.SolveCompositeBackend(*, label: str = 'Solve (PyFluent)')#

Bases: ansys.fluent.mcp.common.backend.Backend

Composite backend that delegates deterministic operations to PyFluent.

  • Execution & live context are always handled by an in-process PyFluentBackend.

Overview#

connect

Connect to the configured backend or service.

disconnect

Close resources for the SolveCompositeBackend object.

is_connected

Return whether connected.

close_sync

Best-effort synchronous cleanup for shutdown.

status

Return backend status information.

list_named_objects

List named objects entries.

get_named_object_names

Return the named object names.

find_named_object

Find named object entries.

get_state

Return the state.

get_active_status

Return the active status.

get_allowed_values

Return the allowed values.

get_targeted_context

Return the targeted context.

get_help

Return the help.

probe_path

Return the {exists, is_active, is_user_creatable, kind} envelope.

describe_named_object_template

Describe the child field shape of a NamedObject collection.

get_command_arguments

Return the keyword-argument signature of a command path.

list_fields

Enumerate solver field / variable names for reports & post.

mesh_adjacency_probe

Return {cellzone -> [adjacent_face_zone_names]} from PyFluent.

solver_status

Return solver status information from the backend.

mesh_counts

Return mesh entity counts.

mesh_quality

Return mesh quality information from the backend.

mesh_check

Run the backend mesh check operation.

run_code

Execute Python code through the backend runtime.

validate_code

Validate code.

screenshot

Capture a screenshot from the backend runtime.

invalidate_cache

Clear cached backend state.

invalidate_live_caches

Clear cached live backend state.

invalidate_mesh_cache

Clear mesh-probe caches on the composite and inner backend.

endpoint

Return the backend endpoint description.

Import detail#

from ansys.fluent.mcp.solve.backends.composite import SolveCompositeBackend

Property detail#

property SolveCompositeBackend.endpoint: str | None#

Return the backend endpoint description.

Returns:
Optional[str]

Optional value produced by the operation.

Attribute detail#

SolveCompositeBackend.kind = 'pyfluent'#
SolveCompositeBackend.label = 'Solve (PyFluent)'#

Method detail#

async SolveCompositeBackend.connect(*, ip: str | None = None, port: int | None = None, password: str | None = None, server_info_file: str | None = None, precision: str = 'double', processor_count: int = 1, ui_mode: str = 'gui', product_version: str | None = None, **_: Any) ansys.fluent.mcp.common.models.ConnectResult#

Connect to the configured backend or service.

Parameters:
ipOptional[str]

IP address of the Fluent server to connect to.

portOptional[int]

Port number of the Fluent server to connect to.

passwordOptional[str]

Password used when connecting to a Fluent server.

server_info_fileOptional[str]

Server-info file used to connect to an existing Fluent session.

precisionstr

Solver precision requested for the Fluent session.

processor_countint

Number of processors requested for the Fluent session.

ui_modestr

Fluent UI mode requested for launch.

product_versionOptional[str]

Fluent product version requested for launch.

_Any

Ignored compatibility options accepted by the backend interface.

Returns:
ConnectResult

ConnectResult produced by the operation.

async SolveCompositeBackend.disconnect() None#

Close resources for the SolveCompositeBackend object.

Returns:
None

The function completes through its side effects.

SolveCompositeBackend.is_connected() bool#

Return whether connected.

Returns:
bool

Boolean result of the operation.

SolveCompositeBackend.close_sync() None#

Best-effort synchronous cleanup for shutdown.

Returns:
None

The function completes through its side effects.

SolveCompositeBackend.status(leaf: str) ansys.fluent.mcp.common.models.SessionStatus#

Return backend status information.

Parameters:
leafstr

Leaf MCP server instance under test.

Returns:
SessionStatus

SessionStatus produced by the operation.

async SolveCompositeBackend.list_named_objects() dict[str, Any]#

List named objects entries.

Returns:
dict[str, Any]

Mapping containing the operation result.

async SolveCompositeBackend.get_named_object_names(collection_path: str) list[str]#

Return the named object names.

Parameters:
collection_pathstr

Path for the collection.

Returns:
list[str]

List of results produced by the operation.

async SolveCompositeBackend.find_named_object(name: str) list[dict[str, Any]]#

Find named object entries.

Parameters:
namestr

Name of the object, module, or setting being processed.

Returns:
list[dict[str, Any]]

List of results produced by the operation.

async SolveCompositeBackend.get_state(paths: list[str] | None = None) dict[str, Any]#

Return the state.

Parameters:
pathslist[str] | None

Fluent object paths supplied to the operation.

Returns:
dict[str, Any]

Mapping containing the operation result.

async SolveCompositeBackend.get_active_status(paths: list[str]) dict[str, bool]#

Return the active status.

Parameters:
pathslist[str]

Fluent object paths supplied to the operation.

Returns:
dict[str, bool]

Mapping containing the operation result.

async SolveCompositeBackend.get_allowed_values(paths: list[str]) dict[str, list[Any]]#

Return the allowed values.

Parameters:
pathslist[str]

Fluent object paths supplied to the operation.

Returns:
dict[str, list[Any]]

Mapping containing the operation result.

async SolveCompositeBackend.get_targeted_context(*, paths_to_check: list[str], named_object_types: list[str] | None = None, instance_state_fetch: list[str] | None = None) dict[str, Any]#

Return the targeted context.

Parameters:
paths_to_checklist[str]

Fluent object paths to validate or inspect.

named_object_typeslist[str] | None

Named-object families that should be considered during lookup.

instance_state_fetchlist[str] | None

Whether named-object instance state should be fetched.

Returns:
dict[str, Any]

Mapping containing the operation result.

async SolveCompositeBackend.get_help(path: str) dict[str, Any]#

Return the help.

Parameters:
pathstr

Filesystem path or API path to process.

Returns:
dict[str, Any]

Mapping containing the operation result.

async SolveCompositeBackend.probe_path(paths: list[str]) dict[str, dict[str, Any]]#

Return the {exists, is_active, is_user_creatable, kind} envelope.

Delegates to PyFluent so the executor / validator can pre-flight a batch of mutating writes against the same live session that will run them. The base Backend raises BackendUnavailableError; without this delegation the probe_path / describe_path tools are dead.

Parameters:
pathslist[str]

Fluent object paths to pre-flight.

Returns:
dict[str, dict[str, Any]]

Mapping of path to its probe envelope.

async SolveCompositeBackend.describe_named_object_template(path: str) dict[str, Any] | None#

Describe the child field shape of a NamedObject collection.

Delegates to PyFluent’s static-settings-class walk. The base Backend returns None (rendering template: null); this delegation surfaces the real per-field template.

Parameters:
pathstr

NamedObject collection path to inspect.

Returns:
dict[str, Any] | None

Template mapping, or None when the path is not a NamedObject collection.

async SolveCompositeBackend.get_command_arguments(path: str) dict[str, Any] | None#

Return the keyword-argument signature of a command path.

Delegates to PyFluent so describe_path can fuse the create-command signature into its unified descriptor.

Parameters:
pathstr

Command path to introspect.

Returns:
dict[str, Any] | None

Argument signature, or None when the path is not a command.

async SolveCompositeBackend.list_fields(*, scope: str = 'any') dict[str, Any] | None#

Enumerate solver field / variable names for reports & post.

Delegates to PyFluent; the base Backend returns None and would otherwise strand the list_fields tool and any report-def / graphics recipe that validates a field argument against it.

Parameters:
scopestr

Field-info scope hint ("any", "cell", "node", "surface").

Returns:
dict[str, Any] | None

Mapping containing the available field names, or None.

async SolveCompositeBackend.mesh_adjacency_probe(cellzones: list[str], *, bc_filter: tuple[str, Ellipsis] | None = None) dict[str, list[str]]#

Return {cellzone -> [adjacent_face_zone_names]} from PyFluent.

async SolveCompositeBackend.solver_status() dict[str, Any]#

Return solver status information from the backend.

Returns:
dict[str, Any]

Mapping containing the operation result.

async SolveCompositeBackend.mesh_counts() dict[str, int | None]#

Return mesh entity counts.

Returns:
dict[str, int | None]

Mapping containing the operation result.

async SolveCompositeBackend.mesh_quality() dict[str, float | None]#

Return mesh quality information from the backend.

Returns:
dict[str, float | None]

Mapping containing the operation result.

async SolveCompositeBackend.mesh_check() dict[str, Any]#

Run the backend mesh check operation.

Returns:
dict[str, Any]

Mapping containing the operation result.

async SolveCompositeBackend.run_code(code: str, *, namespace: dict[str, Any] | None = None, filename: str = '') ansys.fluent.mcp.common.models.RunCodeResult#

Execute Python code through the backend runtime.

Parameters:
codestr

Python code or command text to execute or validate.

namespacedict[str, Any] | None

Namespace used to resolve the backend object or route.

filenamestr

File name or path used by the backend operation.

Returns:
RunCodeResult

RunCodeResult produced by the operation.

async SolveCompositeBackend.validate_code(code: str) ansys.fluent.mcp.common.models.RunCodeResult#

Validate code.

Parameters:
codestr

Python code or command text to execute or validate.

Returns:
RunCodeResult

RunCodeResult produced by the operation.

async SolveCompositeBackend.screenshot(*, view: str | None = None) dict[str, Any]#

Capture a screenshot from the backend runtime.

Parameters:
viewOptional[str]

Graphics view or camera preset requested by the caller.

Returns:
dict[str, Any]

Mapping containing the operation result.

SolveCompositeBackend.invalidate_cache() None#

Clear cached backend state.

Returns:
None

The function completes through its side effects.

SolveCompositeBackend.invalidate_live_caches() None#

Clear cached live backend state.

Returns:
None

The function completes through its side effects.

SolveCompositeBackend.invalidate_mesh_cache() None#

Clear mesh-probe caches on the composite and inner backend.

Returns:
None

The function completes through its side effects.