search#

Module for searching for a word through CFX’s object hierarchy.

Functions:

get_api_tree_file_name(version, pycfx_path)

Get the API tree file name.

search(word[, match_whole_word, match_case, ...])

Search for a word through the CFX's object hierarchy.

ansys.cfx.core.utils.search.get_api_tree_file_name(version: str, pycfx_path: str) Path#

Get the API tree file name.

ansys.cfx.core.utils.search.search(word: str, match_whole_word: bool = False, match_case: bool = False, version: str | None = None, search_root: Any | None = None)#

Search for a word through the CFX’s object hierarchy.

Parameters:
wordstr

Word to search for.

match_whole_wordbool, default: False

Whether to match the whole word.

match_casebool, default: False

Whether to match the case.

versionstr, default: None

CFX version to search in. The default is None, in which case it searches in the latest version for which codegen was run.

search_rootAny, default: None

Root object to perform the search in. It can be a session object or any API object within a session. The default is None, in which case everything is searched.

Examples

>>> import ansys.cfx.core as pycfx
>>> pycfx.search("injection_region")
<pre_processing_session>.setup.flow["<name>"].domain["<name>"].particle_injection_region["<name>"] (Object)
<pre_processing_session>.setup.flow["<name>"].domain["<name>"].injection_region["<name>"] (Object)
<pre_processing_session>.setup.flow["<name>"].domain["<name>"].injection_region["<name>"].injection_region_type (Parameter)
<pre_processing_session>.setup.flow["<name>"].domain["<name>"].injection_region["<name>"].injection_region_contour (Object)
<pre_processing_session>.setup.flow["<name>"].domain["<name>"].injection_region["<name>"].injection_region_vector (Object)
<pre_processing_session>.setup.flow["<name>"].output_control.transient_particle_diagnostics["<name>"].penetration_origin_and_direction.particle_injection_region (Parameter)
<post_processing_session>.results.internal_particle_injection_region["<name>"] (Object)
<post_processing_session>.results.injection_region["<name>"] (Object)