Skip to content

Conversation

mkundu1
Copy link
Contributor

@mkundu1 mkundu1 commented Jun 15, 2022

An example of dynamic menu is the adjoint/observable menu in Fluent. During the static class generation in codegen, it doesn't have any child, so a bound method is generated for it. During runtime, new child menus (like create, edit) are added at adjoint/observable level in Fluent. Earlier the only way to execute /adjoint/observable/create in Fluent was to pass the child menu create as argument of adjoint.observbale method from PyFluent, i.e. session.solver.tui.adjoint.observable("create", '"<type>"', '"<name>"').

In this PR, dynamic menus are identified in Fluent and corresponding objects of generic type inserted in PyFluent at runtime:

>>> session.solver.tui.adjoint # object of explicit type encoded during codegen
<ansys.fluent.core.solver.tui.main_menu.adjoint object at 0x000002B468FF08B0>
>>> session.solver.tui.adjoint.observable # object of generic type created at runtime
<ansys.fluent.core.services.datamodel_tui.TUIMenuGeneric object at 0x000002B468FF0640>
>>> session.solver.tui.adjoint.observable.create('"<type>"', '"<name>"')

@mkundu1 mkundu1 linked an issue Jun 15, 2022 that may be closed by this pull request
@mkundu1 mkundu1 merged commit 88a7912 into main Jun 21, 2022
@mkundu1 mkundu1 deleted the feat/dynamic-menus branch June 21, 2022 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adjoint/observable menus are not available

3 participants