scheme_eval#

Wrappers over SchemeEval gRPC service of Fluent.

Example#

>>> session.scheme.exec(('(ti-menu-load-string "/report/system/proc-stats")',))
>>> # Returns TUI output string
>>> session.scheme.eval("(+ 2 3)")
5
>>> session.scheme.eval("(rpgetvar 'mom/relax)")
0.7

Classes:

SchemeEval(service)

Class on which Fluent's scheme code can be executed.

SchemeEvalService(channel, metadata, ...)

Class wrapping the SchemeEval gRPC service of Fluent.

Symbol(str)

Class representing the symbol datatype in Fluent.

class ansys.fluent.core.services.scheme_eval.SchemeEval(service)#

Bases: object

Class on which Fluent’s scheme code can be executed.

Methods

exec(commands, wait, silent)

Executes a sequence of scheme commands, returns TUI output string

eval(input)

Evaluates a scheme expression in string format, returns Python value

Methods:

__init__(service)

__init__ method of SchemeEval class.

eval(scm_input[, suppress_prompts])

Evaluates a scheme expression in string format.

exec(commands[, wait, silent])

Executes a sequence of scheme commands.

is_defined(symbol)

Check if a symbol is defined in the scheme environment.

scheme_eval(scm_input[, suppress_prompts])

Evaluates a scheme expression in string format.

string_eval(input)

Evaluates a scheme expression in string format.

__init__(service)#

__init__ method of SchemeEval class.

eval(scm_input, suppress_prompts=True)#

Evaluates a scheme expression in string format.

Parameters:
scm_inputstr

Input scheme expression in string format

suppress_promptsbool, optional

Whether to suppress prompts in Fluent, by default True

Returns:
Any

Output scheme value represented as Python datatype

exec(commands, wait=True, silent=True)#

Executes a sequence of scheme commands.

Parameters:
commandsSequence[str]

Sequence of scheme commands in string format

waitbool, optional

Specifies whether to wait until execution completes, by default True

silentbool, optional

Specifies whether to execute silently, by default True

Returns:
str

Output as string

is_defined(symbol)#

Check if a symbol is defined in the scheme environment.

Parameters:
symbolstr

Name of the symbol

Returns:
bool

True if symbol is defined, False otherwise

scheme_eval(scm_input, suppress_prompts=True)#

Evaluates a scheme expression in string format.

Deprecated since version 0.32: Use session.scheme.

string_eval(input)#

Evaluates a scheme expression in string format.

Parameters:
inputstr

Input scheme expression in string format

Returns:
str

Output scheme value in string format

class ansys.fluent.core.services.scheme_eval.SchemeEvalService(channel, metadata, fluent_error_state)#

Bases: object

Class wrapping the SchemeEval gRPC service of Fluent.

Using the methods from the SchemeEval class is recommended.

Methods:

__init__(channel, metadata, fluent_error_state)

__init__ method of SchemeEvalService class.

eval(request)

Eval RPC of SchemeEval service.

exec(request)

Exec RPC of SchemeEval service.

scheme_eval(request[, metadata])

SchemeEval RPC of SchemeEval service.

string_eval(request)

StringEval RPC of SchemeEval service.

__init__(channel, metadata, fluent_error_state)#

__init__ method of SchemeEvalService class.

eval(request)#

Eval RPC of SchemeEval service.

exec(request)#

Exec RPC of SchemeEval service.

scheme_eval(request, metadata=None)#

SchemeEval RPC of SchemeEval service.

string_eval(request)#

StringEval RPC of SchemeEval service.

class ansys.fluent.core.services.scheme_eval.Symbol(str)#

Bases: object

Class representing the symbol datatype in Fluent.

Attributes:
strstr

Underlying string representation

Methods:

__init__(str)

__init__ method of Symbol class.

__init__(str)#

__init__ method of Symbol class.