Skip to content

Commit

Permalink
reverting to original implementation (#4103)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnetake authored Jan 19, 2024
1 parent 7f7bace commit 4e7e35f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pyaedt/modules/PostProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2350,10 +2350,17 @@ def get_scalar_field_value(
else:
variation_dict.append("0deg")

self.ofieldsreporter.ClcEval(solution, variation_dict)
value = self.ofieldsreporter.GetTopEntryValue(solution, variation_dict)
file_name = os.path.join(self._app.working_directory, generate_unique_name("temp_fld") + ".fld")
self.ofieldsreporter.CalculatorWrite(file_name, ["Solution:=", solution], variation_dict)
value = None
if os.path.exists(file_name) or settings.remote_rpc_session:
with open_file(file_name, "r") as f:
lines = f.readlines()
lines = [line.strip() for line in lines]
value = lines[-1]
os.remove(file_name)
self.ofieldsreporter.CalcStack("clear")
return float(value[0])
return float(value)

@pyaedt_function_handler()
def export_field_file_on_grid(
Expand Down

0 comments on commit 4e7e35f

Please sign in to comment.