scheme_eval#
Wrappers over SchemeEval gRPC service of Fluent.
Example#
>>> from ansys.fluent.core.services.scheme_eval import Symbol as S
>>> session.scheme_eval.eval([S('+'), 2, 3])
5
>>> session.scheme_eval.eval([S('rpgetvar'), [S('string->symbol'), "mom/relax"]])
0.7
>>> session.scheme_eval.exec(('(ti-menu-load-string "/report/system/proc-stats")',))
>>> # Returns TUI output string
>>> session.scheme_eval.string_eval("(+ 2 3)")
'5'
>>> session.scheme_eval.string_eval("(rpgetvar 'mom/relax)")
'0.7'
>>> session.scheme_eval.scheme_eval("(+ 2 3)")
5
>>> session.scheme_eval.scheme_eval("(rpgetvar 'mom/relax)")
0.7
Classes:
|
Class on which Fluent's scheme code can be executed. |
|
Class wrapping the SchemeEval gRPC service of Fluent. |
|
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
eval(val)
Evaluates a scheme expression, returns Python value
exec(commands, wait, silent)
Executes a sequence of scheme commands, returns TUI output string
string_eval(input)
Evaluates a scheme expression in string format, returns string
scheme_eval(input)
Evaluates a scheme expression in string format, returns Python value
Methods:
__init__
(service)__init__ method of SchemeEval class.
eval
(val)Evaluates a scheme expression.
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
(input)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(val)#
Evaluates a scheme expression.
- Parameters:
- val
Any
Input scheme expression represented as Python datatype
- val
- Returns:
Any
Output scheme value represented as Python datatype
- exec(commands, wait=True, silent=True)#
Executes a sequence of scheme commands.
- is_defined(symbol)#
Check if a symbol is defined in the scheme environment.
- 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)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)#
SchemeEval RPC of SchemeEval service.
- string_eval(request)#
StringEval RPC of SchemeEval service.