Skip to content

Commit

Permalink
fix: field_info for viz. (#3598)
Browse files Browse the repository at this point in the history
  • Loading branch information
prmukherj authored Jan 2, 2025
1 parent 7a8f248 commit 9bd6c18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/ansys/fluent/core/post_objects/post_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def remote_surface_name(self, local_surface_name):
# Following functions will be deprecated in future.
def get_vector_fields(self):
"""Returns vector field."""
return self.field_info.get_vector_fields_info()
return self.field_info().get_vector_fields_info()

def get_field_unit(self, field):
"""Returns the unit of the field."""
Expand All @@ -140,10 +140,8 @@ def get_field_unit(self, field):
scheme_eval_str = f"(units/get-pretty-wb-units-from-dimension (units/inquire-dimension '{quantity}))"
return " ".join(self._scheme_str_to_py_list(scheme_eval_str))
else:
fields_info = self.field_info.get_fields_info()
for field_info in fields_info:
if field_info["solverName"] == field:
return get_si_unit_for_fluent_quantity(field_info["quantity_name"])
fields_info = self.field_info().get_scalar_fields_info()
return get_si_unit_for_fluent_quantity(fields_info[field]["quantity_name"])

def _field_unit_quantity(self, field):
scheme_eval_str = f"(cdr (assq 'units (%fill-render-info '{field})))"
Expand Down
1 change: 1 addition & 0 deletions src/ansys/fluent/core/services/field_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def get_scalar_fields_info(self) -> Dict[str, Dict]:
"display_name": field_info.displayName,
"section": field_info.section,
"domain": field_info.domain,
"quantity_name": field_info.quantity_name,
}
for field_info in response.fieldInfo
}
Expand Down
1 change: 0 additions & 1 deletion src/ansys/fluent/core/session_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def _build_from_fluent_connection(
):
self._tui_service = self._datamodel_service_tui
self._se_service = self._datamodel_service_se
self._settings_service = self._settings_service
self._tui = None
self._workflow = None
self._system_coupling = None
Expand Down

0 comments on commit 9bd6c18

Please sign in to comment.